8000 rp2/boards: Add WAVGAT_16MB board. · micropython/micropython@9250907 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9250907

Browse files
committed
rp2/boards: Add WAVGAT_16MB board.
1 parent 5873390 commit 9250907

File tree

9 files changed

+132
-1
lines changed

9 files changed

+132
-1
lines changed

ports/rp2/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ all:
2525
clean:
2626
$(RM) -rf $(BUILD)
2727

28-
GIT_SUBMODULES += lib/pico-sdk lib/tinyusb
28+
GIT_SUBMODULES += lib/pico-sdk lib/tinyusb lib/mbedtls
2929

3030
submodules:
3131
$(MAKE) -f ../../py/mkrules.mk GIT_SUBMODULES="$(GIT_SUBMODULES)" submodules
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Wavgat Pico Board RP2040
2+
These powerful and affordable boards are available from the official
3+
[Wavgat AliExpress page](https://www.aliexpress.com/item/1005003843712530.html).
4+
5+
The Wavgat Pico Board is based on the Raspberry Pi RP2040 and comes with either
6+
2/4/8/16 MB of flash.
7+
8+
## Board-specific modules
9+
The `board` module contains definitions for the onboard LED and user key.
10+
Example:
11+
```python
12+
> import board
13+
> board.led.toggle() # Turns LED on
14+
> board.key.value() # Returns 0 or 1 depending whether the user key is pressed
15+
```
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"deploy": [
3+
"deploy.md"
4+
],
5+
"docs": "",
6+
"features": [
7+
"Breadboard Friendly",
8+
"SPI Flash",
9+
"USB-C"
10+
],
11+
"images": [
12+
"wavgat_rp2040.jpg"
13+
],
14+
"mcu": "rp2040",
15+
"product": "Pico Board RP2040 (16MiB)",
16+
"url": "https://www.aliexpress.com/item/1005003843712530.html",
17+
"vendor": "Wavgat"
18+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
### Flashing via UF2 bootloader
2+
3+
To get the board in bootloader mode ready for the firmware update, execute
4+
`machine.bootloader()` at the MicroPython REPL. Alternatively, hold
5+
down the BOOTSEL button while pressing reset (NRST). The uf2 file below
6+
should then be copied to the USB mass storage device that appears. Once
7+
programming of the new firmware is complete the device will automatically reset
8+
and be ready for use.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include("$(PORT_DIR)/boards/manifest.py")
2+
freeze("./modules")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from micropython import const
2+
from machine import Pin
3+
4+
led = Pin(25, Pin.OUT, value=0)
5+
key = Pin(23, Pin.IN, Pin.PULL_UP)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# cmake file for Wavgat Pico 16MB
2+
3+
# The Wavgat boards don't have official pico-sdk support so we define it here.
4+
# See also: https://github.com/raspberrypi/pico-sdk/tree/master/src/boards/include/boards
5+
set(PICO_BOARD_HEADER_DIRS ${MICROPY_PORT_DIR}/boards/${MICROPY_BOARD})
6+
7+
# Freeze board.py
8+
set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#define MICROPY_HW_BOARD_NAME "Wavgat Pico 16MB"
2+
#define MICROPY_HW_FLASH_STORAGE_BYTES (15 * 1024 * 1024)
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// A pico-sdk board definition is required since the Wavgat boards are not officially
2+
// supported.
3+
//
4+
// Officially supported boards:
5+
// https://github.com/raspberrypi/pico-sdk/tree/master/src/boards/include/boards
6+
7+
#ifndef _BOARDS_WAVGAT_16MB_H
8+
#define _BOARDS_WAVGAT_16MB_H
9+
10+
// For board detection
11+
#define WAVGAT_16MB
12+
13+
// --- UART ---
14+
#ifndef PICO_DEFAULT_UART
15+
#define PICO_DEFAULT_UART 0
16+
#endif
17+
#ifndef PICO_DEFAULT_UART_TX_PIN
18+
#define PICO_DEFAULT_UART_TX_PIN 0
19+
#endif
20+
#ifndef PICO_DEFAULT_UART_RX_PIN
21+
#define PICO_DEFAULT_UART_RX_PIN 1
22+
#endif
23+
24+
// --- LED ---
25+
#ifndef PICO_DEFAULT_LED_PIN
26+
#define PICO_DEFAULT_LED_PIN 25
27+
#endif
28+
29+
// --- I2C ---
30+
#ifndef PICO_DEFAULT_I2C
31+
#define PICO_DEFAULT_I2C 0
32+
#endif
33+
#ifndef PICO_DEFAULT_I2C_SDA_PIN
34+
#define PICO_DEFAULT_I2C_SDA_PIN 4
35+
#endif
36+
#ifndef PICO_DEFAULT_I2C_SCL_PIN
37+
#define PICO_DEFAULT_I2C_SCL_PIN 5
38+
#endif
39+
40+
// --- SPI ---
41+
#ifndef PICO_DEFAULT_SPI
42+
#define PICO_DEFAULT_SPI 0
43+
#endif
44+
#ifndef PICO_DEFAULT_SPI_SCK_PIN
45+
#define PICO_DEFAULT_SPI_SCK_PIN 18
46+
#endif
47+
#ifndef PICO_DEFAULT_SPI_TX_PIN
48+
#define PICO_DEFAULT_SPI_TX_PIN 19
49+
#endif
50+
#ifndef PICO_DEFAULT_SPI_RX_PIN
51+
#define PICO_DEFAULT_SPI_RX_PIN 16
52+
#endif
53+
#ifndef PICO_DEFAULT_SPI_CSN_PIN
54+
#define PICO_DEFAULT_SPI_CSN_PIN 17
55+
#endif
56+
57+
// --- FLASH ---
58+
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
59+
60+
#ifndef PICO_FLASH_SPI_CLKDIV
61+
#define PICO_FLASH_SPI_CLKDIV 2
62+
#endif
63+
64+
#ifndef PICO_FLASH_SIZE_BYTES
65+
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
66+
#endif
67+
68+
// All boards have B1 RP2040
69+
#ifndef PICO_RP2040_B0_SUPPORTED
70+
#define PICO_RP2040_B0_SUPPORTED 0
71+
#endif
72+
73+
#endif

0 commit comments

Comments
 (0)
0