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 RP2350 (Pico 2) #1349

Merged
merged 1 commit into from
Nov 13, 2024
Merged

Conversation

pguyot
Copy link
Collaborator

@pguyot pguyot commented Oct 21, 2024

Also update OTP matrix for macOS to include OTP27

Also fix build test matrix to also install elixir & rebar3 in all cases.

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

Copy link
Collaborator

@bettio bettio left a comment

Choose a reason for hiding this comment

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

I'm not sure about the naming here: the day they will add an additional core it will turn into rp3.
Maybe I'd rather call it rpipico or rpico.

image

@pguyot
Copy link
Collaborator Author

pguyot commented Nov 6, 2024

True.

Raspberry Pi had a rp2_common directory before the pico 2.

https://github.com/raspberrypi/pico-sdk/tree/master/src

Micropython calls the port rp2

https://github.com/micropython/micropython/tree/master/ports

I never was a fan of the pico brand name for this platform as pico refers to the board and not the soc and there are a lot of cheap boards using the same soc that we support here.

@@ -210,9 +210,9 @@ You can now use a serial console program such as [minicom](https://en.wikipedia.
INFO [74] AtomVM: Exited with return: ok
INFO [78] AtomVM: AtomVM application terminated. Going to sleep forever ...

#### Raspberry Pico
#### Raspberry Pi Pico and Pico 2
Copy link
Collaborator

Choose a reason for hiding this comment

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

I need just a minor clarification: where do we want to use the term Raspberry Pi Pico and where rp2040?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you. I suggest to use "Raspberry Pi RP2" when referring to the soc family (RP2040 and RP2350) and Pico, Pico-W and Pico 2 when referring to the boards. I updated the documentation following this approach.

@@ -732,19 +732,20 @@ If building for a different target USART may be configure as explained above in

After your application has been tested (_and debugged_) and is ready to put into active use you may want to tune the build of AtomVM. For instance disabling logging with `-DAVM_LOG_DISABLE=on` as a `cmake` configuration option may result in slightly better performance. This will have no affect on the console output of your application, just disable low level log messages from the AtomVM system. You may also want to enabling automatic reboot in the case that your application ever exits with a return other than `ok`. This can be enabled with the `cmake` option `-DAVM_CONFIG_REBOOT_ON_NOT_OK=on`.

## Building for Raspberry Pi Pico
## Building for Raspberry Pi Pico and Pico 2
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we keep implicit the 2040 name, or should we use the board name?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This part has been retitled "Building for Raspberry Pi RP2" following the approach described above.
The only place I kept Pico and Pico 2 in the documentation is in the getting started where we refer explicitely to the board names.

@bettio
Copy link
Collaborator

bettio commented Nov 10, 2024

True.

Raspberry Pi had a rp2_common directory before the pico 2.

https://github.com/raspberrypi/pico-sdk/tree/master/src

Micropython calls the port rp2

https://github.com/micropython/micropython/tree/master/ports

I never was a fan of the pico brand name for this platform as pico refers to the board and not the soc and there are a lot of cheap boards using the same soc that we support here.

I understand your point, still I'm not yet sure if we are using Raspberry Pi Pico vs 2040 names in a consistent name.

@@ -67,6 +66,10 @@ target_link_libraries(
pico_sync
pico_time)

if (PICO_RP2040)
target_link_libraries(libAtomVM${PLATFORM_LIB_SUFFIX} PUBLIC hardware_rtc)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just for my personal understanding, what about RTC on RP2350?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

RTC is not supported on RP2350. Instead, they feature the standard RISC-V platform timer, and for this PR I didn't port the nif for RTC.

See https://www.raspberrypi.com/documentation/pico-sdk/hardware.html#hardware_riscv_platform_timer-rp2350

Also update OTP matrix for macOS to include OTP27

Also fix build test matrix to also install elixir & rebar3 in all cases.

Signed-off-by: Paul Guyot <[email protected]>
@bettio bettio merged commit 1cddf54 into atomvm:main Nov 13, 2024
77 of 81 checks passed
@pguyot pguyot deleted the w40/add-pico2-support branch November 14, 2024 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants