Corrupted Flash in Vector Table area - sector 0
Dear community,
I have faced with the problem in our developed boards with STM32F407 MCU. The firmware is based on FreeRTOS, vector table is located as usually in the beginning of 0x08000000 (see part of list file below).
Idx Name Size VMA LMA File off Algn
0 .isr_vector 00000188 08000000 08000000 00010000 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
Boards with MCU are flashed with USB-UART adapter and STM32 Flash loader demonstrator https://www.st.com/en/development-tools/flasher-stm32.html
Boards have some parameters (configuration of sensors), stored in the Flash memory, so we used sector 7 for these data, and customer can update the information about these sensor parameters. Mainly boards works well, but some of them were returned from the customer as "works well, but now don't works at all". After reading the memory damp and comparison with reference board with the same firmware that works perfect, I have found that some memory area is corrupted, and it is only in vector table area - sector 0.
Some observations:
- Corrupted Flash memory in the initial part of the memory (addresses starting from 0x08000000 – see Figure 1). All corrupted bytes are located in the area of flash memory, called “Vector table”, that is responsible for the initial position of the addresses for interrupt. The first 16 bytes (0x08000000…0x0800000F) in Flash memory are ok, but all three boards has corrupted bytes in the range from 0x08000030…0x08000108.
- All corrupted bytes are located consequently (see Figures 2…4), and forms “corrupted range”, e.g., for the board 3 this range is 0x08000010…0x0800012B, for the board 2 this range is 0x0800002C…0x0800010A, and for the board 1 this range is 0x08000030…0x08000117. No any corrupted bytes in other flash memory addresses, except this corrupted range were found.
- In many cases, inside this corrupted range, all bits from one byte in Flash memory were set to 0x00 (so all bits are set to 0), but in some cases, only some bits are set to 0, such cases shown in Excel table with blue background. Some examples of such bytes are: correct data byte that should be is 0x3F – 00111111B, and corrupted byte is 0x1A – 00011010B, or correct data byte that should be is 0xD9 – 11011001B, and corrupted byte is 0xD8 – 11011000B.
- In all three cases, corrupted zone has “central” part, where all byte is corrupted (set to 0x00), but on the “border” zone (firsts corrupted bytes in memory), close to non-corrupted Flash memory, only some bits are corrupted (such cases shown in Excel table with blue background), or, corrupted and not corrupted bytes are alternate one after another (corrupted byte – non-corrupted byte – non-corrupted byte – non-corrupted byte – corrupted byte), shown in Excel table with green background. Taking into account, that some bytes in the correct Flash should be 0x00, it is not possible to investigate this alternation deeper, because such bytes, even in case of corruption, will not change the content.
It seems to me, that it is not a problem with my software, but rather some problems with the microcontrollers. Have any faced with the same issue?
