lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-asf4-dfu/+/42302?usp=email )
Change subject: Errata 2.6.10: enable watchdog on boot ......................................................................
Errata 2.6.10: enable watchdog on boot
Previous the code was enabling the watchdog window on boot, but not the watchdog as the errata specified. It seems WDT EN and WDT WEN got accidental swapped.
Use the hal defines which also describes the function of the bits.
Change-Id: I581037724d19fb5abd0c5067f16a5769f9e264a7 --- M usb_flash_main.c 1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-asf4-dfu refs/changes/02/42302/1
diff --git a/usb_flash_main.c b/usb_flash_main.c index 8a18f27..3a60ca7 100644 --- a/usb_flash_main.c +++ b/usb_flash_main.c @@ -141,10 +141,10 @@ * Workaround: Start WDT with shortest period via NVMEM and stop it by ARM core. */ bool chiprev_lower_revG = ((DSU->DID.reg >> 8) & 0xf) < 0x6; - bool startup_wdt_inactive = _user_area_read_bits((void *)NVMCTRL_USER, 62, 1) != 1; + bool startup_wdt_inactive = _user_area_read_bits((void *)WDT_FUSES_ENABLE_ADDR, WDT_FUSES_ENABLE_Pos, 1) != 1; if (chiprev_lower_revG && startup_wdt_inactive) { - _user_area_write_bits((void *)NVMCTRL_USER, 50, 0, 4); - _user_area_write_bits((void *)NVMCTRL_USER, 62, 1, 1); + _user_area_write_bits((void *)WDT_FUSES_PER_ADDR, WDT_FUSES_PER_Pos, 0, 4); /* Watchdog period 0 */ + _user_area_write_bits((void *)WDT_FUSES_ENABLE_ADDR, WDT_FUSES_ENABLE_Pos, 1, 1); /* Enable watchdog */ }
// set bootprot bits for (15-13)=2 x8192 byte