Something was wrong about VECT_TAB_OFFSET after I update the PIO to the newest?

Hello, I use bootloader + application in my stm32l476rg, so 120KB was used for bootloader, and the reset used for application.

At last, I changed 2 places:

  1. Modified the ldscript.ld file
    Add LD_FLASH_OFFSET = 0x00020000;
    and modified
/* Memories definition */
MEMORY
{
  RAM     (xrw)     : ORIGIN = 0x20000000,   LENGTH = LD_MAX_DATA_SIZE
  RAM2    (xrw)     : ORIGIN = 0x10000000,   LENGTH = 32K
  FLASH   (rx)      : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
}
  1. Modified the platform.ini file
    Add (this for the interrupt offset)
build_flags =
     -DVECT_TAB_OFFSET=0x00020000

and (this for jlink download)

board_upload.offset_address = 0x08020000

And all the system worked well, after I update the PIO, when I complie the program, too many warnings like:


ignore the warnings and the application can not start from the bootloader.

I have no idea, where should I change the value of VECT_TAB_OFFSET,
At last I delete the

build_flags =
     -DVECT_TAB_OFFSET=0x00020000

and add
#define VECT_TAB_OFFSET 0x00020000 in the system_stm32l4xx.c file

there also a warning, but works well

Could you help me? Thank you !

This should not be the case with the latest clean STM32 platofrm and framework-arduinoststm32 package version. It should work completely without source code modifications to the framework files.

Have you tried backing up your current ~/.platformio/packages/framework-arduinoststm32 folder to somewhere, then deleting the original folder and building again?

Yeap, I have tried your suggestion, and delete all the unused floders like blow, but the problem still exist.

I dont know where is the VECT_TAB_OFFSET pre-definition in PIO?

Hi maxgerhardt,
I also mentioned it here, there is the official answer:

1 Like