Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMSIS-DAP adapter support and more current openocd source code? #2

Closed
majbthrd opened this issue Jul 1, 2021 · 8 comments
Closed
Assignees

Comments

@majbthrd
Copy link

majbthrd commented Jul 1, 2021

Would you please consider adding CMSIS-DAP adapter support (add --enable-cmsis-dap in addition to --enable-picoprobe to configure) to the next build of OpenOCD?

Also, there are more current source code and configuration files available with added capabilities available upstream from the openocd fork currently used for the build.

In particular, board/pico-debug.cfg and target/rp2040-core0.cfg are the two script configuration files that would be desirable to have. These and CMSIS-DAP support would allow arduino-pico to do sketch uploads in the same manner that it presently does with picoprobe, but without picoprobe’s dependency on two RP2040 boards.

@earlephilhower earlephilhower self-assigned this Jul 1, 2021
@earlephilhower
Copy link
Owner

Sure thing. So, what's in raspberrypi/openocd@71510a7 should be good?

@majbthrd
Copy link
Author

majbthrd commented Jul 1, 2021

Much appreciated! Yes, that commit should be good. It shows as the build failing, but I believe that is a build system issue that was only corrected on a different branch. If I am reading the tea leaves correctly, RPi is punting on changing this until they've merged RPi's fork with the upstream genuine OpenOCD (which has evolved considerably in the interim).

Also, I should have originally noted that one gotcha to adding CMSIS-DAP could be the added libraries. Depending on the Linux target, HIDAPI may or may not be required. macOS requirements seem to vary (and I noticed that you are building macOS openocd separately and including it in blobs).

@earlephilhower
Copy link
Owner

Good to know. I have to manually build the Win and Mac OpenOCDs because getting the cross-compiler to have the necessary libusb/etc. cross-dependencies is something I was just not able to get to work. The rest of the toolchain, no problem. One make on my server and 30 mins later I have 6 different archs built and ready.

@majbthrd
Copy link
Author

majbthrd commented Jul 2, 2021

I keep remembering more things that I should have included initially... here are two other pieces of information that might be of help:

I have some Linux build instructions here (note the libhidapi-dev dependency):

https://github.com/majbthrd/pico-debug/blob/master/howto/openocd.md

and Mac users have posted their own tips here:

majbthrd/pico-debug#5

@earlephilhower
Copy link
Owner

Argh, it's not as clean as that. The rp2040 branch where you have your updates does not contain the picoprobe debugger interface.

I'll try merging the picoprobe and rp2040 branches and see what comes out.

I don't understand why the RPI org wouldn't do the same and then push everything upstream. It looks like the picoprobe stuff is a pretty standalone addition.

@majbthrd
Copy link
Author

majbthrd commented Jul 2, 2021

Argh. Heaven only knows why RPi thought it necessary to introduce picoprobe in the first place. There are established open-source adapters standards like CMSIS-DAP, but no, RPi had to create something proprietary.

@earlephilhower
Copy link
Owner

It's surprisingly hard to include add'l dependencies for cross-compiling. HIDAPI ended up needing UDEV which can't be cross-installed so you have to jump through hoops to get it into the x-compile link stages.

I'll have a new toolset up later today. Could you give it a quick check when available?

@majbthrd
Copy link
Author

majbthrd commented Jul 5, 2021

Terrific! I've done the build locally and grafted in the newer openocd files into pico-arduino for testing. All signs point to CMSIS-DAP working as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants