You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Background: The file source/daplink/drag-n-drop/iap_flash_intf.c contains the implementation of the flash_intf_t interface to flash the probe in order to update the bootloader or interface firmware. One of the feature it contains is that it will erase the first "sector" but cache it's content and only write the sector at the end. This is to minimize the time window in which an interrupted update might start anyway (whereas if the interrupt vector is missing, the failure will be immediate).
The constants DAPLINK_SECTOR_SIZE and DAPLINK_MIN_WRITE_SIZE are defined in the interface. The use of DAPLINK_SECTOR_SIZE in the design is wrong for two reasons:
It assumes that all erase sectors have the same size (STM32F4x1xx have sectors of size 16 KiB, 64 KiB and 128 KiB).
It assumes a sector is always a reasonable amount of data to cache in RAM (STM32H7 have sectors of 128 KiB).
The following changes are needed:
The Flash HAL should be extended to add a function that returns the size of the sector (given the address of the start of the sector).
Either remove the functionality that caches the first sector, or reduce the size of the buffer to mainly cover the reset vector. In the latter case, a possible enhancement would be to share the buffer with the flash interface used to flash targets.
The text was updated successfully, but these errors were encountered:
Background: The file
source/daplink/drag-n-drop/iap_flash_intf.c
contains the implementation of theflash_intf_t
interface to flash the probe in order to update the bootloader or interface firmware. One of the feature it contains is that it will erase the first "sector" but cache it's content and only write the sector at the end. This is to minimize the time window in which an interrupted update might start anyway (whereas if the interrupt vector is missing, the failure will be immediate).The constants
DAPLINK_SECTOR_SIZE
andDAPLINK_MIN_WRITE_SIZE
are defined in the interface. The use ofDAPLINK_SECTOR_SIZE
in the design is wrong for two reasons:The following changes are needed:
The text was updated successfully, but these errors were encountered: