Skip to content
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

Add support for Raspberry Pi Pico 2 #377

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

chrisib
Copy link
Collaborator

@chrisib chrisib commented Aug 27, 2024

  • Adds pico2 to europi_config.PICO_MODEL options
  • Allows setting the default & 2x overclocked CPU freqency for the RP2350 processor
  • Programming instructions updated to cover Pico 2 setup

@chrisib chrisib added firmware Software related issue improvement Improvement or optimization of an existing feature or script draft Not yet ready to merge labels Aug 27, 2024
@chrisib
Copy link
Collaborator Author

chrisib commented Aug 27, 2024

Adding the Draft label for now; I'm going on holiday for a week, and taking my backpack-sized case with me. I'll be testing out the EuroPi with the Pico 2 installed in it while I'm away to check for any bugs I've missed.

Assuming that testing goes well, I'll remove the Draft tag when I'm back.

Copy link
Collaborator

@roryjamesallen roryjamesallen left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for adding!

Could possibly do with adding a note in the BOM that the Pico 2 is supported along with any other RP2040/RP2350 clones that have an identical pinout to the original Pico (at the user's own risk)

@chrisib
Copy link
Collaborator Author

chrisib commented Aug 28, 2024

Could possibly do with adding a note in the BOM that the Pico 2 is supported along with any other RP2040/RP2350 clones that have an identical pinout to the original Pico (at the user's own risk)

There is already a note about clones:

Note: Any official version of the Raspberry Pi Pico will work (W, H, or WH). Third party RP2040 boards may work, but there is no guarantee - always double check the pinout

I can add another line about the Pico 2 being usable with additional configuration.

@roryjamesallen
Copy link
Collaborator

Could possibly do with adding a note in the BOM that the Pico 2 is supported along with any other RP2040/RP2350 clones that have an identical pinout to the original Pico (at the user's own risk)

There is already a note about clones:

Note: Any official version of the Raspberry Pi Pico will work (W, H, or WH). Third party RP2040 boards may work, but there is no guarantee - always double check the pinout

I can add another line about the Pico 2 being usable with additional configuration.

Ah my bad, I forgot about the original BOM note. That addition is perfect!

@chrisib
Copy link
Collaborator Author

chrisib commented Sep 1, 2024

Had to disable the temperature check in the diagnostic script because of micropython/micropython#15687

Hopefully we can re-enable this feature later.

…actual frequency, add "pico2" as a new value for PICO_MODEL
… I'm waiting for mine to ship and this is all considered placeholder for now.
…t hang on the RP2350. Hopefully this can be reverted with a future RP2350 Micropython implementation (breaks in 1.24.0-preview.201)
…o 2; it's not currently usable and causes an unhandled exception when used
…g new ones. Ask for 5 and 10V for the simple calibration, but support skipping if the rack can't supply one or the other (most cases should be able to produce at least one). Allow skipping voltages during advanced calibration too
…strings, remove unused functions. Print the desired voltage with 1 decimal place and units
… to resolve the issue with _thread we were previously encountering
@chrisib
Copy link
Collaborator Author

chrisib commented Nov 5, 2024

Rebased to latest main after multiple other merges (mostly contrib scripts, but a few firmware changes too)

A few issues, like the temperature sensor and USB-connected detectors, are fixed in the Calibration update (#379), so I'll keep this as a draft until that gets merged.

@chrisib
Copy link
Collaborator Author

chrisib commented Nov 9, 2024

@roryjamesallen: I've made a few changes since you gave your approval. Rather than tying this up waiting for the calibration update, I've copied the relevant changes from over there into this branch.

I think we're in a state where we can merge this in; I've been using one of my EuroPi modules with the RP2350 in it full-time for a few months without any issues.

I'll hold off merging until you have a chance to re-approve since there have been changes though.

@chrisib chrisib removed the draft Not yet ready to merge label Nov 9, 2024
Copy link
Collaborator

@roryjamesallen roryjamesallen left a comment

Choose a reason for hiding this comment

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

I haven't tested anything on the module, only added a few small spelling comments. If you've been using it for a while and anyone else has tested it then I'm happy to merge!

software/CONFIGURATION.md Outdated Show resolved Hide resolved
- `CPU_FREQ` must be one of `250000000` or `125000000`. Default: `"250000000"`
- `EUROPI_MODEL` specifies the type of EuroPi module. Currently only `"europi"` is supported. Default: `"europi"`.
- `PICO_MODEL` must be one of `"pico"`, `"pico2"`, or `"pico w"`. Default: `"pico"`.
- `CPU_FREQ` specifies whether or not the CPU should be overclocked. Must be one of `"overclocked"` or `"normal"`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

[Suggestion]
Apologies if I've missed a discussion on this but is there a reason for limiting the user to only discrete values as opposed to the full range? It's a real edge case but I know some people have underclocked the Pico before for power consumption reasons

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was mostly copying what was available in the original version. We probably could add a new underclocked option at a later date to support that. I'm not sure it's worth including in this merge request, but the framework of CPU frequencies isn't hard to expand on later if we want to add underclocking. I have concerns about what underclocking may do to some scripts, but that's a separate question.

I'm not sure I see much benefit in allowing the full integer range of frequencies; will anyone ever realistically need to control the frequency down to the Hz? Also, specifying the actual frequency assumes the user has referred to the datasheet and knows what the supported frequencies for the processor are. The more-abstract "underclocked/normal/overclocked" option feels easier to understand to me, even though it's less informative.

software/firmware/europi.py Show resolved Hide resolved
software/firmware/europi.py Outdated Show resolved Hide resolved
@return The current temperature in Celsius, or None if the hardware did not initialze properly
"""
if self.pin:
# see the pico's datasheet for the details of this calculation
Copy link
Collaborator

Choose a reason for hiding this comment

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

[Spelling]
Capital letter for See and Pico

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done, though this comment was copied verbatim from the diagnostic script. How picky are we in general about punctuation and caps in explanatory comments?

software/programming_instructions.md Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
firmware Software related issue improvement Improvement or optimization of an existing feature or script
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants