Because there is not enough flash space inside the master to store the code. Therefore, it is necessary to use the SPI bus to plug Flash as a code storage area.
This requires a bank mechanism. Bank processing of the code, stored separately.
The closely related function code is placed in the same bank area.
The code for the entire bank is copied to the master internal RAM when the program is run, and the cache runs.
Because such a complex mechanism exists, so the code does not do a good job of bank processing, in the future program operation, often leads to a lot of strange phenomena exist.
Common commonly used public functions, to be placed in the common area, as a permanent storage.
Other functions are modular programming, when the code is connected, the bank is connected.
Each function to reduce the function to be stored in the same bank area, otherwise it will cause, in the same function, frequently switch the bank, light program inefficient, heavy program paralysis.
The size of each bank area, to the main control of the internal RAM space corresponding, remember not to exceed the size of RAM.
If the function is to use a large file, you need to be aware of where this file is stored, because it is possible to read this file in the process of generating the behavior of the bank, because DMA exists.