cortex-mkeilnxp-microcontroller

In Cortex M3 microcontroller, When will variables in .data section of Flash are copied to SRAM,Is


In Cortex M3 micro controller, When will variables in .data section of Flash are copied to SRAM,Is it before fetching of reset and initial SP pointers or later? Am using Keil4 and LPC 1778.


Solution

  • Here's how it normally goes:

    1. MCU's bootloader does minimum HW init, reads SP and PC from FLASH, and starts user code;
    2. User code copies .data from FLASH to RAM and zeroes .bss;
    3. main() is called.

    For example: