I am testing some code in a STM32F446 to jump to the system memory from my firmware. I am using this code:
volatile uint32_t addr = 0x1FFF76DE;
* Step: disable RCC, set it to default (after reset) settings
* Internal clock, no PLL, etc.
* Step: disable systick timer and reset it to default values
SysTick->CTRL = 0;
SysTick->LOAD = 0;
SysTick->VAL = 0;
* Step: Remap system memory address 0x0000 0000 in addres space
* Step: Set jump memory location for system memory
* Use address with 4 bytes offset which specifies jump location
* where program starts.
SysMemBootJump = (void(*)(void)) (*((uint32_t *)(addr + 4)));
/** Step: Set main stack pointer **/
* Step: actually call our function to jump to set location
* This will start system memory execution
The fact is that when the MCU boots it goes to a Hard Fault from SysMemBootJump() instruction.
I am wondering whether I should configure the memory using the MPU to jump there.
The address used by the bootloader is from the AN.
Anyone could give me a clue about what is wrong with my code?
Thanks in advanced,