2021-04-29 07:05 AM
Hello,
I am using sample program RTOS Thread creation with LED toggling for STM32H723 nucleo board.
LED toggles and application works properly with interrupt vector table at default Flash address 0x0800.0000. This works for debug session. This also works when i flash hex file using Cube Programmer.
CODE Changes to relocate IVT:
When i attempt to relocate IVT from 0x0800.0000 to 0x0800.0200, for this i did below changes.
1. Changed VTOR
//#define VECT_TAB_OFFSET 0x00000000UL /*!< Vector Table base offset field.
#define VECT_TAB_OFFSET 0x00000200UL /*!< Vector Table base offset field.
2. In FLASH linker file, below changes makes IVT and entire FW to relocate to 0x08000200
MEMORY
{
ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
/* ROM (rx) : ORIGIN = 0x08000000, LENGTH = 1024K */
ROM (rx) : ORIGIN = 0x08000200, LENGTH = 1024K
}
SECTIONS
{
/* The startup code into "ROM" Rom type memory */
.isr_vector :
{
. = ALIGN(4);
KEEP(*(.isr_vector)) /* Startup code */
. = ALIGN(4);
} >ROM
...
}
QUERIES:
Please assist and make me understand the exact issue and way to resolve this.
2021-04-29 07:14 AM
Do you have any loader code at the 0x08000000 basis to transfer control?
How about Option Byte changes to effect where the processor expects the initial vectors to reside?
2021-04-29 07:17 AM
When you relocate IVT to a custom address, how will the chip know where is your code located? Thoughts?
(the debugger knows it because it is smart)
2021-04-29 07:20 AM
Cause there's an entry point described in the .ELF and .HEX