-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Description
Description
NUCLEO_F429ZI Flash sector size is incorrect for Bank 2, Sectors 12-15. This causes problems when using FlashIAP to read/write on MCU Flash. See table 6 on page 77 RM0090 PDF
Bug exists in release 5.6.3
- Type: Bug
Bug
Target
NUCLEO_F429ZI
Toolchain:
GCC_ARM
mbed-os (5.6.3) sha:
e62a1b9
Suspected cause
GetSector
function in /mbed-os/targets/TARGET_STM/TARGET_STM32F4/flash_api.c
returns “16” for sectors 12 - 15
Steps to reproduce:
Run simple code to check sectors by start address:
#include "mbed.h"
FlashIAP flash;
int main(void){
uint32_t first_sector = (uint32_t)0x08000000;
uint32_t last_sector = (uint32_t)0x081E0000;
uint32_t addr = first_sector;
uint32_t sector_size;
printf("\r\nStart of program\r\n");
while(addr < last_sector +1){
sector_size = flash.get_sector_size(addr);
printf("Sector at %#10x of size %u\r\n", addr, sector_size);
addr += sector_size; // next sector
}
printf("\r\nEnd of program\r\n");
return 0;
}
Actual result:
Start of program
Sector at 0x8000000 of size 16384
Sector at 0x8004000 of size 16384
Sector at 0x8008000 of size 16384
Sector at 0x800c000 of size 16384
Sector at 0x8010000 of size 65536
Sector at 0x8020000 of size 131072
Sector at 0x8040000 of size 131072
Sector at 0x8060000 of size 131072
Sector at 0x8080000 of size 131072
Sector at 0x80a0000 of size 131072
Sector at 0x80c0000 of size 131072
Sector at 0x80e0000 of size 131072
Sector at 0x8100000 of size 65536 // Erroneus sector / size
Sector at 0x8110000 of size 65536 // Sector 16
Sector at 0x8120000 of size 131072
Sector at 0x8140000 of size 131072
Sector at 0x8160000 of size 131072
Sector at 0x8180000 of size 131072
Sector at 0x81a0000 of size 131072
Sector at 0x81c0000 of size 131072
Sector at 0x81e0000 of size 131072
End of program
Expected result:
Start of program
Sector at 0x8000000 of size 16384
Sector at 0x8004000 of size 16384
Sector at 0x8008000 of size 16384
Sector at 0x800c000 of size 16384
Sector at 0x8010000 of size 65536
Sector at 0x8020000 of size 131072
Sector at 0x8040000 of size 131072
Sector at 0x8060000 of size 131072
Sector at 0x8080000 of size 131072
Sector at 0x80a0000 of size 131072
Sector at 0x80c0000 of size 131072
Sector at 0x80e0000 of size 131072
Sector at 0x8100000 of size 16384 // Sector 12
Sector at 0x8104000 of size 16384
Sector at 0x8108000 of size 16384
Sector at 0x810c000 of size 16384
Sector at 0x8110000 of size 65536 // Sector 16
Sector at 0x8120000 of size 131072
Sector at 0x8140000 of size 131072
Sector at 0x8160000 of size 131072
Sector at 0x8180000 of size 131072
Sector at 0x81a0000 of size 131072
Sector at 0x81c0000 of size 131072
Sector at 0x81e0000 of size 131072
End of program