Can MCU ROM and RAM limitations be scaled

cpumemory

Please note: Although this specific question has to do with the 32-bit ARM SAM3X8E Cortex M3 series, it is really a generic question that should be applicable to all microcontrollers, and therefore answerable by anyone who has significant experience with any MCU.

So the ARM SAM3X8E appears to only have 512KB ROM (that is, memory for holding flashed binaries), and 96KB RAM (that is, memory for running those flashed binaries). Hence if I have a binary, say, my-realtime-app.elf, that's 400KB and only consumes, say, 60KB (max) at runtime, it will happily store and run on this MCU.

I'm wondering if there is any way to "attach" (whatever that means) additional ROM/RAM storage to an MCU to overcome these limitations, and why this is or isn't possible to do.

For instance, say that my-realtime-app.elf undergoes extensive refactoring and starts doing all sorts of new computations and has new features, etc., and now is 12MB in size (the binary itself), and also now requires 15MB of RAM at runtime. This binary can no longer "fit"/run on the MCU, at least not without some kind of assistance. I'm wondering if I could somehow attach both additional ROM and RAM to the MCU, so as to give it more horsepower. If this isn't possible to do (for either scenario, ROM and RAM alike), I'd like to know why. And if it is possible, I'm interested in how.

I have to believe this is possible to do, but not sure about the approach/implementation. Also, I would imagine that the bit architecture of the MCU likely limits the size of the attached storage. For instance, this ARM MCU is 32-bit, which means it is only addressable up to 4GB. So it would not be able to handle binaries or runtime memory requirements about 4GB, etc.

Best Answer

A pure micro-controller has the memory busses (the wires and logic that connect the CPU to its ROM, RAM and peripherals) internally, hence there are no wires to connect an external ROM or RAM to. You are stuck with whatever ROM and RAM the manufacturer has included in the chip version that you are using. In most cases the manufacturer offers a range of related chips, the ROM and RAM size being one of the distingctive features of the various chips. You choose the chip that fits your needs. Your SAM3X8E seems to be in this category.

A pure micro-processor has no internal memory, and hence has external pins that are used to connect external ROM and RAM to. You choose the ROM and RAM to meet your needs.

There are hybrid chips, that have both internal RAM and ROM and pins that can be used to connect external RAM and ROM. (In some cases external memory can only be used for code, or only for data.) Such chips can be used either in microcontroller mode (without extrenal memory) or in microprocessor mode (with external memory).