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 micro-controllers (#6725) #455

Merged
merged 18 commits into from
Dec 5, 2024
Merged

Conversation

rogerlz
Copy link
Contributor

@rogerlz rogerlz commented Dec 3, 2024

This adds support for the new Raspberry Pi RP2350 micro-controllers. This has also been discussed at: https://klipper.discourse.group/t/support-for-rp2350-micro-controllers/19656

Note that the rp2350 has a serious hardware defect (RP2350-E9 errata) and as a result I do not recommend using this chip currently. See the link above for more details.

The code on this PR has a few known limitations (to be addressed in future PRs):

Only the first 30 GPIOs are supported. Support for the additional GPIOs on the rp2350b has not been added (nor support for ADC in general on the rp2350b).
-Kevin

EDIT: The chipid and reboot into bootloader functionality has also been implemented in this PR.

Klipper PR: Klipper3d/klipper#6725

@rogerlz rogerlz requested a review from a team as a code owner December 3, 2024 23:17
Recent versions of the rp2040 sdk no longer contain the elf2uf2 tool.
So, move that code to a new dedicated directory.  This is in
preparation for updating the rp2040 sdk version.

Signed-off-by: Kevin O'Connor <[email protected]>
A new version of can2040 is needed due to changes in the 2.0.0 release
of the pico-sdk.

Signed-off-by: Kevin O'Connor <[email protected]>
This is in preparation for adding support for rp2350 mcus.

Signed-off-by: Kevin O'Connor <[email protected]>
Rename the Kconfig symbols.  This is in preparation to adding support
for the rp2350 mcu.

Signed-off-by: Kevin O'Connor <[email protected]>
This is in preparation for rp2350 support.

Signed-off-by: Kevin O'Connor <[email protected]>
Some versions of the system memcpy() may make unaligned memory
accesses, which can result in a bus fault when accessing the usb dpram
device memory.

Signed-off-by: Kevin O'Connor <[email protected]>
The rp2350 chip requires a higher internal frequency, so choose a
value that works for both rp2040 and rp2350.

Signed-off-by: Kevin O'Connor <[email protected]>
Signed-off-by: Kevin O'Connor <[email protected]>
This is in preparation for adding rp2350 flash support.

Signed-off-by: Kevin O'Connor <[email protected]>
Rewrite chipid.c so that it contains just the USB and canbus id
manipulation code.  Move the low-level chipid reading to bootrom.c.

Also, introduce a new bootrom_reboot_usb_bootloader() function in
bootrom.c so that the main.c code does not need to know the specifics
of rebooting into the bootrom.

Signed-off-by: Kevin O'Connor <[email protected]>
This adds the bootrom code needed to implement "reboot into
bootloader" and "chipid" capabilities.

Signed-off-by: Kevin O'Connor <[email protected]>
Signed-off-by: Kevin O'Connor <[email protected]>
@rogerlz rogerlz merged commit 119023e into main Dec 5, 2024
3 checks passed
@rogerlz rogerlz deleted the mainline-pr-6725 branch December 5, 2024 19:56
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