zephyrproject-rtos / meta-zephyr-sdk

Zephyr SDK (obsolete)
MIT License
44 stars 29 forks source link

Unable to flash via openocd CMSIS-DAP interface #80

Closed zephyrbot closed 7 years ago

zephyrbot commented 7 years ago

Reported by Piotr Mienkowski:

I have been testing Zephyr SDK 0.9.2-rc2. My system is Kubuntu 17.04 64-bit.

When flashing SAM E70 Xplained board - the on board debugger chip is using CMSIS-DAP interface which is supported by openocd 0.10.0 - I see an error:

{{Error: unable to find CMSIS-DAP device}}

I have also a locally built version of openocd 0.10.0 I had been using before, this one is able to flash SAM E70 Xplained board correctly.

As I determined the Zephyr's build of openocd 0.10.0 does include support for CMSIS-DAP. However, there is a difference. My locally built openocd is linked against libhidapi-hidraw whereas Zephyr's version against libhidapi-libusb.

My Zephyr's openocd binary doesn't have any unresolved dynamic library dependencies and both backends are installed on my machine:

The official openocd build guideline does not specify which of the two hidapi backends is the preferred one, however hidapi-libusb seems to have caused problems [before|https://github.com/gnu-mcu-eclipse/openocd/issues/12]. The relevant discussion on openocd mailing list can be found [here|https://sourceforge.net/p/openocd/mailman/openocd-devel/thread/CA%2B7xNQk5n8HVYNdAYS6zvfav1zBJ3kGKgOoB6-PsH1mmskNGTA%40mail.gmail.com/#msg35794046]. In fact both backends shall be supported. Maybe the machine on which openocd was built used an outdated version of libhidapi?

Ubuntu's openocd 0.9.0 is linked against libhidapi-hidraw.

(Imported from Jira SDK-65)

zephyrbot commented 7 years ago

by Maureen Helm:

I can reproduce on frdm_k64f too.

zephyrbot commented 7 years ago

by Anas Nashif:

building hidraw was disabled because it pulls udev, which makes building the SDK a bit tricky...

zephyrbot commented 7 years ago

by Anas Nashif:

try rc4: https://github.com/zephyrproject-rtos/meta-zephyr-sdk/releases/tag/0.9.2-rc4

zephyrbot commented 7 years ago

by Piotr Mienkowski:

rc4 works well for me. I am able to flash Atmel SAM E70 Xplained board on my Kubuntu 17.04 machine.

zephyrbot commented 7 years ago

by Maureen Helm:

Verified that rc4 also fixes frdm_k64f