Why do all the IAP references for the H7 published by STM, show the wrong address?
I wasted many, many hours because the datasheet and app notes give the wrong boot address. For those of you that need to jump to the bootloader on the H7, use the following:
// Bootloader actual start of vector table is here...
// No idea why the F&@# they don't show this in the app note.
const uint32_t bootloaderStackPtrAddr = 0x1ff09800;
const uint32_t bootloaderStartPtrAddr = bootloaderStackPtrAddr + 4;
void jumpToDfu( void )
{
// Disable all interrupts.
__disable_irq();
// Shut down any running tasks / disable systick and interrupt.
HAL_SuspendTick();
// Set RCC to default values.
HAL_RCC_DeInit();
HAL_DeInit();
// Turn off all interrupts and clear all interrupt pending flags.
for ( uint8_t i = 0; i < 8; i++ )
{
NVIC->ICER[ i ]=0xFFFFFFFF;
NVIC->ICPR[ i ]=0xFFFFFFFF;
}
// Re-enable global interrupts.
__enable_irq();
// Read and set the primary stack pointer, using the first word in the
// bootloader vector table as the stack location.
uint32_t bootloaderStackPtr = *(uint32_t *)bootloaderStackPtrAddr;
__set_MSP( bootloaderStackPtr );
// In case of privileged mode, set to use MSP.
__set_CONTROL( 0 );
// Load the program counter with the SystemMemory reset vector.
void (*sysMemBootJump)( void ) = (void (*)( void ))( *(uint32_t*)bootloaderStartPtrAddr );
sysMemBootJump();
while( 42 );
}
