Merge pull request 'micropython-integration' (#1) from micropython-integration into main
Reviewed-on: #1 Reviewed-by: stefank <kratochwil-la@gmx.de>
This commit was merged in pull request #1.
This commit is contained in:
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[submodule "software/lib/micropython"]
|
||||
path = software/lib/micropython
|
||||
url = ssh://git@git.ka.blankertz.org:2222/TonBERRY/micropython.git
|
||||
21
software/boards/RPI_PICO_W/board.json
Normal file
21
software/boards/RPI_PICO_W/board.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"deploy": [
|
||||
"../deploy.md"
|
||||
],
|
||||
"docs": "",
|
||||
"features": [
|
||||
"BLE",
|
||||
"Dual-core",
|
||||
"External Flash",
|
||||
"USB",
|
||||
"WiFi"
|
||||
],
|
||||
"images": [
|
||||
"rp2-pico-w.jpg"
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"product": "Pico W",
|
||||
"thumbnail": "",
|
||||
"url": "https://www.raspberrypi.com/products/raspberry-pi-pico/",
|
||||
"vendor": "Raspberry Pi"
|
||||
}
|
||||
6
software/boards/RPI_PICO_W/manifest.py
Normal file
6
software/boards/RPI_PICO_W/manifest.py
Normal file
@@ -0,0 +1,6 @@
|
||||
include("$(PORT_DIR)/boards/manifest.py")
|
||||
|
||||
require("bundle-networking")
|
||||
|
||||
# Bluetooth
|
||||
require("aioble")
|
||||
17
software/boards/RPI_PICO_W/mpconfigboard.cmake
Normal file
17
software/boards/RPI_PICO_W/mpconfigboard.cmake
Normal file
@@ -0,0 +1,17 @@
|
||||
# cmake file for Raspberry Pi Pico W
|
||||
|
||||
set(PICO_BOARD "pico_w")
|
||||
|
||||
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)
|
||||
|
||||
# Board specific version of the frozen manifest
|
||||
set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py)
|
||||
|
||||
set(GEN_PINS_BOARD_CSV "${CMAKE_CURRENT_LIST_DIR}/pins.csv")
|
||||
set(GEN_PINS_CSV_ARG --board-csv "${GEN_PINS_BOARD_CSV}")
|
||||
25
software/boards/RPI_PICO_W/mpconfigboard.h
Normal file
25
software/boards/RPI_PICO_W/mpconfigboard.h
Normal file
@@ -0,0 +1,25 @@
|
||||
// Board and hardware specific configuration
|
||||
#define MICROPY_HW_BOARD_NAME "Raspberry Pi Pico W"
|
||||
|
||||
// todo: We need something to check our binary size
|
||||
#define MICROPY_HW_FLASH_STORAGE_BYTES (848 * 1024)
|
||||
|
||||
// Enable networking.
|
||||
#define MICROPY_PY_NETWORK 1
|
||||
#define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT "PicoW"
|
||||
|
||||
// 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
|
||||
|
||||
#define MICROPY_HW_PIN_EXT_COUNT CYW43_WL_GPIO_COUNT
|
||||
|
||||
#define MICROPY_HW_PIN_RESERVED(i) ((i) == CYW43_PIN_WL_HOST_WAKE || (i) == CYW43_PIN_WL_REG_ON)
|
||||
|
||||
#define MICROPY_PY_THREAD (0)
|
||||
30
software/boards/RPI_PICO_W/pins.csv
Normal file
30
software/boards/RPI_PICO_W/pins.csv
Normal file
@@ -0,0 +1,30 @@
|
||||
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
|
||||
GP26,GPIO26
|
||||
GP27,GPIO27
|
||||
GP28,GPIO28
|
||||
WL_GPIO0,EXT_GPIO0
|
||||
WL_GPIO1,EXT_GPIO1
|
||||
WL_GPIO2,EXT_GPIO2
|
||||
LED,EXT_GPIO0
|
||||
|
13
software/build.sh
Executable file
13
software/build.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
TOPDIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
|
||||
set -eu
|
||||
|
||||
( cd lib/micropython
|
||||
make -C mpy-cross -j $(nproc)
|
||||
make -C ports/rp2 BOARD=TONBERRY_RPI_PICO_W BOARD_DIR=$TOPDIR/boards/RPI_PICO_W clean
|
||||
make -C ports/rp2 BOARD=TONBERRY_RPI_PICO_W BOARD_DIR=$TOPDIR/boards/RPI_PICO_W -j $(nproc)
|
||||
)
|
||||
|
||||
echo "Output in lib/micropython/ports/rp2/build-TONBERRY_RPI_PICO_W/firmware.uf2"
|
||||
11
software/flash.sh
Executable file
11
software/flash.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
DEVICEPATH=/dev/disk/by-label/RPI-RP2
|
||||
IMAGEPATH=lib/micropython/ports/rp2/build-TONBERRY_RPI_PICO_W/firmware.uf2
|
||||
|
||||
while [ ! -e "$DEVICEPATH" ] ; do sleep 1; echo 'Waiting for RP2...'; done
|
||||
|
||||
set -eu
|
||||
|
||||
udisksctl mount -b "$DEVICEPATH"
|
||||
cp "$IMAGEPATH" "$(findmnt "$DEVICEPATH" -n -o TARGET)"
|
||||
1
software/lib/micropython
Submodule
1
software/lib/micropython
Submodule
Submodule software/lib/micropython added at a14f90af2f
8
software/update-submodules.sh
Executable file
8
software/update-submodules.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
set -eu
|
||||
|
||||
git submodule update --init lib
|
||||
git -C lib/micropython submodule update --init lib/pico-sdk lib/mbedtls lib/micropython-lib lib/tinyusb lib/btstack lib/cyw43-driver lib/lwip
|
||||
git -C lib/micropython/lib/pico-sdk submodule update --init lib
|
||||
git -C lib/micropython/lib/pico-sdk/lib/tinyusb submodule update --init hw/mcu/raspberry_pi/Pico-PIO-USB/
|
||||
Reference in New Issue
Block a user