-
Notifications
You must be signed in to change notification settings - Fork 8.1k
boards: waveshare: Add RP2350 Zero board support #97628
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
base: main
Are you sure you want to change the base?
Conversation
Hello @cetola, and thank you very much for your first pull request to the Zephyr project! |
0d202ba
to
b39093a
Compare
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.
Thank you for your contribution! Please find some suggestions attached
board_runner_args(openocd --cmd-pre-init "source [find interface/${RPI_PICO_DEBUG_ADAPTER}.cfg]") | ||
board_runner_args(openocd --cmd-pre-init "source [find target/rp2350.cfg]") | ||
|
||
# The adapter speed is expected to be set by interface configuration. |
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.
It's safe to assume probe-rs also works for this target, please consider adding it by copying from other files, like here: https://github.com/zephyrproject-rtos/zephyr/pull/94542/files
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.
Sounds good, added this. I'll see if I can get a probe-rs debug probe and test this out as well.
|
||
west flash | ||
|
||
In alternative you can locate the generated file at ``build/zephyr/zephyr.uf2 file`` and simply drag-and-drop to the device after entreing the UF2 flashing mode. |
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.
In alternative you can locate the generated file at ``build/zephyr/zephyr.uf2 file`` and simply drag-and-drop to the device after entreing the UF2 flashing mode. | |
Alternatively, you can locate the generated file at ``build/zephyr/zephyr.uf2 file`` and simply drag-and-drop to the device after entering the UF2 flashing mode. |
:goals: build | ||
:compact: | ||
|
||
You must flash the RP2350-Zero with an UF2 file. One option is to use West (Zephyr’s meta-tool). To enter the UF2 flashing mode just keep the ``BOOT`` button pressed while you connect the USB port, it will appear on the host as a mass storage device. In alternative with the board already connected via USB you can keep the ``RESET`` button pressed, press and release ``BOOT``, release ``RESET``. At this point you can flash the image file by running: |
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.
uf2 isn't the must
option, I'm pretty sure picotool can load elf as well. Also, it seems the button press order should be different:
You must flash the RP2350-Zero with an UF2 file. One option is to use West (Zephyr’s meta-tool). To enter the UF2 flashing mode just keep the ``BOOT`` button pressed while you connect the USB port, it will appear on the host as a mass storage device. In alternative with the board already connected via USB you can keep the ``RESET`` button pressed, press and release ``BOOT``, release ``RESET``. At this point you can flash the image file by running: | |
You can flash the RP2350-Zero with an UF2 file. One option is to use West (Zephyr’s meta-tool). To enter the UF2 flashing mode just keep the ``BOOT`` button pressed while you connect the USB port, it will appear on the host as a mass storage device. In alternative with the board already connected via USB you can keep the ``BOOT`` button pressed, press and release ``RUN``, release ``BOOT``. At this point you can flash the image file by running: |
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.
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.
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.
but fwiw I would rather you link to the product webpage rather than unnecessarily cluttering the Zehpyr git repo with this file
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.
Updated the PR with a link to the product webpage.
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.
Sorry, pushed the wrong rst file. Should be updated now.
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if("${RPI_PICO_DEBUG_ADAPTER}" STREQUAL "") | ||
set(RPI_PICO_DEBUG_ADAPTER "cmsis-dap") |
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.
cmake indent is 2 spaces
group1 { | ||
pinmux = <UART0_TX_P0>; | ||
}; | ||
group2 { |
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.
newline gaps missing e.g. line 11, fix in whole PR
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 put some of this in context, take a look at 2d22884 which might help.
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.
Thanks. Funny enough, I fixed the issue and then immediately started looking for a linter. 😆
<28 0 &gpio0 28 0>, /* GP28 */ | ||
<29 0 &gpio0 29 0>; /* GP29 */ | ||
}; | ||
|
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.
CONFIG_LED=y | ||
CONFIG_LED_STRIP=y | ||
CONFIG_WS2812_STRIP_RPI_PICO_PIO=y |
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.
CONFIG_LED=y | |
CONFIG_LED_STRIP=y | |
CONFIG_WS2812_STRIP_RPI_PICO_PIO=y |
CONFIG_LED=y | ||
CONFIG_LED_STRIP=y | ||
CONFIG_WS2812_STRIP_RPI_PICO_PIO=y |
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.
CONFIG_LED=y | |
CONFIG_LED_STRIP=y | |
CONFIG_WS2812_STRIP_RPI_PICO_PIO=y |
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.
PR updated to remove the LED. Is best practice here to keep the defconfig as minimal as possible?
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.
PR updated to remove the LED. Is best practice here to keep the defconfig as minimal as possible?
https://docs.zephyrproject.org/latest/hardware/porting/board_porting.html#general-recommendations is the best their is, AFAIK.
Extending https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/drivers/led/led_strip/boards might be the way to go.
CONFIG_WS2812_STRIP_RPI_PICO_PIO
shouldn't be required, for example, because that'll just sort itself out when the node is enabled in the device tree, (and LED_STRIP
is enabled) for example. It does raise an interesting (but beyond the scope of this PR) question: should samples/basic/rgb_led also include RGB LEDs that are driven via a LED 'strip'? To a lot of people (including me) that difference is nuanced.
76f7ae1
to
314aa51
Compare
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.
The I2C configuration is the thing that needs the closest attention, IMHO.
if I2C_DW | ||
|
||
config I2C_DW_CLOCK_SPEED | ||
default 125 | ||
|
||
endif # I2C_DW |
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.
if I2C_DW | |
config I2C_DW_CLOCK_SPEED | |
default 125 | |
endif # I2C_DW |
This doesn't look right, clk_sys
runs at 150MHz by default, and clk_peri
is derived from that. Is this a copy-paste error from RP2040 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.
I looked through my notes and I cannot find a reason I would have set this, so it is likely a copy/paste error from the RP2040. I used both the RP2040 and the Pico 2 as references.
&wdt0 { | ||
status = "okay"; | ||
}; | ||
|
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.
&wdt0 { | |
status = "okay"; | |
}; |
Duplicated on line 146, remove.
3e4e896
to
b1d9842
Compare
Add initial support for the Waveshare RP2350-Zero, a low-cost, high-performance Pico-like development board based on the Raspberry Pi RP2350A microcontroller. This commit introduces the board definition, devicetree files, pin control configuration, Kconfig options, and board documentation. The RP2350-Zero’s Arm and RISC-V cores are supported with this port. Basic peripherals (GPIO, UART, I2C) are configured and tested. Verified by building and running the Zephyr "hello_world" sample on the RP2350-Zero / RP2350-One boards, and manually testing the GPIO, I2C, PIO, and RGB LED. Signed-off-by: Stephano Cetola <[email protected]>
|
Add initial support for the Waveshare RP2350-Zero, a low-cost, high-performance Pico-like development board based on the Raspberry Pi RP2350A microcontroller.
This commit introduces the board definition, devicetree files, pin control configuration, Kconfig options, and board documentation.
The RP2350-Zero’s Arm and RISC-V cores are supported with this port. Basic peripherals (GPIO, UART, I2C) are configured and tested. Verified by building and running the Zephyr "hello_world" sample on the RP2350-Zero / RP2350-One boards, and manually testing the GPIO, I2C, PIO, and RGB LED.