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 RP2040 support #168

Merged
merged 22 commits into from
Jul 13, 2023
Merged

Add RP2040 support #168

merged 22 commits into from
Jul 13, 2023

Conversation

multiplemonomials
Copy link
Collaborator

Summary of changes

This PR adds initial support for running Mbed on Raspberry Pi 2040 processors via the RASPBERRY_PI_PICO target. It's based on the PR Arduino created against mainline Mbed, but adapted to work with Mbed CE's CMake build system and with some extra bugfixes (BufferedSerial now works) and features (automated uploading and debugging).

Impact of changes

Mbed will now support the RPi Pico.

Migration actions required

Documentation

Wiki page is being worked on here.


Pull request type

[] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[X] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[X] Tests / results supplied as part of this PR

Reviewers


@multiplemonomials
Copy link
Collaborator Author

multiplemonomials commented Jul 10, 2023

OK we're doing better with the latest round of fixes:

85% tests passed, 11 tests failed out of 71

Total Test time (real) = 1726.15 sec

The following tests FAILED:
          1 - mbed-drivers-ticker (Failed)
          2 - mbed-usb-device-basic (Failed)
          3 - mbed-usb-device-hid (Failed)
          4 - mbed-usb-device-msd (Failed)
          5 - mbed-usb-device-serial (Failed)
         10 - mbed-hal-flash-functional-tests (Failed)
         15 - mbed-hal-pinmap (Failed)
         17 - mbed-hal-reset-reason (Failed)
         19 - mbed-hal-rtc-reset (Failed)
         29 - mbed-hal-watchdog (Failed)
         31 - mbed-hal-watchdog-timing (Failed)
Errors while running CTest

I won't be working on USB tests as part of this PR, and mbed-hal-rtc-reset will always fail on this device because the RTC does not keep time through a reset. Also, mbed-hal-flash-functional-tests is failing because it seems the current flash api can't handle flash-to-flash program operations.

…vertise the correct capabilities and implement them correctly
…), fix missing frequency field in watchdog features
@multiplemonomials
Copy link
Collaborator Author

OK I think I have fixed nearly all the remaining tests or determined that they can't easily be fixed. Just have mbed-drivers-ticker left to investigate.

One other question in the meantime. @JohnK1987, what would happen if we needed to update the version of pico sdk included here? Did you make any changes to the SDK in the branch? Did you download the entire thing, or some subset of the files? We will probably want to make a plan for the day when it needs to be updated.

@JohnK1987
Copy link
Member

One other question in the meantime. @JohnK1987, what would happen if we needed to update the version of pico sdk included here? Did you make any changes to the SDK in the branch? Did you download the entire thing, or some subset of the files? We will probably want to make a plan for the day when it needs to be updated.

I am not sure, but as a muster I used the data from PR mentioned in main post above and ArduinoCore-Mbed, but the SKD was downloaded from original repo and then was applied only change of name rtc_init, because of colision with Mbed's rtc_init.

BR, Jan

@JohnK1987
Copy link
Member

JohnK1987 commented Jul 10, 2023

Ok, I was wrong. The steps what I descpripted previously are true but it was not in my repo, it was future plan. The version of SDK seems to be 1.3.0 but latest is 1.5.1.
Also only src folder is used.

JohnK1987
JohnK1987 previously approved these changes Jul 11, 2023
@multiplemonomials
Copy link
Collaborator Author

All right, I fixed the us ticker test! @JohnK1987 this should be good to merge now! I will look into updating the SDK in a subsequent PR.

Copy link
Member

@JohnK1987 JohnK1987 left a comment

Choose a reason for hiding this comment

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

Well done!

@multiplemonomials multiplemonomials merged commit a9f8e09 into master Jul 13, 2023
@multiplemonomials multiplemonomials deleted the RP2040 branch July 13, 2023 04:11
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