-
Notifications
You must be signed in to change notification settings - Fork 8.2k
boards: waveshare: rp2040_plus: Initial support #89527
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
boards: waveshare: rp2040_plus: Initial support #89527
Conversation
3b43046 to
82eb1b0
Compare
a22fa86 to
19fff2e
Compare
19fff2e to
9aad349
Compare
|
|
||
| west flash | ||
|
|
||
| In alternative you can locate the generated :file:`build/zephyr/zephyr.uf2` file and simply drag-and-drop to the device after entering 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:`build/zephyr/zephyr.uf2` file and simply drag-and-drop to the device after entering the UF2 flashing mode. | |
| Alternatively, you can locate the generated :file:`build/zephyr/zephyr.uf2` file and simply drag-and-drop to the device after entering the UF2 flashing mode. |
| }; | ||
|
|
||
| &flash0 { | ||
| reg = <0x10000000 DT_SIZE_M(4)>; |
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 seem to be two variants: a 4MB and a 16MB. It would be good to reflect this in the codebase.
Not a blocker.
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.
What solution do you propose to support both variants?
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 within Zephyr's parlance they'd be different board variants. Not a blocker, and defaulting to the smaller 4MB is the safer thing to do.
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.
followup PR: #92384
| if I2C_DW | ||
|
|
||
| config I2C_DW_CLOCK_SPEED | ||
| default 125 |
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.
What's the reason for this clock speed?
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 do not have a answer for your question. I was using the RPI Pico board as a blueprint which contains the same define:
zephyr/boards/raspberrypi/rpi_pico/Kconfig.defconfig
Lines 8 to 9 in 55769dc
| config I2C_DW_CLOCK_SPEED | |
| default 125 |
All of the other RP2040 based boards I checked have the same definition.
| channel@3 { | ||
| reg = <3>; | ||
| zephyr,gain = "ADC_GAIN_1"; | ||
| zephyr,reference = "ADC_REF_INTERNAL"; | ||
| zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>; | ||
| zephyr,resolution = <12>; | ||
| }; | ||
|
|
||
| channel@4 { | ||
| reg = <4>; | ||
| zephyr,gain = "ADC_GAIN_1"; | ||
| zephyr,reference = "ADC_REF_INTERNAL"; | ||
| zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>; | ||
| zephyr,resolution = <12>; |
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.
What's going on with these ADC channels? I've looked at the circuit diagram at https://files.waveshare.com/wiki/RP2040-Plus/RP2040_Plus.pdf but I can't see the ADCs being used.
Can you offer a bit more information?
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.
ADC channel 3 (GPIO29) is connected to VSYS via voltage divider R2/R8.
To keep it compatible with samples/boards/nordic/battery I choose "vbatt" as node name although technically not 100% correct as it will be ~0.4V lower than the actual battery voltage.
https://github.com/dsch/zephyr/blob/9aad3493350f8d0d86f5a1442fe5bbff8b4d8667/boards/waveshare/rp2040_plus/rp2040_plus.dts#L80-L85
ADC channel 4 is connected to on-chip temperature sensor. This channel is used in "dietemp" node:
zephyr/dts/arm/raspberrypi/rpi_pico/rp2040.dtsi
Lines 440 to 444 in dcf94aa
| die_temp: dietemp { | |
| compatible = "raspberrypi,pico-temp"; | |
| io-channels = <&adc 4>; | |
| status = "disabled"; | |
| }; |
Refer to RP2040 Datasheet, section 4.9. ADC and Temperature Sensor
Add support for Waveshare RP2040 Plus board a Raspberry Pi Pico like board including a battery charger. Signed-off-by: David Schneider <[email protected]>
9aad349 to
db4d4e9
Compare
|



Add support for Waveshare RP2040 Plus board, a Raspberry Pi Pico like board including a battery charger.
See: https://www.waveshare.com/wiki/RP2040-Plus