Description
While validating FlashDB sector headers from a real device dump, I noticed an inconsistency between the magic word macro value and its comment.
Current code:
/* magic word(`F`, `D`, `B`, `1`) */
#define SECTOR_MAGIC_WORD 0x30424446
However, 0x30424446 corresponds to "FDB0", not "FDB1".
Evidence from real flash data
I exported the Flash region using STM32CubeProgrammer and parsed the sector headers:
- Raw bytes at magic offset:
46 44 42 30
- ASCII:
"F" "D" "B" "0" → "FDB0"
- Little-endian u32:
0x30424446
This matches the macro value, but not the comment.
If the intended magic were "FDB1", the value should be:
- ASCII bytes:
46 44 42 31
- Little-endian u32:
0x31424446
Conclusion
- The macro value
0x30424446 is correct and matches real flash data.
- The comment is incorrect and should be updated.
Suggested fix:
/* magic word(`F`, `D`, `B`, `0`) */
#define SECTOR_MAGIC_WORD 0x30424446
(or update the macro if "FDB1" is actually intended).
Environment
- FlashDB version: #define FDB_SW_VERSION "2.1.1"
- MCU: STM32
- Flash dump verified via STM32CubeProgrammer
Description
While validating FlashDB sector headers from a real device dump, I noticed an inconsistency between the magic word macro value and its comment.
Current code:
However,
0x30424446corresponds to "FDB0", not "FDB1".Evidence from real flash data
I exported the Flash region using STM32CubeProgrammer and parsed the sector headers:
46 44 42 30"F" "D" "B" "0"→ "FDB0"0x30424446This matches the macro value, but not the comment.
If the intended magic were
"FDB1", the value should be:46 44 42 310x31424446Conclusion
0x30424446is correct and matches real flash data.Suggested fix:
(or update the macro if
"FDB1"is actually intended).Environment