Connecting an external RAM to a microcontroller the easy way through pin swapping

In some applications you need greater amounts of RAM. Microcontrollers like the STM32 only have around 20 to some hundred kilobytes of internal RAM. So what do you do if your application needs require some megabytes of RAM, for example in high speed data acquisition systems?