> I have not any experience with STM32, below is just a *guess only* . I > am looking on STM's idle thread action code: > > hal/cortexm/arch/current/include/hal_arch.h:294 > > #ifndef HAL_IDLE_THREAD_ACTION > #define HAL_IDLE_THREAD_ACTION(__count) __asm__ volatile ( "wfi\n" ) > #endif
If your issue is with the WFI instruction (and it sounds like it is), then the STM32 chips (or is it the Cortex itself?) provide support for maintaining a clock to keep JTAG operating when the chip is in its low power modes - the default is to stop the clock and then the JTAG connection is lost. You need to write to the DBGMCU_CR register, as detailed in 30.16 of the RM0008 Reference Manual for the chips. I certainly found I had issues unless I wrote this at the point where my debugger connected to the target. I think that this is better done as an openocd/jtag script item than as a modification to the eCos idle thread handling, although probably a note in the documentation to that effect would be worthwhile. Alan -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss