File tree Expand file tree Collapse file tree 12 files changed +235
-0
lines changed
ports/rp2/boards/WEACTSTUDIO Expand file tree Collapse file tree 12 files changed +235
-0
lines changed Original file line number Diff line number Diff line change
1
+ # WeAct Studio RP2040
2
+
3
+ The WeAct Studio RP2040 Board is based on the Raspberry Pi RP2040 and can be
4
+ purchased with 2/4/8/16 MiB of flash.
5
+
6
+ These boards are available from a number of resellers and often have the name
7
+ "Pico Board RP2040". WeAct maintain the [ WeActStudio.RP2040CoreBoard] ( https://github.com/WeActTC/WeActStudio.RP2040CoreBoard/tree/master )
8
+ repository containing information on the board.
9
+
10
+ ## Build notes
11
+
12
+ Builds can be configured with the ` BOARD_VARIANT ` parameter. Valid variants
13
+ can be displayed with the ` query-variant ` target. An example:
14
+
15
+ ``` bash
16
+ > cd ports/rp2
17
+ > make BOARD=WEACTSTUDIO query-variants
18
+ VARIANTS: flash_2mb flash_4mb flash_8mb flash_16mb
19
+ > make BOARD=WEACTSTUDIO BOARD_VARIANT=flash_8mb submodules all # Build the 8 MiB variant
20
+ ```
21
+
22
+ ` flash_16mb ` is the default if ` BOARD_VARIANT ` is not supplied.
23
+
24
+ ## Board-specific modules
25
+
26
+ The ` board ` module contains definitions for the onboard LED and user button.
27
+
28
+ Example:
29
+
30
+ ``` python
31
+ > import board
32
+ > board.led.toggle() # Toggles the state of the on-board LED
33
+ > board.key.value() # Returns 0 or 1 corresponding to the state of the user key
34
+ ```
Original file line number Diff line number Diff line change
1
+ {
2
+ "deploy" : [
3
+ " deploy.md"
4
+ ],
5
+ "docs" : " " ,
6
+ "features" : [
7
+ " Breadboard Friendly" ,
8
+ " SPI Flash" ,
9
+ " USB-C"
10
+ ],
11
+ "images" : [
12
+ " weact_rp2040.jpg"
13
+ ],
14
+ "mcu" : " rp2040" ,
15
+ "product" : " WeAct Studio RP2040" ,
16
+ "url" : " https://github.com/WeActTC/WeActStudio.RP2040CoreBoard" ,
17
+ "variants" : {
18
+ "flash_2mb" : " 2 MiB Flash" ,
19
+ "flash_4mb" : " 4 MiB Flash" ,
20
+ "flash_8mb" : " 8 MiB Flash"
21
+ },
22
+ "vendor" : " WeAct"
23
+ }
Original file line number Diff line number Diff line change
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.
Original file line number Diff line number Diff line change
1
+ include ("$(PORT_DIR)/boards/manifest.py" )
2
+ freeze ("./modules" )
Original file line number Diff line number Diff line change
1
+ from machine import Pin
2
+
3
+ led = Pin (25 , Pin .OUT , value = 0 )
4
+ key = Pin (23 , Pin .IN , Pin .PULL_UP )
Original file line number Diff line number Diff line change
1
+ # CMake file for WeAct Studio RP2040 boards
2
+
3
+ # The WeAct Studio boards don't have official pico-sdk support so we define it
4
+ # See also: https://github.com/raspberrypi/pico-sdk/tree/master/src/boards/include/boards
5
+ list (APPEND PICO_BOARD_HEADER_DIRS ${MICROPY_BOARD_DIR} )
6
+
7
+ # Freeze board.py
8
+ set (MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR} /manifest.py )
9
+
10
+ # Provide different variants for the downloads page
11
+ set (BOARD_VARIANTS "flash_2mb flash_4mb flash_8mb flash_16mb" )
12
+
13
+ # Select the 16MB variant as the default
14
+ set (PICO_BOARD "weactstudio_16mb" )
15
+
16
+ if ("${BOARD_VARIANT} " STREQUAL "flash_2mb" )
17
+ set (PICO_BOARD "weactstudio_2mb" )
18
+ endif ()
19
+
20
+ if ("${BOARD_VARIANT} " STREQUAL "flash_4mb" )
21
+ set (PICO_BOARD "weactstudio_4mb" )
22
+ endif ()
23
+
24
+ if ("${BOARD_VARIANT} " STREQUAL "flash_8mb" )
25
+ set (PICO_BOARD "weactstudio_8mb" )
26
+ endif ()
Original file line number Diff line number Diff line change
1
+ #define MICROPY_HW_BOARD_NAME "WeAct Studio RP2040"
2
+
3
+ // Allow 1MB for the firmware image itself, allocate the remainder to the filesystem
4
+ #define MICROPY_HW_FLASH_STORAGE_BYTES (PICO_FLASH_SIZE_BYTES - (1 * 1024 * 1024))
Original file line number Diff line number Diff line change
1
+ // A pico-sdk board definition is required since the WeAct Studio boards are
2
+ // not officially supported.
3
+ //
4
+ // Officially supported boards:
5
+ // https://github.com/raspberrypi/pico-sdk/tree/master/src/boards/include/boards
6
+
7
+ #ifndef _BOARDS_WEACTSTUDIO_16MB_H
8
+ #define _BOARDS_WEACTSTUDIO_16MB_H
9
+
10
+ #include "weactstudio_common.h"
11
+
12
+ #define WEACTSTUDIO_16MB
13
+
14
+ #ifndef PICO_FLASH_SIZE_BYTES
15
+ #define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
16
+ #endif
17
+
18
+ #endif
Original file line number Diff line number Diff line change
1
+ // A pico-sdk board definition is required since the WeAct Studio boards are
2
+ // not officially supported.
3
+ //
4
+ // Officially supported boards:
5
+ // https://github.com/raspberrypi/pico-sdk/tree/master/src/boards/include/boards
6
+
7
+ #ifndef _BOARDS_WEACTSTUDIO_2MB_H
8
+ #define _BOARDS_WEACTSTUDIO_2MB_H
9
+
10
+ #include "weactstudio_common.h"
11
+
12
+ #define WEACTSTUDIO_2MB
13
+
14
+ #ifndef PICO_FLASH_SIZE_BYTES
15
+ #define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
16
+ #endif
17
+
18
+ #endif
Original file line number Diff line number Diff line change
1
+ // A pico-sdk board definition is required since the WeAct Studio boards are
2
+ // not officially supported.
3
+ //
4
+ // Officially supported boards:
5
+ // https://github.com/raspberrypi/pico-sdk/tree/master/src/boards/include/boards
6
+
7
+ #ifndef _BOARDS_WEACTSTUDIO_4MB_H
8
+ #define _BOARDS_WEACTSTUDIO_4MB_H
9
+
10
+ #include "weactstudio_common.h"
11
+
12
+ #define WEACTSTUDIO_4MB
13
+
14
+ #ifndef PICO_FLASH_SIZE_BYTES
15
+ #define PICO_FLASH_SIZE_BYTES (4 * 1024 * 1024)
16
+ #endif
17
+
18
+ #endif
You can’t perform that action at this time.
0 commit comments