cancel
Showing results for 
Search instead for 
Did you mean: 

After relocating IVT using VTOR, application work only in DEBUG session but not without debugger or Programmer (flash Hex file)

VJAIN.1
Associate

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:

  1. In debug session, i observed VTOR got loaded with new offset and LED toggles and application run properly. But when i attempt to stop debug session and do POReset OR flash same Hex file using Cube Programmer, Firmware do not run i.e. LED do not toggle.
  2. If we relocate IVT, Can we use default IVT locations i.e. 0x08000000 to store size of some address ranges.

Please assist and make me understand the exact issue and way to resolve this.

3 REPLIES 3

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?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Pavel A.
Evangelist III

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)

Cause there's an entry point described in the .ELF and .HEX

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..