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:
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
}
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:
opened 06:52AM - 27 Feb 24 UTC
Hello, I use bootloader + application in my stm32l476rg, so 120KB was used for b… ootloader, 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
}
```
2. 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:
![image](https://github.com/platformio/platform-ststm32/assets/55439370/0a557d54-a6cc-4a4b-94f4-a3ad9edd2450)
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
![image](https://github.com/platformio/platform-ststm32/assets/55439370/2d358a27-f153-4bd4-ac72-756ece02b929)
Could you help me? Thank you !
1 Like