2020-12-10 09:44 AM
Hi there!
I want so offset the application in the flash at 0x08004000, so that I can use the first sector 0 for individual persistent data. I found out that I have to change the following lines:
FLASH (rx) : ORIGIN = 0x8004000, LENGTH = 496K (Linker Script)
#define VECT_TAB_OFFSET 0x4000 (system file of stm32f446)
So direct after flashing, the program is running (blinking led), but after power-cycling the stm, it does not start again. Could it be that the bootloader is still configured to start the application at 0x08000000? If this is the last problem I have here, how can I modify the address there?
With help of the stm utility tool, I can open the option bytes but it seems that the BOOT_ADD0 option is locked ! (See picture in attachment)
Is it this address ofset there which has also to be 0x4000?
In the datasheet, I can also not see an option to set an address for the bootloader in the FLASH_OPTCR Register. There are only options which I already can edit in the option bytes window of the stm utility tool.
I really would appreciate your help! Thanks.
Best Regards
2020-12-10 01:02 PM
The STM32F4 does not have a BOOT_ADD0 setting.
You need to put a program at 0x08000000 which jumps to your program at 0x08004000.
2020-12-10 01:19 PM
Thanks for that helpful answer! I honestly don't know how to do that, do you have a good reference for it?
2020-12-10 07:46 PM
Here's an example that jumps to the bootloader. Do this, except jump to your program instead.
https://stm32f4-discovery.net/2017/04/tutorial-jump-system-memory-software-stm32/
You'll need to make a small program that does this and place it at the flash boot address.
2020-12-11 12:54 AM
Thanks!! Btw.: The shematic shows that BOOT0 Pin is pulled down to ground, that means (according to datasheet), Main Flash memory is selected as the boot area. How is it possible then to flash a custom bootloader at 0x08000000 without overwriting the actual bootloader?
2020-12-11 06:02 AM