April 25, 2024, 11:08:33 PM

Using SWD tranport with ARM-USB-TINY-H

Started by lipi, October 04, 2013, 07:21:25 AM

Previous topic - Next topic

lipi

I am trying to get SWD transport working in OpenOCD using openocd-0.7.0 and the following config commands:

transport list
transport select swd

However I get the following error:

Debug: 102 5 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_transport list
Debug: 103 5 command.c:145 script_debug(): command - ocd_transport ocd_transport list
User : 105 5 command.c:549 command_print(): The following transports are available:
User : 106 5 command.c:549 command_print():    swd
User : 107 5 command.c:549 command_print():    jtag
Debug: 108 5 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_transport select swd
Debug: 109 5 command.c:145 script_debug(): command - ocd_transport ocd_transport select swd
Error: 110 5 transport.c:290 jim_transport_select(): session's transport is already selected.
User : 111 5 command.c:669 command_run_line(): Runtime Error: embedded:startup.tcl:20:

Any idea what should I to to make SWD work?

LubOlimex

Hey lipi,

I wonder if you use this adapter: https://www.olimex.com/Products/ARM/JTAG/ARM-JTAG-SWD/.

By default the Olimex OpenOCD debuggers lack SWD interface.

We haven't tested if SWD works at all with OpenOCD. I can guarantee the adapter + any Olimex OpenOCD debugger combo works with Rowley Crossworks but we haven't had a report for successful use with OpenOCD so far (I believe this was mainly due to the poor software implementation of SWD interface in OpenOCD pre-0.7.0).

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

lipi

#2
Hi Lub,

I'm not using the SWD adapter. My understanding is that SWD is using a subset of the JTAG wires. Do I really need the adapter? I'm not looking for very high throughput, can't I just use a lower clock rate with the SWD interface on the ARM-USB-TINY-H and make it work?

Anyhow, I don't think I got that far yet, as OpenOCD doesn't seem to accept the SWD transport selection. I realize this is not an OpenOCD forum but I thought it's worth asking here as well.

Cheers,
Lipi

lipi

#3
I bought an ARM-JTAG-SWD converter and tried it with Rowley Crossworks, to no avail.

Actually, CrossStudio doesn't work with the Olimex dongle at all, even when leaving the target interface type as JTAG. It resets the device and reports 'Target not responding'. OpenOCD works with the dongle fine, but only in JTAG mode.

I don't have the TRST line connected, only the system reset and TMS, TCK, TDI and TDO.

What do I check next?

LubOlimex

Hey lipi,

Ensure you are using correct drivers - libUSB or FTDI matters. I usually use FTDI drivers with CrossWorks. They might be found here: https://www.olimex.com/Products/ARM/JTAG/_resources/driver-ftd2xx.zip.

We did couple of tests over here. We used LPC1227 and LPC1343 boards. Strange enough LPC1227 had some problems with loading code in the flash memory area while the demo ran flawlessly in the RAM. This lead us to believe it is some kind of software problem in the Crossworks configuration and timings. LPC1343 worked fine when using custom adapter configuration with settings set as shown in the pictures below (you can create one by adding a generic FT2232 device). Still when the code downloaded it happened very fast (less than a second) and when it didn't it responded that there is a problem after a couple of seconds.

I can suggest you:

1) Try changing the drivers. If you use LibUSB, try FTDI. If you use FTDI try LibUSB. Of course choose the correct ones from the drop down menu in the IDE. I believe the ready Olimex configurations in the Crossworks work only with FTDI drivers.
2) Try RAM debug. If it works fine then the problem isn't hardware but incorrect software setup. Contact Rowley about the problem they will be able to assist better about the setup.
3) Try adding a generic FT2232 device with the settings from the screenshot below
4) Ensure the SWD interface is placed between the debugger (straight to the debugger) and the cable (NOT between the cable and the target). This might cause great delays and errors.

Please check the images in this album (one of it features configuration settings): http://imgur.com/a/1qFV5#0

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex