Hi, All.
I want to start booting up a code in RAM starting with 0x1000 address in below circumstances. Please give me any advices for the below explanations.
My platform has one ROM and one RAM.
ROM and RAM both have their own F/W.
Core executes ROM codes first, then move program counter to ram region in general. And sometimes I want to implement to start booting up a instruction codes from RAM, ROM is being deactivated at this point.
Address map of memory is constructed as follows.
ROM (0x0000_0000 ~ 0x0000_0FFF)RAM(0x0000_1000 ~ 0x0000_1FFF)
I want to start fetching the instruction code from 0x0000_1000 but in simulation, core (CM0) always starts fetching instruction from 0x0000_0000 address.
I modified scatter file as follows to solve this, but core still start instruction fetching from 0x0000_0000.
Is a core(CM0) design option for deciding start address fetching the instruction? or Are any other ways to change start address what I want to?
scatter.scat
ROM_LOAD 0x00001000
{
EFLASH 0x00001000
startup_CMSDK_CM0.o (RESET, +First)
*.o(+RO)
}
SRAM 0x00001800
*.o(+RW,+ZI)
Check the Cortex-M0 TRM: Cortex-M start from 0 (or better, fetch the start address and start stack pointer from 0x0 and 0x4). So Simply set 0x0 := 0x1000 and your code starts at 0x1000.
Hi there,
Unfortunately this is fixed to 0 in the Cortex-M0 design. However, you can add address remapping logic at the bus level to help work around this aspect.
regards,
Joseph
Hi. Thank you. I'm a little bit confusing about "set 0x0 := 0x1000" on your reply.
Where should I set it? In F/W? or Startup code?
Hi Joseph,
Thank you. I'll consider what you told me.
Regards,
DY
In the vector table. But I was wrong, at 0x0 is the stack pointer and 0x04 the entry point.