Error Programming Atmel ATSAMD21G18 microcontroller using OSHChip_CMIS_DAP with OpenOCD

Canadarm
Posts: 5
Joined: Sat Mar 19, 2016 2:14 am

Error Programming Atmel ATSAMD21G18 microcontroller using OSHChip_CMIS_DAP with OpenOCD

Postby Canadarm » Sun Aug 21, 2016 12:27 pm

Hi:

I have built a Mechaduino board
-> http://tropical-labs.com/index.php/mechaduino

The Mechaduino is powered by an Atmel SAM D21G microcontroller.
-> http://www.atmel.com/devices/ATSAMD21G18.aspx

According to docs this processor can be programmed via the SWD interface and there is a SWD port that matches the OSHChip_CMSIS_DAP_V1.0 board.
The header pins and pinout look pin for pin identical.

The OSHChip_CMSIS_DAP_V1.0 documentation says no drag and drop programming for any chips other than the nRF51822

So I decided to try OpenOCD.
-> http://openocd.org
I've currently downloaded and installed openOCD version 0.9.0

openOCD supports both CMSIS_DAP programmers and Atmel SAMD21 microprocessors.

The openOCD command that will start up everything is

Code: Select all

openocd -d 1 -f interface/cmsis-dap.cfg -f target/at91samdXX.cfg


However when I run this command I am getting an error.

Code: Select all

=========================
Info : 193 28 cmsis_dap_usb.c:683 cmsis_dap_get_caps_info(): CMSIS-DAP: SWD  Supported
Info : 194 30 cmsis_dap_usb.c:784 cmsis_dap_swd_open(): CMSIS-DAP: Interface Initialised (SWD)
Info : 195 32 cmsis_dap_usb.c:663 cmsis_dap_get_version_info(): CMSIS-DAP: FW Version = 1.0
Debug: 196 34 cmsis_dap_usb.c:856 cmsis_dap_init(): CMSIS-DAP: Packet Size = 64
Debug: 197 36 cmsis_dap_usb.c:867 cmsis_dap_init(): CMSIS-DAP: Packet Count = 1
Info : 198 38 cmsis_dap_usb.c:704 cmsis_dap_get_status(): SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : 199 48 cmsis_dap_usb.c:910 cmsis_dap_init(): CMSIS-DAP: Interface ready
Debug: 200 48 core.c:1596 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 201 48 core.c:1599 adapter_khz_to_speed(): have interface set up
Debug: 202 50 core.c:1596 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 203 50 core.c:1599 adapter_khz_to_speed(): have interface set up
Info : 204 50 core.c:1384 adapter_init(): clock speed 500 kHz
Debug: 205 50 openocd.c:137 handle_init_command(): Debug Adapter init complete
Debug: 206 50 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_transport init
Debug: 207 50 command.c:145 script_debug(): command - ocd_transport ocd_transport init
Debug: 209 50 transport.c:240 handle_transport_init(): handle_transport_init
Debug: 210 52 cmsis_dap_usb.c:731 cmsis_dap_swd_switch_seq(): JTAG-to-SWD
Debug: 211 55 cmsis_dap_usb.c:522 cmsis_dap_swd_run_queue(): Executing 2 queued transactions
Debug: 212 55 cmsis_dap_usb.c:545 cmsis_dap_swd_run_queue(): DP read reg 0 0
Debug: 213 55 cmsis_dap_usb.c:545 cmsis_dap_swd_run_queue(): DP write reg 0 1e
Debug: 214 57 cmsis_dap_usb.c:583 cmsis_dap_swd_run_queue(): SWD ack not OK: 0 JUNK
Debug: 215 57 command.c:628 run_command(): Command failed with error code -4
User : 216 57 command.c:689 command_run_line(): in procedure 'init'
in procedure 'ocd_bouncer'
Debug: 217 57 command.c:628 run_command(): Command failed with error code -4
=========================


My questions are:

1) Was the CMSIS-DAP firmware changed in any way for the OSHChip_CMSIS_DAP_V1.0 programmer that would cause this?
2) Is the OSHChip_CMSIS_DAP_V1.0 capable of programming other chips besides the OSHCHip?

Any other debugging suggestions would be welcomed!

Thanks

Mark

Return to “Firmware”

Who is online

Users browsing this forum: No registered users and 1 guest