mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-29 21:08:24 +00:00
Flash unlock validation on STM32
This commit is contained in:
1 parent
9ccfc02a86
commit
fa4a2563e5
4 files changed
+34
-36
No files matched your search
+1
-3
@@ -45,11 +45,9 @@ MG_IRAM static int is_dualbank(void) {
|
||||
}
|
||||
|
||||
MG_IRAM static void flash_unlock(void) {
|
||||
static bool unlocked = false;
|
||||
if (unlocked == false) {
|
||||
if (MG_REG(MG_FLASH_BASE + MG_FLASH_CR) & MG_BIT(31)) {
|
||||
MG_REG(MG_FLASH_BASE + MG_FLASH_KEYR) = 0x45670123;
|
||||
MG_REG(MG_FLASH_BASE + MG_FLASH_KEYR) = 0xcdef89ab;
|
||||
unlocked = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user