Skip to content

Commit 6060eee

Browse files
committed
Add debug logging to GD32 flash reads
Add entry, exit, and offset debug traces to `FlashCode::Read()` in the GD32 flash backend. This improves visibility into blocking flash read operations without changing the read result handling.
1 parent d2ea166 commit 6060eee

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

lib-flashcode/src/gd32/flashcode.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,13 @@ uint32_t FlashCode::GetSectorSize() const {
6262
}
6363

6464
bool FlashCode::Read(uint32_t offset, std::span<uint8_t> buffer, flashcode::Result& result) {
65+
FLASHCODE_DEBUG_ENTRY();
66+
FLASHCODE_DEBUG_PRINTF("offset=%u", static_cast<unsigned>(offset));
67+
6568
const auto kStatus = gd32::fmc::Read(offset, buffer); // Blocking
6669
result = kStatus ? flashcode::Result::kOk : flashcode::Result::kError;
70+
71+
FLASHCODE_DEBUG_EXIT();
6772
return true;
6873
}
6974

0 commit comments

Comments
 (0)