Home > other > After stm32f103 extended SDRAM stack space partitioning problem
After stm32f103 extended SDRAM stack space partitioning problem
Time:09-18
Due to internal sram is only 64 KB size, in order to run a function, so the extended the external 1 MB sdram, the starting address of 0 0 x100000 x68000000 size, so that with external sram just like with internal sram, need not oneself apply for memory, also need not consider what memory address, all lets the compiler to resolve, According to library routines implemented FSMC expand external sdram, the system_stm32f10x function in the library. The c of the initialization file has actually initialization of an external SRAM, we just add "# define DATA_IN_ExtSRAM 1" this macro definition
Compile time again will compile initialization of an external SRAM, the initialization code you can go to the file of void SystemInit_ExtMemCtl (void) the function, One problem is that the function of internal array is allocated in the external sdram space there is no problem, but sp pointer (automatically assigns the stack area is not big, in the process of function calls, stack space to sp value less than 0 x68000000, so ask, external sdram, where stack interval size set? Is still automatically assigned, if automatic allocation should not appear in the process of the function call stack space is not enough ah,,,
CodePudding user response:
To the top! Correction: STM32F1 can only drive an SRAM, unable to drive the SDRAM, from a professional point of view, the building Lord some description is not quite right, but does not affect the understanding,