[riot-notifications] [RIOT-OS/RIOT] stm32l152re: hard-fault unless power-cycled after flash, or depending on optimization (#11820)

Francisco notifications at github.com
Thu Jul 11 10:28:24 CEST 2019


@cladmi I would propose changing the openocd config for all stm32 to add this:

```
# We override openocd default configuration for this event so to not enable debug
# when flashing or resetting device
$_TARGETNAME configure -event examine-end {
    # Stop watchdog counters during halt
	# DBGMCU_APB1_FZ |= DBG_IWDG_STOP | DBG_WWDG_STOP
	mmw 0xE0042008 0x00001800 0
}

$_TARGETNAME configure -event gdb-attach {
	# DBGMCU_CR |= DBG_STANDBY | DBG_STOP | DBG_SLEEP
	mmw 0xE0042004 0x00000007 0

	# DBGMCU_APB1_FZ |= DBG_IWDG_STOP | DBG_WWDG_STOP
	mmw 0xE0042008 0x00001800 0
}

$_TARGETNAME configure -event gdb-detach  {
	# DBGMCU_CR &= ~(DBG_STANDBY | DBG_STOP | DBG_SLEEP)
	mmw 0xE0042004 0x00000000 0x00000007

	# DBGMCU_APB1_FZ &= ~(DBG_IWDG_STOP | DBG_WWDG_STOP)
	mmw 0xE0042008 0x00000000 0x00001800
}

```

That way the `DBGMCU_CR_DBG_STANDBY | DBGMCU_CR_DBG_STOP | DBGMCU_CR_DBG_SLEEP` bits would only be set when needed, i.e. when debugging. I tested briefly on stm32l1.

This still wouldn't fix this issue because there is still a problem with wakeups when `DBGMCU_CR_DBG_STANDBY | DBGMCU_CR_DBG_STOP | DBGMCU_CR_DBG_SLEEP` are set.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/issues/11820#issuecomment-510386282
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190711/de02cdd4/attachment.html>


More information about the notifications mailing list