Dear All,As I know, In Cortex M3, was implemented such as the B_ROM, I_RAM, D_RAM .and Basically, Cortex M3 is consist with internal memory ROM and SRAM.In Boot sequence, first of all, IROM code load BL1 code into the SRAM.So I want to know especially How do I make IROM code. I can't find ROM example.Would you please let me know such as any example (code) or documents..?How do I implement the cortex M3 Boot ROM code?
Hi there, there is no need to load ROM code into SRAM to execute. In most microcontroller system the program execute directly from ROM / flash memory. Some microcontrollers has additional boot ROM to allow some hardware initialization to be carried out before running software in flash, but that is optional, and please check with datasheets from MCU vendors to see if such boot ROM present.
When the Cortex-M3 processor start, it read the initial PC (starting address of a reset handler) and main SP from a vector table from address 0x0(0x0 is initial main SP, and 0x4 is initial PC), and then execute the reset handler. The vector table and the reset handler are normally in startup code files provided by MCU vendors. You can also find those example codes in CMSIS software packs (www.keil.com/pack).
Thanks Joseph Yiu,
Dear Sir, Happy new year
I'm confused that you said
Joseph Yiu said:In most microcontroller system the program execute directly from ROM / flash memory.
Because I think flash memory needed latency more than any other memory types to read and write. so to recover that disadvantage, some system mechanism use SRAM way . But I want you to know this is just my personal opinion.
Yes, flash access latency is usually much higher than SRAM.
However,
- you don't write to flash in normal operations. You still use SRAM for R/W data (e.g. local variables, stack, heap, etc).
- with AHB flash cache the access latency is mostly avoided (except when cache missed).
For the same memory size, the area of SRAM is larger than flash, which means higher silicon cost. So execute directly from flash (with caching) is best for most microcontroller applications.
regards,
Joseph