diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-05-07 14:10:34 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-05-07 14:10:34 -0600 |
commit | ac5855212c360abd2694688f799aa141b11b4b26 (patch) | |
tree | 8aa99cc548cf5a6244c83a0edf39d7d3cf5c2bbe | |
parent | cd2bc5b0d875c4cd8e11054e48f3e0185bbd3bab (diff) | |
download | px4-nuttx-ac5855212c360abd2694688f799aa141b11b4b26.tar.gz px4-nuttx-ac5855212c360abd2694688f799aa141b11b4b26.tar.bz2 px4-nuttx-ac5855212c360abd2694688f799aa141b11b4b26.zip |
STM32 option to disable sleep to prevent disconnection of debugger
-rw-r--r-- | nuttx/ChangeLog | 5 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/Kconfig | 9 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32_idle.c | 2 |
3 files changed, 16 insertions, 0 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index d7df4e1c1..f49d81528 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -4683,3 +4683,8 @@ * arch/arm/src/kinetis/kinetis_pin.c and arch/arm/src/kinetis/kinetis_internal.h: The Kinetis GPIO logic had some of the same issues as did the Kinetis L (2013-5-6). + * arch/arm/src/stm32/stm32_idle.c: Add an option to conditionally disable + the "wfi" sleep mode. This is needed with certain JTAG debuggers to + to prevent the debug session from begin disconnected. From Ken Pettit + (2013-5-7). + diff --git a/nuttx/arch/arm/src/stm32/Kconfig b/nuttx/arch/arm/src/stm32/Kconfig index d7e3c7a35..0980795e8 100644 --- a/nuttx/arch/arm/src/stm32/Kconfig +++ b/nuttx/arch/arm/src/stm32/Kconfig @@ -861,6 +861,15 @@ config STM32_JTAG_SW_ENABLE endchoice +config STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG + bool "Disable IDLE Sleep (WFI) in debug mode" + default n + ---help--- + In debug configuration, disables the WFI instruction in the IDLE loop + to prevent the JTAG from disconnecting. With some JTAG debuggers, such + as the ST-LINK2 with OpenOCD, if the ARM is put to sleep via the WFI + instruction, the debugger will disconnect, terminating the debug session. + config STM32_FORCEPOWER bool "Force power" default n diff --git a/nuttx/arch/arm/src/stm32/stm32_idle.c b/nuttx/arch/arm/src/stm32/stm32_idle.c index 83a6808c5..60b81bea8 100644 --- a/nuttx/arch/arm/src/stm32/stm32_idle.c +++ b/nuttx/arch/arm/src/stm32/stm32_idle.c @@ -202,10 +202,12 @@ void up_idle(void) */ #if !defined(CONFIG_STM32_CONNECTIVITYLINE) || !defined(CONFIG_STM32_ETHMAC) +#if !(defined(CONFIG_DEBUG_SYMBOLS) && defined(CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG)) BEGIN_IDLE(); asm("WFI"); END_IDLE(); #endif #endif +#endif } |