
9 Feb
2015
9 Feb
'15
12:27 a.m.
Hi there,
I stumbled across a situation where the SPI flash on my board was write protected and i could not unlock it in the bootloader. This is especially unfortunate because the recovery mechanism relies on the bootloader to be able to erase the environment.
So any ideas how to fix this? I didn't see any code which unlocks the sectors yet.
We could add a lock/unlock function to the spi system, then call unlock in the beginning of saveenv() and lock at the end of saveenv(). Eg.
lockbits = read_status() & LOCK_BITS spi_unlock_all() saveenv() spi_lock(lockbits)
Also this should be exposed to the CLI somehow. "sf lock/unlock"?
-michael