-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Support for RM2 break out boards #16057
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
peterharperuk
wants to merge
5
commits into
micropython:master
Choose a base branch
from
peterharperuk:pico2_w_changes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+413
−99
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1029501
rp2: Allow extra arguments in Makefile.
peterharperuk d6cfdca
rp2: Put cyw43 config in separate files.
peterharperuk ba8f1bd
rp2: Allow pins.csv filename to be configured.
peterharperuk 7c6a51d
rp2: Allow pico and pico2 to use cyw43.
peterharperuk c3570b2
rp2: Dynamic cyw43 config.
peterharperuk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# This file is only used if cyw43 is enabled | ||
include("$(PORT_DIR)/boards/manifest.py") | ||
|
||
require("bundle-networking") | ||
|
||
# Bluetooth | ||
require("aioble") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
# cmake file for Raspberry Pi Pico | ||
set(PICO_BOARD "pico") | ||
set(PICO_PLATFORM "rp2040") | ||
|
||
if (PICO_CYW43_SUPPORTED) | ||
include(enable_cyw43.cmake) | ||
set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py) | ||
set(PICO_PINS_CSV_NAME pins_cyw43.csv) | ||
endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,26 @@ | ||
// Board and hardware specific configuration | ||
#define MICROPY_HW_BOARD_NAME "Raspberry Pi Pico" | ||
|
||
#if MICROPY_PY_NETWORK_CYW43 | ||
#include "enable_cyw43.h" | ||
|
||
// Enable the ability to pass cyw43 pins into WiFi, Bluetooth and Pin constructors | ||
#define CYW43_PIN_WL_DYNAMIC 1 | ||
#define CYW43_PIO_CLOCK_DIV_DYNAMIC 1 | ||
|
||
// Set the default pins to gpios 2-5 | ||
#define CYW43_DEFAULT_PIN_WL_REG_ON 2 | ||
#define CYW43_DEFAULT_PIN_WL_CS 3 | ||
#define CYW43_DEFAULT_PIN_WL_DATA_OUT 4 | ||
#define CYW43_DEFAULT_PIN_WL_DATA_IN 4 | ||
#define CYW43_DEFAULT_PIN_WL_HOST_WAKE 4 | ||
#define CYW43_DEFAULT_PIN_WL_CLOCK 5 | ||
|
||
// Default pio clock | ||
#define CYW43_PIO_CLOCK_DIV_INT 3 | ||
|
||
// we have to reduce the flash storage if cyw43 is enabled or else the firmware gets overwritten | ||
#define MICROPY_HW_FLASH_STORAGE_BYTES (848 * 1024) | ||
#else | ||
#define MICROPY_HW_FLASH_STORAGE_BYTES (1408 * 1024) | ||
#endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
GP0,GPIO0 | ||
GP1,GPIO1 | ||
GP2,GPIO2 | ||
GP3,GPIO3 | ||
GP4,GPIO4 | ||
GP5,GPIO5 | ||
GP6,GPIO6 | ||
GP7,GPIO7 | ||
GP8,GPIO8 | ||
GP9,GPIO9 | ||
GP10,GPIO10 | ||
GP11,GPIO11 | ||
GP12,GPIO12 | ||
GP13,GPIO13 | ||
GP14,GPIO14 | ||
GP15,GPIO15 | ||
GP16,GPIO16 | ||
GP17,GPIO17 | ||
GP18,GPIO18 | ||
GP19,GPIO19 | ||
GP20,GPIO20 | ||
GP21,GPIO21 | ||
GP22,GPIO22 | ||
GP25,GPIO25 | ||
GP26,GPIO26 | ||
GP27,GPIO27 | ||
GP28,GPIO28 | ||
LED,GPIO25 | ||
WL_GPIO0,EXT_GPIO0 | ||
WL_GPIO1,EXT_GPIO1 | ||
WL_GPIO2,EXT_GPIO2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# This file is only used if cyw43 is enabled | ||
include("$(PORT_DIR)/boards/manifest.py") | ||
|
||
require("bundle-networking") | ||
|
||
# Bluetooth | ||
require("aioble") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,22 @@ | ||
// Board and hardware specific configuration | ||
#define MICROPY_HW_BOARD_NAME "Raspberry Pi Pico2" | ||
#define MICROPY_HW_FLASH_STORAGE_BYTES (PICO_FLASH_SIZE_BYTES - 1024 * 1024) | ||
|
||
#if MICROPY_PY_NETWORK_CYW43 | ||
#include "enable_cyw43.h" | ||
|
||
// Enable the ability to pass cyw43 pins into WiFi, Bluetooth and Pin constructors | ||
#define CYW43_PIN_WL_DYNAMIC 1 | ||
#define CYW43_PIO_CLOCK_DIV_DYNAMIC 1 | ||
|
||
// Set the default pins to gpios 2-5 | ||
#define CYW43_DEFAULT_PIN_WL_REG_ON 2 | ||
#define CYW43_DEFAULT_PIN_WL_CS 3 | ||
#define CYW43_DEFAULT_PIN_WL_DATA_OUT 4 | ||
#define CYW43_DEFAULT_PIN_WL_DATA_IN 4 | ||
#define CYW43_DEFAULT_PIN_WL_HOST_WAKE 4 | ||
#define CYW43_DEFAULT_PIN_WL_CLOCK 5 | ||
|
||
// Default pio clock | ||
#define CYW43_PIO_CLOCK_DIV_INT 3 | ||
#endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
GP0,GPIO0 | ||
GP1,GPIO1 | ||
GP2,GPIO2 | ||
GP3,GPIO3 | ||
GP4,GPIO4 | ||
GP5,GPIO5 | ||
GP6,GPIO6 | ||
GP7,GPIO7 | ||
GP8,GPIO8 | ||
GP9,GPIO9 | ||
GP10,GPIO10 | ||
GP11,GPIO11 | ||
GP12,GPIO12 | ||
GP13,GPIO13 | ||
GP14,GPIO14 | ||
GP15,GPIO15 | ||
GP16,GPIO16 | ||
GP17,GPIO17 | ||
GP18,GPIO18 | ||
GP19,GPIO19 | ||
GP20,GPIO20 | ||
GP21,GPIO21 | ||
GP22,GPIO22 | ||
GP25,GPIO25 | ||
GP26,GPIO26 | ||
GP27,GPIO27 | ||
GP28,GPIO28 | ||
LED,GPIO25 | ||
WL_GPIO0,EXT_GPIO0 | ||
WL_GPIO1,EXT_GPIO1 | ||
WL_GPIO2,EXT_GPIO2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
set(MICROPY_PY_LWIP ON) | ||
set(MICROPY_PY_NETWORK_CYW43 ON) | ||
|
||
# Bluetooth | ||
set(MICROPY_PY_BLUETOOTH ON) | ||
set(MICROPY_BLUETOOTH_BTSTACK ON) | ||
set(MICROPY_PY_BLUETOOTH_CYW43 ON) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Enable networking. | ||
#define MICROPY_PY_NETWORK 1 | ||
|
||
#ifndef MICROPY_PY_NETWORK_HOSTNAME_DEFAULT | ||
#define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT "Pico" | ||
peterharperuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#endif | ||
|
||
// CYW43 driver configuration. | ||
#define CYW43_USE_SPI (1) | ||
#define CYW43_LWIP (1) | ||
#define CYW43_GPIO (1) | ||
#define CYW43_SPI_PIO (1) | ||
|
||
// For debugging mbedtls - also set | ||
// Debug level (0-4) 1=warning, 2=info, 3=debug, 4=verbose | ||
// #define MODUSSL_MBEDTLS_DEBUG_LEVEL 1 | ||
|
||
#ifndef CYW43_WL_GPIO_COUNT | ||
#define CYW43_WL_GPIO_COUNT 3 | ||
#endif | ||
|
||
#define MICROPY_HW_PIN_EXT_COUNT CYW43_WL_GPIO_COUNT | ||
|
||
int mp_hal_is_pin_reserved(int n); | ||
#define MICROPY_HW_PIN_RESERVED(i) mp_hal_is_pin_reserved(i) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really don't think it's a good idea to complicate the Makefile by adding
override
. Combining make and cmake is already tricky enough.Why exactly is this needed, what were you trying to achieve with it? Can we do it a different way, eg just call cmake directly in such cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the intent is to pass compiler definitions through to a port, effectively skipping the need to change config files? Possibly to optionally build Pico with RM2 support.
We have variants for this, though there are few examples of that in practise. Here's one for switching to a RISCV build: https://github.com/micropython/micropython/tree/master/ports/rp2/boards/SEEED_XIAO_RP2350