Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reading of security bit to D5xNvmFlash #127

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/D5xNvmFlash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
#define NVM_CMD_SSB 0x16
#define NVM_CMD_PBC 0x15

#define DSU_ADDR 0x41002000
#define DSU_STATUSB_OFFSET 0x2
#define DSU_STATUSB_PROT_MASK 0x1

#define ERASE_BLOCK_PAGES 16 // pages

// NVM User Page
Expand Down Expand Up @@ -137,8 +141,9 @@ D5xNvmFlash::getLockRegions()
bool
D5xNvmFlash::getSecurity()
{
// There doesn't seem to be a way to read this
return false;
uint8_t byte = _samba.readByte(DSU_ADDR + DSU_STATUSB_OFFSET);

return byte & DSU_STATUSB_PROT_MASK;
}

bool
Expand Down