2025-11-10 12:07 AM
I have a Flash Full test failed issue with the STM32F427 ClassB library V4.0.0 code in Keil project.The project is generated from the STM32F446RE-Nucleo examples. Attached please find my scatter file and the post-build command batch file. (I have tested the official CubeIDE project and it can pass the Flash Full test and also the runtime partial flash test.)
Project.sct
LR_IROM1 0x08000000 0x00080000 { ; load region size_region (512KB FLASH)
; Interrupt Vector Table and Program Code (FLASH)
; Full 512KB flash region
; Note: CRC area (0x0807FFFC-0x0807FFFF) should be excluded from flash test
ER_IROM1 0x08000000 0x00080000 { ; load address = execution address (full 512KB)
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
.ANY (+XO)
}
; RAM Memory Region (192KB)
; Backup buffer section (for STL) - 32 bytes (0x20), placed first in RAM, UNINIT (NOLOAD)
backup_buffer_section 0x20000000 UNINIT 0x20 {
* (backup_buffer_section)
}
; Initialized data (loaded from FLASH) and uninitialized data
; Starts at 0x20000020 (after 32-byte backup buffer)
RW_IRAM1 0x20000020 0x0002FFE0 { ; RW data (192KB - 32 bytes RAM)
.ANY (+RW +ZI)
}
; CCMRAM Memory Region (64KB)
; CCMRAM initialized data (loaded from FLASH) and uninitialized data
RW_IRAM2 0x10000000 0x00010000 { ; CCMRAM (64KB)
* (.ccmram)
* (.ccmram*)
.ANY (+RW +ZI)
}
}
post-build.bat
C:\Keil_v5\ARM\Arm_Compiler_5.06u7\bin\fromelf.exe --bincombined --bincombined_padding=4,0xFFFFFFFF .\Out\Project.axf --output .\Out\Project.bin
STM32_Programmer_CLI.exe -sl .\Out\Project.bin 0x08000000 0x08080000 0x400
.\bin\srec_cat.exe .\Out\Project.bin -binary -offset 0x0000 -o .\Out\Project_v2.hex -intel
.\bin\srec_cat.exe .\Out\Project_v2.hex -intel -crop 0x08000000 0x0807FFFF -fill 0xFF 0x08000000 0x0807FFFF -crc32-l-e 0x0807FFFC -o .\Out\Project_CRC.hex -intel