SparkFun Forums 

Where electronics enthusiasts find answers.

Open source ARM Debugger
By ricardo.abreu
#181734
Hi,

I am using for some time a SoC from ZMDI (http://www.zmdi.com), the ZWIR4512 (http://www.zmdi.com/zwir4512).

In a nutshell, this is a package with a STM32F103 ARM microcontroller and a IEEE 802.15.4 radio transceiver. Libraries are provided (essentially for network meshing).

Strange thing is I am using OpenOCD for some time (I started using Eclipse Luna last January with GCC tools and OpenOCD) and now it started to misbehave.

I will post below the symptoms and what I did to solve this issue. I hope somebody could guide me in the right direction.
By ricardo.abreu
#181738
The development board's JTAG interface is built around FTDI's FT2232 (as many other simple interfaces).

The whole ZWIR4512 development board is reasonably small (around 10cm x 8cm), and the distance between FT2232 and STM32F103 is electrically small. In the next picture, FT2232 is the chip in the bottom left corner, while STM32F103 is embedded in the SoC at the right side.
IMG_20150504_122034752.jpg
This is the connection between FT2232 and STM32F103. Both chips (FTDI and STM32F103) have their pins directly connected (apart a few jumpers that are in place, accounting for the four JTAG pins (TMS, TCK, TDI, TDO) and the uC /RESET. A few pull-up or pull-down resistors (which I don't fully realize their role appart the obvious pull-up in the /RESET line).

As far as I understand, the /RESET pin is called "nSRST" (negated System Reset) in "JTAG terminology", and I have no "nTRST" (negated Test Reset) available.
JTAG_ZWIR4512.png
The supplied configuration file for OpenOCD 0.7.0 states the following interface configurations:

interface ft2232
ft2232_vid_pid 0x0403 0x6010
ft2232_device_desc "Dual RS232"
ft2232_layout "oocdlink"
ft2232_latency 2


Hence, I suppose the interface wiring follows OOCD-link dongle, although I couldn't confirm that (the reliable source, http://www.joernonline.de, is down).

Does someone can assert if this wiring is compatible with OOCDlink (and, hence, that OpenOCD configuration files will work with the ZWIR4512's development board)?
You do not have the required permissions to view the files attached to this post.
By ricardo.abreu
#181742
Regarding the symptoms:

I used the current tools (Eclipse Luna + ARM GCC toolchain + OpenODB 0.7.0, my PC runs Windows 8.1) until a few days ago, when suddenly I was unable to flash the microcontroller.

I did the usual stuff - rollback updates, re-installing tolls, and so on, to no avail. I know I am generating correct code and I am able to load it through ST Microelectronics flash loader demonstrator (http://www.st.com/st-web-ui/active/en/c ... s/PF257525)

Then I started digging and I found that OpenOCD has trouble communicating with the target microcontroller.



- 1) Started OpenOCD manually –> OK;
- 2) Launched telnet on localhost:4444 to control OpenOCD –> OK;
- 3) Tried "soft_reset_halt" -> OK
(Output:
requesting target halt and executing a soft reset
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc)
- 4) Tried "reset halt";
- 4) At this point, OpenOCD fails connection with ZWIR4512 devkit, polling the device with increasing timeout, never achieving reconnection (see LOG #1 below).
- 5) Quitting OpenOCD and launching it again, connection is regained and one can see the device is, in fact, halted.


So is seems there is something quite wrong in the link OpenOCD<->STM32F1. I can issue some commands, but others fail miserably.

Any ideas of what is going on here? Any patch/workaround?

I would appreciate any hints that can put me in the right track.

Ricardo




===== LOG #1 =======

Open On-Chip Debugger 0.7.0 (2015-01-12-17:02)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
cortex_m3 reset_config sysresetreq
force hard breakpoints
Info : device: 4 "2232C"
Info : deviceID: 67330064
Info : SerialNumber: A
Info : Description: Dual RS232 A
Info : clock speed 500 kHz
Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32f1x.bs tap/device found: 0x06414041 (mfg: 0x020, part: 0x6414, ver: 0x0)
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
requesting target halt and executing a soft reset
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
Info : accepting 'telnet' connection from 4444
Info : JTAG tap: stm32f1x.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32f1x.bs tap/device found: 0x06414041 (mfg: 0x020, part: 0x6414, ver: 0x0)
Warn : Invalid ACK 0 in JTAG-DP transaction


