Hello @nima.askari,
Here is an example code for Bootloader application project:
For the Boot’s code:
- Add these instructions to the main.c
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();
- Change the FLASH memory size in the linker file according to the application start address.
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 28K (this is an example)
For the application’s code:
- Change the FLASH memory size in the linker file according to the application start address.
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.