W dniu 2012-11-21 16:34, Jonathan Dumaresq pisze:
> Error: jtag status contains invalid mode value - communication failure
> Polling target failed, GDB will be halted. Polling again in 300ms
> target state: halted
> target halted due to debug-request, current mode: Thread
> xPSR: 0x21000000 pc: 0x0800231a msp: 0x20003e38
> Polling succeeded again

I see this behavior when debugging RTOSes which use WFI/WFE... Even if 
the code in STM32 sets bits in DBGMCU register to enable debuggin during 
low-power modes it takes several tries (~10) to connect to the target 
for the first time - then everything works fine until I cycle power to 
the target device.

So if your code uses WFI or WFE you have to make sure to set this before 
first such instruction:

>     uint32_t cr = getreg32(STM32_DBGMCU_CR);
>     cr |= DBGMCU_CR_STANDBY | DBGMCU_CR_STOP | DBGMCU_CR_SLEEP;
>     putreg32(cr, STM32_DBGMCU_CR);

The above example uses NuttX functions and defines, but the general idea 
is the same.

4\/3!!

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to