cancel
Showing results for 
Search instead for 
Did you mean: 

Why do all the IAP references for the H7 published by STM, show the wrong address?

Aqwer.1
Associate II

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 );

}

2 REPLIES 2
TDK
Guru

> I wasted many, many hours because the datasheet and app notes give the wrong boot address.

Which references?

This one seems right to me:

https://community.st.com/s/article/STM32H7-bootloader-jump-from-application

So does this one:

https://www.st.com/resource/en/application_note/cd00167594-stm32-microcontroller-system-memory-boot-mode-stmicroelectronics.pdf

0693W00000AN2RoQAL.png 

Note that "system memory" and "boot address" are not interchangeable.

If you feel a post has answered your question, please click "Accept as Solution".

From the screenshot above:

> The system clock frequency is 66 MHz (using PLL clocked by the HSI)

This seems absurd. As the HSI has frequency of 64 MHz. While technically it can be done, I don't see a point of using a PLL to rise the system frequency to 66 MHz, which is almost the same. And it's not the case on other H7 sub-series either.

@Imen DAHMEN​ , @Amel NASRI​ , this should be checked and/or corrected.