STM32F427 CLASSB V4.0.0 Keil project: flash test failed with starting address at 0x08008000
I have a project which can pass the flash test while starting address is at 0x08000000. After changing the starting address to 0x08008000, the flash test failed.
I have made the following changes:
1. main.c
// #define TEST_ROM_START_ADDR 0x08000000U
#define TEST_ROM_START_ADDR 0x08008000U
2. system_stm32f4xx.c
#define USER_VECT_TAB_ADDRESS
#if defined(USER_VECT_TAB_ADDRESS)
/*!< Uncomment the following line if you need to relocate your vector Table
in Sram else user remap will be done in Flash. */
/* #define VECT_TAB_SRAM */
#if defined(VECT_TAB_SRAM)
#define VECT_TAB_BASE_ADDRESS SRAM_BASE /*!< Vector Table base address field.
This value must be a multiple of 0x200. */
#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field.
This value must be a multiple of 0x200. */
#else
#define VECT_TAB_BASE_ADDRESS FLASH_BASE /*!< Vector Table base address field.
This value must be a multiple of 0x200. */
//#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field.
// This value must be a multiple of 0x200. */
#define VECT_TAB_OFFSET 0x00008000U
#endif /* VECT_TAB_SRAM */
#endif /* USER_VECT_TAB_ADDRESS */
3. Project.sct
;LR_IROM1 0x08000000 0x00080000 { ; load region size_region
LR_IROM1 0x08008000 0x00070000 { ; load region size_region
; ER_IROM1 0x08000000 0x00080000 { ; load address = execution address
ER_IROM1 0x08008000 0x00070000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
.ANY (+XO)
}
4.post-build.bat
STM32_Programmer_CLI.exe -sl "Out/Project.axf" 0x08008000 0x08078000 0x400
C:\Keil_v5\ARM\Arm_Compiler_5.06u7\bin\fromelf.exe --bincombined --bincombined_padding=4,0xFFFFFFFF .\Out\Project.axf --output .\Out\Project.bin
5. In Options for Target's "Target" tab:
IROM1: Start 0x08008000, size 0x70000
The CRC are inserted successfully, but the Full Test at start is failed at flash test. Do I miss any setting or modifications?
Thank you.
