Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Changes fromall commits
1029501
d6cfdca
ba8f1bd
7c6a51d
c3570b2
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -34,26 +34,26 @@ ifeq ($(BUILD_VERBOSE),1) | ||
MAKE_ARGS += VERBOSE=1 # Picked up in Makefile generated by CMake | ||
endif | ||
overrideCMAKE_ARGS += -DMICROPY_BOARD=$(BOARD) -DMICROPY_BOARD_DIR="$(abspath $(BOARD_DIR))" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 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 commentThe 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 | ||
ifdef USER_C_MODULES | ||
overrideCMAKE_ARGS += -DUSER_C_MODULES=${USER_C_MODULES} | ||
endif | ||
ifneq ($(FROZEN_MANIFEST),) | ||
overrideCMAKE_ARGS += -DMICROPY_FROZEN_MANIFEST=${FROZEN_MANIFEST} | ||
endif | ||
ifeq ($(DEBUG),1) | ||
overrideCMAKE_ARGS += -DCMAKE_BUILD_TYPE=Debug | ||
endif | ||
ifdef BOARD_VARIANT | ||
overrideCMAKE_ARGS += -DMICROPY_BOARD_VARIANT=$(BOARD_VARIANT) | ||
endif | ||
ifdef MICROPY_PREVIEW_VERSION_2 | ||
overrideCMAKE_ARGS += -DMICROPY_PREVIEW_VERSION_2=1 | ||
endif | ||
HELP_BUILD_ERROR ?= "See \033[1;31mhttps://github.com/micropython/micropython/wiki/Build-Troubleshooting\033[0m" | ||
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") |
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() |
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 |
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 |
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") |
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 |
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 |
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) |
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 resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
#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) |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.