2023-08-22 05:44 AM
Hello. I would like to write my own bootloader, but jump function does not work. could you send a complete example for stm32U575.
Solved! Go to Solution.
2023-08-23 09:30 AM - edited 2023-08-23 09:31 AM
Hello @nima.askari,
Here is an example code for Bootloader application project:
For the Boot’s code:
typedef void (*pFunction)(void);
#define APPLICATION_ADDRESS 0x08003800 (this is an example address)
pFunction JumpToApplication;
JumpToApplication = (pFunction) (*(volatile uint32_t*) (APPLICATION_ADDRESS + 4));
__set_MSP(*(uint32_t*) APPLICATION_ADDRESS);
JumpToApplication();
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 28K (this is an example)
For the application’s code:
FLASH (rx) : ORIGIN = 0x08003800, LENGTH = 100K
When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.
Thank you,
Rim.
2023-08-23 07:02 AM
Please Send me an example.
2023-08-23 09:30 AM - edited 2023-08-23 09:31 AM
Hello @nima.askari,
Here is an example code for Bootloader application project:
For the Boot’s code:
typedef void (*pFunction)(void);
#define APPLICATION_ADDRESS 0x08003800 (this is an example address)
pFunction JumpToApplication;
JumpToApplication = (pFunction) (*(volatile uint32_t*) (APPLICATION_ADDRESS + 4));
__set_MSP(*(uint32_t*) APPLICATION_ADDRESS);
JumpToApplication();
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 28K (this is an example)
For the application’s code:
FLASH (rx) : ORIGIN = 0x08003800, LENGTH = 100K
When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.
Thank you,
Rim.
2023-08-23 10:21 PM - edited 2023-08-24 02:24 AM
Hello @Rim LANDOLSI , thanks for your answer. Is it works for stm32U5 series? I read something about writing to option bytes. I tried your sample, but it doesn't work.
2023-08-24 11:22 PM
I found out the problem. ICACH should not be enable in bootloader .