in procedure 'reset'
Error: stm32f1x.cpu -- clearing lockup after double fault
Polling target stm32f1x.cpu failed, GDB will be halted. Polling again in 100ms
Error: stm32f1x.cpu -- clearing lockup after double fault
Polling target stm32f1x.cpu failed, GDB will be halted. Polling again in 300ms
Error: stm32f1x.cpu -- clearing lockup after double fault
Polling target stm32f1x.cpu failed, GDB will be halted. Polling again in 700ms
Error: stm32f1x.cpu -- clearing lockup after double fault
Polling target stm32f1x.cpu failed, GDB will be halted. Polling again in 1500ms
Error: stm32f1x.cpu -- clearing lockup after double fault
Polling target stm32f1x.cpu failed, GDB will be halted. Polling again in 3100ms
Error: stm32f1x.cpu -- clearing lockup after double fault
Polling target stm32f1x.cpu failed, GDB will be halted. Polling again in 6300ms
Error: stm32f1x.cpu -- clearing lockup after double fault
Polling target stm32f1x.cpu failed, GDB will be halted. Polling again in 6300ms
By ricardo.abreu
#181765
Some developments:


I tried a newer version of OpenOCD, 0.8.0.

It uses a new interface for ftdi chips. Interface "FT2232" is deemed deprecated, new interface "ftdi" is recommended. Since I could not find a *.cfg file for my ZWIR4512, I delved into the manuals and I came up with the following interface configuration lines for OpenOCD.

I posted it here because it can be helpful to somebody else.

I suppose it is ok, since I can connect to the device (although I would appreciate any inputs regarding its correctness).
Code: Select all
# Data Bit    Signal   FT2232 Pin   ZWIR4512   PullUp/Down    I/O     Init value
#
#     0       TCK/SK     ADBUS0      TCK                       O (1)       0
#     1       TDI/DO     ADBUS1      TDI                       O (1)       0
#     2       TDO/DI     ADBUS2      TDO        pull-down      I (0)       0
#     3       TMS/CS     ADBUS3      TMS                       O (1)       1
#     4       GPIOL0     ADBUS4       ?         pull-down    I(?)(0)       0
#     5       GPIOL1     ADBUS5      ---                       X (0)       0
#     6       GPIOL2     ADBUS6       ?         pull-down    I(?)(0)       0
#     7       GPIOL3     ADBUS7    /RESET       pull-up        O (1)     1 (nSRST?) system reset
#     8       GPIOH0     ACBUS0       ?         pull-up      O(?)(1)     1 (nTRST?) test reset
#     9       GPIOH1     ACBUS1      ---                       X (0)       0
#    10       GPIOH2     ACBUS2      ---                       X (0)       0
#    11       GPIOH3     ACBUS3      ---                       X (0)       0   

#                              data              direction
# ftdi_layout_init            0x0188               0x018b
#                        0001 1000 1000        0001 1000 1011


interface ftdi
ftdi_vid_pid 0x0403 0x6010

#                              data              direction
# ftdi_layout_init            0x0188               0x018b
#                        0001 1000 1000        0001 1000 1011
ftdi_layout_init 0x0188 0x018b
ftdi_layout_signal nTRST -noe 0x0080
ftdi_layout_signal nSRST -noe 0x0100


Anyway, the problem persists: I can issue some commands to OpenOCD, mas many of them fail and I am puzzled why this happens. I would be very glad for any hint on what is going on.
By clarkleach
#186416
I am trying to develop an application with this same development board and I'm having troubles getting the debug tools to work. I'm using Debian 8, Eclipse Mars, and openOCD 0.10.0. I wonder if anyone has a configuration known to work as I am running out of ideas.
By alampret
#186699
Hello,

have you found a working solution?
I've set up successfully a development environment on Linux and OSX with Eclipse Mars and GNU ARM for Eclipse. The only thing I do not get to work is the OpenOCD part and programming/flashing of this module. Do you have any idea?
I tried it with openocd 0.7.0 and provided config and with openocd 0.9.0 with your given config but without success.

I'm running out of ideas too.

Thanks in advance!

Best regards,
Alex
By DanielMM
#187458
Hi,

I am also experiencing problems with openOCD-0.9.0 and STM32F1xx.

Prior to this, I was working with openOCD-0.6.1 (interface ft2232 instead of fdti) and I had no problems at all. If I switch back to openOCD-0.6.1 no problem arises, so I guess there is an issue with the newer versions. Maybe using the older v0.6.1 help you with your problems.

In my case, I get the following error with v0.9.0:

Open On-Chip Debugger 0.9.0-rc1 (2015-04-24-22:09)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
none separate
cortex_m reset_config sysresetreq
Error: failed to reset FTDI device: LIBUSB_ERROR_IO
Error: unable to open ftdi device with vid 15ba, pid 002b, description 'Olimex OpenOCD JTAG ARM-USB-OCD-H' and serial '*'


Any suggestion (other than sticking to openOCD-0.6.1)?
By clarkleach
#187575
I "cured" the problem by getting rid of the bloated behemoth known as "Eclipse" and installing Rowley Crossworks. It just works and doesn't consume insane amounts of RAM (on both Windoze and Linux).