On Sun, Dec 12, 2010 at 5:22 PM, Manuel Borchers <man...@matronix.de> wrote:
> Hi all,
>
> I'm a bit lost with a problem concerning OpenOCD, eCos and my STM32
> board.
>
> I'm running with a ftdi2232-based usb2jtag adapter. I'm already using
> this adapter for quite a long time for my ARM9-based projects, so the
> hardware should be fine.
>
> I'm currently porting eCos to a STM32 MINI board, which John announced a
> while ago. The port is based on the STM3210E board port.
>
> A simple demo program which prints out some lines on the serial channel
> is being flashed into the chip's on-chip flash. When I let the processor
> run it directly without debugger, it works fine.
>
> But when I'm stepping through the code and want to step over a
> thread-delay routine OpenOCD or the CPU gets somewhat confused and I'm
> unable to continue debugging.
>
> That's what I'm doing in gdb (arm-eabi-gdbtui actually):
>
> target remote :3333
> mon reset init
> load
> b simple_prog
> c
> b serial.c:99 [the line before the thread delay function]
> c
> n
>
> And that's what I'm getting in GDB then:
> -- snip --
> JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed
> MEM_AP_CSW 0x23000042, MEM_AP_TAR 0xe000edf0
> Polling target failed, GDB will be halted. Polling again in 100ms
>
> Program received signal 0, Signal 0.
> cyg_thread_delay (delay=0)
>
> at 
> /home/manuel/Arbeit/netX-ACCOS/netx_accos/trunk/src/ecos/ecos-cvs/packages/kernel/current/src/common/kapi.cxx:292
> Current language:  auto; currently c++
> -- snip --
>
> OpenOCD seems to lose the connection to the target as I get the
> following lines repeatedly on the shell:
>
> -- snip --
> Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed
> Error: MEM_AP_CSW 0x23000042, MEM_AP_TAR 0xe000edf0
> Polling target failed, GDB will be halted. Polling again in 6300ms
> -- snip --
>
> The CPU seems to continue running, as I get the output from the program
> correctly.
>
> The parameter delay = 0 seems to be bogus, because the function is
> called with delay=1000 (which is 10s delay with the default config) from
> the application thread.
>
> My openocd config is attached.
> I'm running the git version pulled an hour ago, but had no luck with
> stable 0.4.0 either before.
>
> I'm quite new to the STM32 / Cortex-M3 familiy, but already did a lot
> work on ARM9 before.
>
> I also tried lowering the JTAG speed to 100kHz which did not help. The
> thread delay is doing a 10 sec delay, but signal 0 is hit immediately
> after stepping.
>
> I tried with a cyg_thread_delay(1) et voila: stepping suddenly works! So
> what's goind on here? Has anyone worked with openocd on an STM32?
>
> I'm not sure if the problem lies in openocd or the STM32 eCos port...
>
> I came to the problem because I'm writing and debugging a SPI-Flash
> driver (based on the M25Pxx driver) for the on-board flash (SST25VFxxxB)
> which uses the cyg_thread_delay function when kernel support is
> available. But I reduced it to a simple serial example, which is
> delaying between outputting lines...
>
>
> Any help appreciated.
> Regards,
> Manuel
>

It may be that the scheduler or the idle thread puts the core in low
power mode if no thread is ready to run. That will break the debugger
connection. See if anything executes a WFI or WFE instruction, and
disable it. There's likely a configuration setting for it.

//Andreas
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to