User Tools

Site Tools


manual:ports:armcm7_stm32h7

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
manual:ports:armcm7_stm32h7 [2021/06/15 11:15]
voorburg
manual:ports:armcm7_stm32h7 [2022/11/07 11:29] (current)
voorburg [Checksum location]
Line 13: Line 13:
 In case you want to manually change the size of the bootloader, make sure the size is aligned to the sectors as outlined in the flashLayout[] array in file flash.c. For the STM32H7xx targets, the sectors are 0x20000 (128 kbyte) in size, which is also the smallest erase size of the flash memory. This means that the reserved space for the bootloader should always be a multiple of 128 kbyte. In case you want to manually change the size of the bootloader, make sure the size is aligned to the sectors as outlined in the flashLayout[] array in file flash.c. For the STM32H7xx targets, the sectors are 0x20000 (128 kbyte) in size, which is also the smallest erase size of the flash memory. This means that the reserved space for the bootloader should always be a multiple of 128 kbyte.
  
-Before the bootloader starts your firmware, it automatically reconfigured the start address of the interrupt vector table. Unfortunately,​ the default system initialization function SystemInit() from ST's driver library, overwrites this change. This function is implemented in source file system_stm32h7xx.c. To correct this you need to explicitly set the start address of the interrupt vector table as the first thing in function main(). Here is an example of how this can be done when using Atollic TrueStudio as the IDE:+Before the bootloader starts your firmware, it automatically reconfigured the start address of the interrupt vector table. Unfortunately,​ the default system initialization function SystemInit() from ST's driver library, overwrites this change. This function is implemented in source file system_stm32h7xx.c. To correct this you need to explicitly set the start address of the interrupt vector table as the first thing in function main(). Here is an example of how this can be done when using STM32CubeIDE:
  
 Add the following function to main.c: Add the following function to main.c:
Line 47: Line 47:
 A 32-bit checksum value is programmed by the bootloader at the end of a programming session. Upon startup, the bootloader verifies the correctness of this checksum to determine if a valid user program is present and can be started. A 32-bit checksum value is programmed by the bootloader at the end of a programming session. Upon startup, the bootloader verifies the correctness of this checksum to determine if a valid user program is present and can be started.
  
-The bootloader programs this value at the end of the user program'​s vector table. Its exact location is configured by macro FLASH_VECTOR_TABLE_CS_OFFSET ​in flash.c. The vector table size can vary based on the microcontroller derivative you are using. Please verify that the default value of FLASH_VECTOR_TABLE_CS_OFFSET ​is correct. If not, you can simply override the value by adding the macro with the correct value to the blt_conf.h configuration header file.+The bootloader programs this value at the end of the user program'​s vector table. Its exact location is configured by macro BOOT_FLASH_VECTOR_TABLE_CS_OFFSET ​in flash.c. The vector table size can vary based on the microcontroller derivative you are using. Please verify that the default value of BOOT_FLASH_VECTOR_TABLE_CS_OFFSET ​is correct. If not, you can simply override the value by adding the macro with the correct value to the blt_conf.h configuration header file.
  
 The user program must reserve space for this 32-bit checksum value. To reserve this space, simply enter one extra dummy entry into the interrupt vector table. This reserves space for the checksum at memory address: flash base address + flash reserved for bootloader ​ + FLASH_VECTOR_TABLE_CS_OFFSET. Refer to the demo program for an example. The user program must reserve space for this 32-bit checksum value. To reserve this space, simply enter one extra dummy entry into the interrupt vector table. This reserves space for the checksum at memory address: flash base address + flash reserved for bootloader ​ + FLASH_VECTOR_TABLE_CS_OFFSET. Refer to the demo program for an example.
manual/ports/armcm7_stm32h7.1623748527.txt.gz ยท Last modified: 2021/06/15 11:15 by voorburg