Skip to content

Sector magic word comment does not match actual value (FDB0 vs FDB1) #393

@vmut0228

Description

@vmut0228

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


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions