Hasty Briefsbeta

Bilingual

When the Debugger Lies

2 days ago
  • The author manually interacts with the Key Management Unit (KMU) of nRF54L series using GDB, provisioning and pushing keys to slots.
  • After provisioning and pushing keys, reading memory via GDB's `x` command returns stale values due to J-Link debugger's internal memory cache.
  • Using JLinkGDBServer's `ReadMemAP` command bypasses the cache and returns the correct values, confirming the cache issue.
  • Disabling the memory cache with `SetEnableMemCache=0` solves the problem, but it is not recommended for general use.
  • The cache only becomes a problem when peripherals (like KMU) write to memory while the CPU is halted; otherwise, advancing the CPU clears the cache.