STM32CubeMX linker scripts for F767ZI appear to use AXIM interface, but is that true?
The linkerscripts generated by the STM32CubeMX for STM32F767ZI appear to use the AXIM interface:
/* Specify the memory areas */
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 512K
}But the default boot vector is set to address 0x0020 0000 which is a ITCM address:
# gdb console
> monitor stm32f7x options_read 0
stm32f2x user_options 0xFFC, boot_add0 0x0080, boot_add1 0x0040boot_add0 0x0080 indicates ITCM.
When I move the boot vector by 128K, I have to set boot_add0 to 0x0088 (8*16K=128K) and set FLASH ORIGIN in above linker script to 0x08020000. Otherwise it will not work. That is a bit confusing.
- Is the MCU really booting from ITCM?
- The binary code is not explicitly position-independent. I contains absolute jumps to addresses in the AXIM space because that is what LMA and VMA are configured to in the default linker scripts. Does my application only work by accident?
- Should LMA and VMA in the linker script be separated, i.e. VMA of code sections points to the ITCM address space whereas LMA points to the AXIM address space so that OpenOCD can load the program?
Thanks.
