Copying the running application from the bootloader/application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-26 5:19 AM
Hi,
Am using a STM32WL55JCix series MCU for my application. Created a custom bootloader running at 0x08000000 with size 25K and application runs at 0x08006400 with size 231K.
I was able to run the bootloader and jump to application without any issue. As part of the OTA firmware update, the downloaded image will be saved to external flash OTA sector1. Then from the bootloader, check for new firmware in the external flash. if the OTA image is there, want to save the currently running application to external flash OTA sector2 and then load the OTA image to internal flash.
The problem arise here. able to get the flash image size by
extern int _etext;
#define IMAGE_LAST_ADDRESS (uint32_t) (& _etext)
uint32_t imageSize = IMAGE_LAST_ADDRESS - APP_BASE_ADDRESS;
and copy the image.
from the boot loader if i load this image to flash with same application at 0x08006400, it running.
But if i flash a new image at 0x08006400 and load the old image from external flash to the internal flash at 0x08006400, then its not working
Any help on this one ? am i copying all the necessary data to the external flash ?
Solved! Go to Solution.
- Labels:
-
STM32WL series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-28 10:20 AM
Hi.. its solved..
extern int _etext;
#define IMAGE_LAST_ADDRESS (uint32_t) (& _etext).it will give only the code not the complete image from the flash.
Added new variable in the linker script which will give last flash address.
.endof :
{
_flash_end_addr = .;
} >FLASH
From this able to get the exact size of the image and get the backup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-26 3:37 PM
If you copy the program into flash, and the program works, it'll run.
If it doesn't run, verify that the flash was programmed successfully by loading in STM32CubeProgrammer and comparing to the target flash image. If it matches, you need to debug the program. If not, you need to debug the flashing procedure.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-28 10:20 AM
Hi.. its solved..
extern int _etext;
#define IMAGE_LAST_ADDRESS (uint32_t) (& _etext).it will give only the code not the complete image from the flash.
Added new variable in the linker script which will give last flash address.
.endof :
{
_flash_end_addr = .;
} >FLASH
From this able to get the exact size of the image and get the backup
