Skip to content

rp2/boards: Add Waveshare rp2040 plus #10314

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

RetiredWizard
Copy link

According to The Waveshare website, the RP2040 Plus is a software compatible board to the Raspberry Pi Pico that uses either a 4MB or 16MB flash chip, a USB-C connector and adds some battery recharge circuitry/connector. I have been using the standard downloaded Raspberry Pi Pico Micropython and Circuitpython images and other than only seeing 2MB of flash have not seen any issues.

Recently I took a look at building a Micropython image that uses the correct flash size and since it turns out that this board is supported in the pico-sdk folders all I had to do was create a folder named WAVESHARE_RP2040_PLUS_4MB in the ports/rp2/boards folder and populate it with an updated board.json, mpconfigboard.cmake and mpconfigboard.h files.

I've tested the build on my 4MB board and haven't seen any issues. I also built the 16MB image but I don't have a 16MB board to test it on. I did load it on my 4MB board and Micropython boots and I'm able to run programs if I don't use too much flash but copying larger amounts of data to the board end up crashing it which is probably to be expected 😁

According to The Waveshare website, the RP2040 Plus is a software
compatible board to the Raspberry Pi Pico that uses either a 4MB or
16MB flash chip, a USB-C connector and adds some battery recharge
circuitry/connector.

Since this board is supported in the pico-sdk folders, all that was
needed was folders named WAVESHARE_RP2040_PLUS_4MB/_16MB in the
ports/rp2/boards folder populated with updated board.json,
mpconfigboard.cmake and mpconfigboard.h files.

Signed-off-by: David Hunter <github@retiredwizard.com>
Update the MICROPY_HW_BOARD_NAME parameter with the correct name
indicating 16MB of flash rather than 4MB.

Signed-off-by: RetiredWizard <github@retiredwizard.com>
@mattytrentini
Copy link
Contributor

A BOARD_VARIANT should be used in this case, see the WEACTSTUDIO board definition. It allows one board definition (WAVESHARE_RP2040_PLUS) with variants to specify the flash size. I can help with the changes if you get stuck!

@RetiredWizard
Copy link
Author

RetiredWizard commented Dec 24, 2022

@mattytrentini I started down that path first but realized that WEACTSTUDIO isn't supported in the pico-sdk. If I use that option we won't be using the resources provided in the pico-sdk. I'll go ahead and combine the two boards using that option if that's the right way to go but I was thinking it was better building on the SDK.

@RetiredWizard
Copy link
Author

Also looking at the WEACTSTUDIO download page on micropython.org, I'm not sure I understand how the nightly firmware builds are being built. Do the variant versions only get populated with releases? Which variant is being produced for the nightly builds?

@mattytrentini
Copy link
Contributor

@mattytrentini I started down that path first but realized that WEACTSTUDIO isn't supported in the pico-sdk. If I use that option we won't be using the resources provided in the pico-sdk.

Sorry, I wasn't very clear; I meant see the WEACTSTUDIO for an example of how to do the board variants. :) So create the WAVESHARE_RP_2040 board (as you've done, but just one definition) using the pico-sdk to build but use the BOARD_VARIANT check as WEACTSTUDIO does to select the flash size.

Also looking at the WEACTSTUDIO download page on micropython.org, I'm not sure I understand how the nightly firmware builds are being built.

Right now, they're not, only the default BOARD_VARIANT is built. But that should change very soon and won't affect your board definition - a small update to the autobuild files is needed.

@RetiredWizard
Copy link
Author

I was under the impression that the build directory name was what connected the build to the pico-sdk, is that not the case? How are the headers from the pico-sdk linked to board build then?

@RetiredWizard
Copy link
Author

Never mind, after looking at the WEACTSTUDIO files again, I realized the PICO_BOARD parameter can be used to define the link to the SDK.

@RetiredWizard RetiredWizard force-pushed the Waveshare-RP2040-Plus branch 2 times, most recently from 946494d to 0da2439 Compare December 26, 2022 03:31
A tab was used on one of the features line, this replaces it with
4 spaces.

Signed-off-by: RetiredWizard <github@RetiredWizard.com>
Modified the ports/rp2/boards/WAVESHARE_RP2040_PLUS directory to use
"make" variants to select the 4mb or 16mb flash option. This results
in a single board definition for the two configurations the board
can be purchased in.

Signed-off-by: RetiredWizard <github@RetiredWizard.com>
Signed-off-by: RetiredWizard <github@RetiredWizard.com>
Signed-off-by: RetiredWizard <github@RetiredWizard.com>
@RetiredWizard RetiredWizard changed the title Waveshare rp2040 plus rp2/boards: Add Waveshare rp2040 plus Dec 26, 2022
Remove the variant identifier from general board identifier keys.
Signed-off-by: RetiredWizard <github@RetiredWizard.com>
@RetiredWizard
Copy link
Author

PR #9085 actually adds these boards and several other Waveshare boards. I'm thinking it's probably easier to add the variant mode to that PR than try and merge both. This one should probably be closed.

@jimmo jimmo added the board-definition New or updated board definition files. Combine with a port- label. label Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
board-definition New or updated board definition files. Combine with a port- label. port-rp2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants