Skip to content

stm/boards: Add support for SparkFun STM32 MicroMod Processor board. #5060

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ jobs:
- "sparkfun_samd21_mini"
- "sparkfun_samd51_micromod"
- "sparkfun_samd51_thing_plus"
- "sparkfun_stm32f405_micromod"
- "sparkfun_thing_plus_rp2040"
- "spresense"
- "stackrduino_m0_pro"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#define MICROPY_HW_BOARD_NAME "SparkFun MicroMod SAMD51"
#define MICROPY_HW_BOARD_NAME "SparkFun MicroMod SAMD51 Processor"
#define MICROPY_HW_MCU_NAME "samd51j20"

#define CIRCUITPY_MCU_FAMILY samd51

// Status LED
#define MICROPY_HW_LED_STATUS (&pin_PA23)

// On-board flash
#define SPI_FLASH_MOSI_PIN &pin_PA09
#define SPI_FLASH_MISO_PIN &pin_PA10
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
LD_FILE = boards/samd51x20-bootloader-external-flash.ld
USB_VID = 0x1b4f
USB_PID = 0x0020 # Used by uf2 bootloader
USB_PRODUCT = "SparkFun MicroMod SAMD51"
USB_PRODUCT = "SparkFun MicroMod SAMD51 Processor"
USB_MANUFACTURER = "SparkFun Electronics"

CHIP_VARIANT = SAMD51J20A
Expand Down
311 changes: 219 additions & 92 deletions ports/atmel-samd/boards/sparkfun_samd51_micromod/pins.c

Large diffs are not rendered by default.

62 changes: 35 additions & 27 deletions ports/nrf/boards/sparkfun_nrf52840_micromod/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,56 +10,64 @@ We've also routed two I<sup>2</sup>C buses, 2 SPI buses, eleven GPIO, dedicated

CircuitPython pin definitions, while simialr to other boards represent a slight departure from just the typical `A` and `D` pin definitions. The majority of general pins are labled as `G` (or alternatively, `BUS`,) as the MicroMod system they build on uses those names to specify pins that may not be specficially analog or digital.

This can be somewhat confusing, especially around the analog pins. Here's a quick pin-map. This pin map will use the label either on the [SparkFun MicroMod ATP Carrier Board](https://www.sparkfun.com/products/16885), or the pin name on the [graphical datasheet](https://cdn.sparkfun.com/assets/learn_tutorials/1/4/0/1/MicroMod_nRF52840_v1.0_Graphical_Datasheet.pdf). Some of the aditional aliases are just names to make naming consistent (e.g.: RTS/CTS), but they also can refer to additional functionality a pin may have (e.g.: NFC pins)
This can be somewhat confusing, especially around the analog pins. Here's a quick pin-map:

MicroMod Pin # | ATP Pin Label | Pin Definition | Additional Definitons | Pin/Port Reference | Notes
:--------------|:--------------|:--------------|:-----------------------|:-------------------|:------
8 | G11 | | | (Not Connected) |
10 | D0 | D0 | | P0_27 |
11 | BOOT | BOOT | BUTTON1 | P0_07 |
12 | SDA | SDA | | P0_08 |
13 | RTS1 | RTS | RTS1 | P1_02 |
14 | SCL | SCL | | P0_11 |
15 | CTS1 | CTS | CTS1 | P1_09 |
16 | /I2C INT | I2C_INT | P0_15 |
17 | TX | TX | TX1 | P1_03 |
18 | D1 | D1 | CAM_TRIG | P1_08 |
19 | RX | RX | RX1 | P1_10 |
20 | RX2 | RX2 | | P1_05 |
22 | TX2 | TX2 | | P1_07 |
32 | PWM0 | PWM0 | P0_06 |
34 | A0 | A0 | ADC0 | P0_04 | Attached to AIN2
38 | A1 | A1 | ADC1 | P0_05 | Attached to AIN3
11 | BOOT | BOOT | | P0_07 |
12 | SDA | I2C_SDA | SDA | P0_08 |
13 | RTS1 | UART_RTS1 | | P1_02 |
14 | SCL | I2C_SCL | SCL | P0_11 |
15 | CTS1 | UART_CTS1 | | P1_09 |
16 | /I2C INT | I2C_INT | |P0_15|
17 | TX | UART_TX1 | TX | P1_03 |
18 | D1 | D1 | | P1_08 |
19 | RX | UART_RX1 | RX | P1_10 |
20 | RX2 | UART_RX2 | | P1_05 |
22 | TX2 | UART_TX2 | | P1_07 |
32 | PWM0 | PWM0 | |P0_06|
34 | A0 | A0 | | P0_04 | Attached to AIN2
38 | A1 | A1 | | P0_05 | Attached to AIN3
40 | G0 | G0 | BUS0 | P0_29 | Attached to AIN5
42 | G1 | G1 | BUS1 | P0_03 | Attached to AIN1
44 | G2 | G2 | BUS2 | P1_13 |
46 | G3 | G3 | BUS3 | P1_12 |
47 | PWM1 | PWM1 | P0_16 |
47 | PWM1 | PWM1 | |P0_16|
48 | G4 | G4 | BUS4 | P1_11 |
49 | BATT_VIN | BATT_VIN3 | | P0_30 | Attached to AIN6, will be battery voltage / 3. |
49 | BATT_VIN | BATT_VIN3 | | P0_30 | Attached to AIN6, will be battery voltage / 3.
50 | PDM_CLK | PDM_CLK | | P0_25 |
51 | SDA1 | SDA1 | | P1_01 |
51 | SDA1 | I2C_SDA1 | | P1_01 |
52 | PDM_DATA | PDM_DATA | | P0_26 |
53 | SCL1 | SCL1 | | P0_24 |
55 | /CS | CS | | P0_20 |
57 | SCK | SCK | | P0_28 | Attached to AIN4
59 | COPI | COPI | MOSI | P0_31 | Attached to AIN7
61 | CIPO | CIPO | MISO | P0_02 |
63 | G10 | G10 | NFC2, ADC_DP, CAM_VSYNC | P0_10 | Attached to NFC2
65 | G9 | G9 | NFC1, ADC_DM, CAM_HSYNC | P0_09 | Attached to NFC1
53 | SCL1 | I2C_SCL1 | | P0_24 |
55 | /CS | SPI_CS | | P0_20 |
57 | SCK | SPI_SCK | LED_CLK | P0_28 | Attached to AIN4
59 | COPI | SPI_COPI | SPI_MOSI, LED_DAT | P0_31 | Attached to AIN7
60 | SCK1 | SDIO_SCK | SPI_SCK1 | |
61 | CIPO | SPI_CIPO | SPI_MISO | P0_02 |
62 | COPI1 | SDIO_CMD | SPI_COPI1 | |
63 | G10 | G10 | | P0_10 | Attached to NFC2
64 | CIPO1 | SDIO_DATA0 | SPI_CIPO1 | |
65 | G9 | G9 | | P0_09 | Attached to NFC1
66 | DAT1 | SDIO_DATA1 | | |
67 | G8 | G8 | | P1_14 |
68 | DAT2 | SDIO_DATA2 | | |
69 | G7 | G7 | BUS7 | P1_04 |
70 | CS1 | SDIO_DATA3 | SPI_CS1 | |
71 | G6 | G6 | BUS6 | P1_06 |
73 | G5 | G5 | BUS5 | P0_15 |

## Peripheral Naming

CircuitPython attempts to stay in line with the naming of the serial peripheral naming in the MicroMod system. The bare UART pins are also named <pin>1. The UART 2 pins are named <pin>2. However, the I2C names on MicroMod are <I2C pin> and <I2C pin>1. Perhaps this will change in the future, but as of [Interface v1](https://cdn.sparkfun.com/assets/learn_tutorials/1/2/0/6/SparkFun_MicroMod_Interface_v1.0_-_Pin_Descriptions.pdf), it may lead to some confusion.
The SparkFun MicroMod spec uses a zero-based peripheral numbering scheme. The 0th peripheral is the default and the "0" is omitted from the peripheral name. For example, the first I2C peripheral is named `I2C` (instead of `I2C0`) and the second I2C peripheral is named `I2C1`. Note: MicroMod `UART` is not present in the edge connector pinout because the primary debug serial port (i.e.`UART0`) is exposed as a virtual serial port over USB. As a result, the first UART peripheral in the edge connector pinout is `UART1` and the second UART peripheral is `UART2`.

For more details, see https://www.sparkfun.com/micromod#tech-specs.


## Bootloader Notes

The MicroMod nRF52840 Processor needs to have the [Adafruit nRF52 UF2 bootloader](https://github.com/adafruit/Adafruit_nRF52_Bootloader/pull/194) flashed on it. [[TODO: LINK TO BUILD]]
The MicroMod nRF52840 Processor needs to have the [Adafruit nRF52 UF2 bootloader](https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases/latest) flashed on it.

## Hardware Reference

Expand Down
5 changes: 4 additions & 1 deletion ports/nrf/boards/sparkfun_nrf52840_micromod/mpconfigboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@

#include "nrfx/hal/nrf_gpio.h"

#define MICROPY_HW_BOARD_NAME "SparkFun MicroMod nRF52840"
#define MICROPY_HW_BOARD_NAME "SparkFun MicroMod nRF52840 Processor"
#define MICROPY_HW_MCU_NAME "nRF52840"

// Status LED
#define MICROPY_HW_LED_STATUS (&pin_P0_13)

#define DEFAULT_I2C_BUS_SCL (&pin_P0_11)
#define DEFAULT_I2C_BUS_SDA (&pin_P0_08)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
USB_VID = 0x1B4F
USB_PID = 0x0021
USB_PRODUCT = "SFE_nRF52840_MicroMod"
USB_PRODUCT = "SparkFun MicroMod nRF52840 Processor"
USB_MANUFACTURER = "SparkFun Electronics"

MCU_CHIP = nrf52840
Expand Down
Loading