-
Notifications
You must be signed in to change notification settings - Fork 2
Memory layout of the micro controller
The micro-controller code is stored in FLASH but runs entirely out of SRAM. The memory layout of the microcontroller is show below. There are two programs, a boot loader and the main program. The boot loader is a mild customization of the boot loader included in the Tivaware package and can be found under cm_mcu/boot_loader
in the repository.
Address range | what | comment |
---|---|---|
0x0 - 0x3FFF | bl_main.bin | FLASH: boot loader |
0x4000 - 0x100000 | cm_mcu.bin | FLASH: main program |
0x20000000 - 0x20040000 | run-time | SRAM: both programs run entirely in SRAM |
The locations of these can be seen in the ld files in either the cm_mcu project or in the boot_loader project. On startup the reset ISR is called, which in both cases (bl_main and cm_mcu) copies the entire binary into SRAM. This includes the text, bss and data segments.
The start location of the main program (and hence the size of the boot loader) is a choice that has to be optimized by hand; the value needs to be synchronized explicitly between the two projects.
The boot loader jumps directly to the ResetISR
function of the main program at the end of its operation, either after re-programming the flash or on regular boot.