- Notifications
You must be signed in to change notification settings - Fork 278
Add support for Adafruit QTPy RP2040 (and other boards) #18
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
Conversation
| Updated with better device selection: the user sets the value of |
| I think using the default board defines instead of a new define is a better route. On most of the existing boards define Here is an example I tested. However |
| yes, better to use the default pin defines so it works on everything There is also a placeholder issue raspberrypi/pico-sdk#188 to create a simple abstraction for signaling status/something on either LED or WS2812 |
| As per above, I've updated config to use I've also brought the RGB LED colour setting into Added a Read Me too, as that's what I do for a living. PS. I've crudely 'fixed' the undefined |
| endif() | ||
| | ||
| if (NOT PICO_BOARD STREQUAL "pico") | ||
| target_sources(${EXECUTABLE_NAME} PRIVATE src/ws2812.c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be assuming that any board which isn't a Raspberry Pi Pico will always have a WS2812 LED, which I guess won't always be the case? Probably better to do something like set(HAS_WS2812 1) in the bit above where you're checking individual board-names?
| @@ -0,0 +1,25 @@ | |||
| # Picoprobe | |||
| | |||
| A Picoprobe is a Raspberry Pi RP2040-based Single-Wire Debug (SWB) adaptor. You can make one from a Raspberry Pi Pico — hence the name — or almost any third-party RP2040-based board. Use it to connect your RP2040-based application board to your personal computer for debugging through `gdb`, directly or via an IDE such as Microsoft Visual Studio Code. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single-Wire Debug -> Serial Wire Debug
SWB -> SWD
| | ||
| A Picoprobe is a Raspberry Pi RP2040-based Single-Wire Debug (SWB) adaptor. You can make one from a Raspberry Pi Pico — hence the name — or almost any third-party RP2040-based board. Use it to connect your RP2040-based application board to your personal computer for debugging through `gdb`, directly or via an IDE such as Microsoft Visual Studio Code. | ||
| | ||
| The original version of this code only supported the Pico. This update adds support for three more boards, each of which provides a [STEMMA QT connector](https://learn.adafruit.com/introducing-adafruit-stemma-qt/what-is-stemma-qt)/[Quicc](https://www.sparkfun.com/qwiic) for easy cabling to the application board under test. These connectors are intended for use with I²C devices, but here we’re using their pins for GPIO and power. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it makes sense for README.md to talk about "This update..." ? (this is the README, not a CHANGELOG)
Quicc -> Qwiic ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what is worth mentioning is the that if you are using the STEMMA/Qwiic board is that UART lines will not be passed through. Using the base board has that advantage as you don't need to plug in both your pico probe and the target board to USB.
| | ||
| The original version of this code only supported the Pico. This update adds support for three more boards, each of which provides a [STEMMA QT connector](https://learn.adafruit.com/introducing-adafruit-stemma-qt/what-is-stemma-qt)/[Quicc](https://www.sparkfun.com/qwiic) for easy cabling to the application board under test. These connectors are intended for use with I²C devices, but here we’re using their pins for GPIO and power. | ||
| | ||
| The code also uses the WS2812 RGB LED on those boards that have one as an SWD activity indicator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps "on those boards that have one" should be in parentheses?
| | ||
| The code also uses the WS2812 RGB LED on those boards that have one as an SWD activity indicator. | ||
| | ||
| If your chosen board is not one of those so far supported by the Picoprobe code, you should be able to use with just a few small code changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use with -> use it with ?
| | ||
| ## Build the Picoprobe code | ||
| | ||
| To build for your own Picoprobe: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"To build Picoprobe for your own board:" ?
| message("Building for Adafruit Feather RP2040 with WS2812") | ||
| elseif (PICO_BOARD STREQUAL "sparkfun_promicro") | ||
| message("Building for SparkFun Pro Micro RP2040 with WS2812") | ||
| else() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this else() be elseif (PICO_BOARD STREQUAL "pico") ?
| #ifndef PICO_DEFAULT_LED_PIN | ||
| #error PICO_DEFAULT_LED_PIN is not defined, run PICOPROBE_LED=<led_pin> cmake | ||
| // #error PICO_DEFAULT_LED_PIN is not defined, run PICOPROBE_LED=<led_pin> cmake | ||
| #define PICOPROBE_LED 0 // To avoid compiler errors -- is there a better way to do this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you want something like #if !defined(PICO_DEFAULT_LED_PIN) && !defined(PICO_DEFAULT_WS2812_PIN) ?
| # "adafruit_feather_rp2040" for the Adafruit Feather RP2040 | ||
| # "sparkfun_promicro" for the SparkFun Pro Micro RP2040 | ||
| | ||
| set(PICO_BOARD "pico") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be defined in this file? A PICO_BOARD environment variable works too. Not having to modify any files make building even easier.
Linux/MacOS
export PICO_BOARD=SPARKFUN_PROMICRO cmake .WIndows
SET PICO_BOARD=SPARKFUN_PROMICRO cmake .PowerShell Core (All OS'es)
$env:PICO_BOARD=SPARKFUN_PROMICRO cmake .| | ||
| To build for your own Picoprobe: | ||
| | ||
| 1. Edit the `CmakeLists.txt` file and change the value of `PICO_BOARD` in line 16. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line number change over time. Better to reference this by name and not by line number. Less work later.
| Why was this closed @smittytone ? |
| I've closed it because I don't think it's getting anywhere. I opened the request to see if there was any interest on the part of the Foundation in extending this. That question hasn't been answered. I've had some useful suggestions for improvements, which I have applied, and a fair few opinions, but nothing in the way of direction, and I think that's what is required at this stage. Someone with the authority to do so needs to set a framework for how other devices get added, and oversee their addition as punters submit them. I proposed one approach, and anyone can view my fork to see how it works. I'm open to others, and I'm also happy to reopen this PR if the Foundation thinks that's the way to go. |
| ping @kilograham and @liamfraser |
I'm not offering this for merging per se, more to see if you're interested in pull in updates like this: to support other RP2040-based devices.
Happy to make changes too.
Cheers,
Tony