Skip to content

Conversation

@soburi
Copy link
Member

@soburi soburi commented Apr 26, 2022

Add openocd configuration.

This configuration allows selecting what debug adapter debugging rpi_pico
by a command-line argument.
It is mainly intended to support both the 'picoprobe' and 'raspberrypi-swd'
adapter described in "Getting started with Raspberry Pi Pico".
And any other SWD debug adapter might also be usable with this configuration.

@soburi soburi requested a review from nashif as a code owner April 26, 2022 10:51
@soburi soburi force-pushed the add_openocd_config_for_rpi_pico branch from c06241f to cee6eb3 Compare April 26, 2022 10:57
@yonsch yonsch added the platform: Raspberry Pi Pico Raspberry Pi Pico (RPi Pico) label May 1, 2022
@github-actions
Copy link

github-actions bot commented Jul 1, 2022

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Jul 1, 2022
@pdgendt pdgendt removed their request for review July 4, 2022 14:22
Copy link
Contributor

@yonsch yonsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good overall, I have just one question:
Does this work with the openocd found in zephyr-sdk, or does it use a custom version of openocd? I couldn't find target/rp2040.cfg (though I did find rp2040-core0.cfg), and neither interface/picoprobe/interface/raspberrypi-swd.

@yonsch yonsch removed the Stale label Jul 5, 2022
@soburi
Copy link
Member Author

soburi commented Jul 5, 2022

Hi! @yonsch
Thanks for reviewing.

Looking good overall, I have just one question: Does this work with the openocd found in zephyr-sdk, or does it use a custom version of openocd? I couldn't find target/rp2040.cfg (though I did find rp2040-core0.cfg), and neither interface/picoprobe/interface/raspberrypi-swd.

It requires a custom version openocd.

I missed writing information about the distribution source of the custom version.
(https://github.com/raspberrypi/openocd)
I will add some information about that version.

There is an easy way to use this version of openocd is running the setup.sh script for setting up the pico development environment. I wrote it in the document.

@carlescufi carlescufi requested a review from yonsch July 6, 2022 08:54
@burumaj
Copy link
Contributor

burumaj commented Jul 6, 2022

I tested this yesterday evening with the picoprobe. There are couple remarks I have regarding the documentation of this:

  1. when using the picoprobe adding a udev rule might be necessary so a regular user can use it with openocd (or at least a user that is in de plugdev group in this case).
# Raspberry Pi Picoprobe
ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="0004", MODE="660", GROUP="plugdev", TAG+="uaccess"
  1. When using an openocd not included with the zephyr sdk there is not rtos support for zephyr. The consequence of this is that it's possible to use openocd to debug an application, but only without thread awareness.

  2. You mention the use of picosetup.sh, this script and is only supported on piOS, and probably works fine on debian based systems like ubuntu.

@soburi
Copy link
Member Author

soburi commented Jul 8, 2022

Hi, @burumaj

I tested this yesterday evening with the picoprobe. There are couple remarks I have regarding the documentation of this:

Thanks for testing it and comments.
I updated the document with apply your mentions.

@soburi soburi force-pushed the add_openocd_config_for_rpi_pico branch from cee6eb3 to 0f64d04 Compare July 8, 2022 00:24
Copy link
Contributor

@yonsch yonsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, a few comments about the documentation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that you've added a link, this line can be removed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this line.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too many blank lines

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix it

Add openocd configuration.

This configuration allows selecting what debug adapter debugging rpi_pico
by a command-line argument.
It is mainly intended to support both the 'picoprobe' and 'raspberrypi-swd'
adapter described in "Getting started with Raspberry Pi Pico".
And any other SWD debug adapter might also be usable with
this configuration.

Signed-off-by: TOKITA Hiroshi <[email protected]>
@soburi soburi force-pushed the add_openocd_config_for_rpi_pico branch from 0f64d04 to 3303358 Compare July 8, 2022 15:10
@soburi soburi requested a review from yonsch July 8, 2022 15:14
@MeisterBob
Copy link

I would suggest adding jlink support to board.cmake as well

board_runner_args(jlink "--device=RP2040_M0_0")
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

@soburi
Copy link
Member Author

soburi commented Jul 15, 2022

Hi, @MeisterBob

Thanks for comment.

I would suggest adding jlink support to board.cmake as well

board_runner_args(jlink "--device=RP2040_M0_0")
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

It seems good.
And this code is your contribution.
So, I think it is better to create your PR.
(In another view, it keeps simple PR.)
Or Reporting as issue is also good way.

Please consider it.

@soburi
Copy link
Member Author

soburi commented Jul 22, 2022

@MeisterBob ,
I split the topic about J-Link support to new issue.
#48194

(Simply reason, I can't verify the code within this PR becasuse I don't have J-Link debugger...)

@carlescufi carlescufi merged commit 9c682e6 into zephyrproject-rtos:main Aug 18, 2022
@soburi soburi deleted the add_openocd_config_for_rpi_pico branch August 18, 2022 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants