According to the "Address Remapping" section of the "RZ/A1L Group, RZ/A1LU Group, RZ/A1LC Group manual", a remap operation on this MCU causes the address range 0x20000000 - 0x204FFFFF to be allocated to 0x00000000 - 0x004FFFFF. The manual also states in section 3.5.1 that, in boot mode 0, "program execution is started from H'0000_0000". Thus, in boot mode 0, the reset/boot vector must be placed at 0x00000000.
So, if the MCU is booted in boot mode 0 and an address remap is issued shortly after during startup, would the startup code (and reset handler) be accessible after the remap? (Assuming it's linked/downloaded to the start of the CS0 space) Put in another way, would the startup code still run in between 0x00000000 and 0x004FFFFF? Or would it rather run in the CS0 mirror space (0x40000000 - 0x43FFFFFF)?
I was under the understanding that, after the remap, accesses to the 0x00000000 - 0x004FFFFF range would be interpreted by the MMU as accesses to the range 0x20000000 - 0x204FFFFF, which is ultimately why it is advantageous for the vector table to be remapped.
Thanks to user @old_timer's comments, I was able to identify a misunderstanding on my part with respect to the concept of memory mapping. After "connecting the dots" and resolving this misunderstanding, it gave way to the answer to this question.
What I was (embarrassingly) not understanding before was that the whole purpose of a remap operation is to reconfigure a set of addresses that are associated with a specific memory device/interface (e.g. SPI, flash, SRAM, etc.) with a different one.
With this in mind, at bootup (and before a remap operation), the CS0 space is mapped to a specific device: SRAM with byte selection or burst ROM (asynchronous or synchronous), as specified on page 181 of the User Manual). In boot mode 0, the startup code would subsequently need to be loaded into that same device, whatever it may be (either SRAM or burst ROM). In boot mode 1, the startup code would need to reside in the SPI multi-I/O bus space (serial flash memory); in boot mode 2, SD controller (NAND flash memory); etc.
After a remap, the CS0 address space is subsequently mapped to the on-chip RAM. The code that was executing before the remap still resides in and executes from where it was loaded.
User contributions licensed under CC BY-SA 3.0