I want to implement a boot loader routine located in the first flash sector (0x8000000) of a stm32F407 device. After power up the bootloader decides whether the program pointer can jump to the main app located @ 0x8004000 or stay within the boot loader routine.
I managed so far to upload a bootloader interface and an app to the desired memory locations. Then I was copy and pasting the following code from https://community.st.com/thread/36757-bootloader-problem-with-stm32f4:
#define APPLICATION_ADDRESS (uint32_t)0x08040000
typedef void (*pFunction)(void);
// Jump to user application
JumpAddress = *(__IO uint32_t*) (APPLICATION_ADDRESS + 4);
Jump_To_Application = (pFunction) JumpAddress;
// Initialize user application's Stack Pointer
__set_MSP(*(__IO uint32_t*) APPLICATION_ADDRESS);
Inside the system_stm32f4xx.c of the Testapp located @ 0x08040000 I modified the line:
#define VECT_TAB_OFFSET 0x40000
Since the post in mentioned forum (see above) mentioned this script has to work I would be very happy if someone could comment on this (unfortunately in my case it does not work).