do not lock flash when booting to dfu
This commit is contained in:
parent
4c464c9cc4
commit
e4bc364c38
@ -32,14 +32,17 @@ static void flash_unlock(void)
|
|||||||
void flash_option_bytes_init(int boot_from_dfu)
|
void flash_option_bytes_init(int boot_from_dfu)
|
||||||
{
|
{
|
||||||
uint32_t val = 0xfffff8aa;
|
uint32_t val = 0xfffff8aa;
|
||||||
if (solo_is_locked()){
|
|
||||||
val = 0xfffff8cc;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (boot_from_dfu)
|
if (boot_from_dfu){
|
||||||
{
|
|
||||||
val &= ~(1<<27); // nBOOT0 = 0 (boot from system rom)
|
val &= ~(1<<27); // nBOOT0 = 0 (boot from system rom)
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if (solo_is_locked())
|
||||||
|
{
|
||||||
|
val = 0xfffff8cc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val &= ~(1<<26); // nSWBOOT0 = 0 (boot from nBoot0)
|
val &= ~(1<<26); // nSWBOOT0 = 0 (boot from nBoot0)
|
||||||
val &= ~(1<<25); // SRAM2_RST = 1 (erase sram on reset)
|
val &= ~(1<<25); // SRAM2_RST = 1 (erase sram on reset)
|
||||||
val &= ~(1<<24); // SRAM2_PE = 1 (parity check en)
|
val &= ~(1<<24); // SRAM2_PE = 1 (parity check en)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user