This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

STM32, openocd and eCos


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


-- 
Manuel Borchers

Web: http://www.matronix.de
eMail: manuel@matronix.de

Attachment: stm32_mini.cfg
Description: Text document

Attachment: signature.asc
Description: This is a digitally signed message part


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]