Skip to content

Commit 0632a1e

Browse files
authored
Merge pull request adafruit#5060 from cdwilson/cdwilson/circuitpython/sparkfun-stm32f405-micromod
stm/boards: Add support for SparkFun STM32 MicroMod Processor board.
2 parents ebf0901 + c0902da commit 0632a1e

File tree

15 files changed

+1055
-337
lines changed

15 files changed

+1055
-337
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ jobs:
370370
- "sparkfun_samd21_mini"
371371
- "sparkfun_samd51_micromod"
372372
- "sparkfun_samd51_thing_plus"
373+
- "sparkfun_stm32f405_micromod"
373374
- "sparkfun_thing_plus_rp2040"
374375
- "spresense"
375376
- "stackrduino_m0_pro"

ports/atmel-samd/boards/sparkfun_samd51_micromod/mpconfigboard.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
#define MICROPY_HW_BOARD_NAME "SparkFun MicroMod SAMD51"
1+
#define MICROPY_HW_BOARD_NAME "SparkFun MicroMod SAMD51 Processor"
22
#define MICROPY_HW_MCU_NAME "samd51j20"
33

44
#define CIRCUITPY_MCU_FAMILY samd51
55

6+
// Status LED
7+
#define MICROPY_HW_LED_STATUS (&pin_PA23)
8+
69
// On-board flash
710
#define SPI_FLASH_MOSI_PIN &pin_PA09
811
#define SPI_FLASH_MISO_PIN &pin_PA10

ports/atmel-samd/boards/sparkfun_samd51_micromod/mpconfigboard.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
LD_FILE = boards/samd51x20-bootloader-external-flash.ld
22
USB_VID = 0x1b4f
33
USB_PID = 0x0020 # Used by uf2 bootloader
4-
USB_PRODUCT = "SparkFun MicroMod SAMD51"
4+
USB_PRODUCT = "SparkFun MicroMod SAMD51 Processor"
55
USB_MANUFACTURER = "SparkFun Electronics"
66

77
CHIP_VARIANT = SAMD51J20A

ports/atmel-samd/boards/sparkfun_samd51_micromod/pins.c

Lines changed: 219 additions & 92 deletions
Large diffs are not rendered by default.

ports/nrf/boards/sparkfun_nrf52840_micromod/README.md

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,56 +10,64 @@ We've also routed two I<sup>2</sup>C buses, 2 SPI buses, eleven GPIO, dedicated
1010

1111
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.
1212

13-
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)
13+
This can be somewhat confusing, especially around the analog pins. Here's a quick pin-map:
1414

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

5561
## Peripheral Naming
5662

57-
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.
63+
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`.
64+
65+
For more details, see https://www.sparkfun.com/micromod#tech-specs.
5866

5967

6068
## Bootloader Notes
6169

62-
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]]
70+
The MicroMod nRF52840 Processor needs to have the [Adafruit nRF52 UF2 bootloader](https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases/latest) flashed on it.
6371

6472
## Hardware Reference
6573

ports/nrf/boards/sparkfun_nrf52840_micromod/mpconfigboard.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,12 @@
2727

2828
#include "nrfx/hal/nrf_gpio.h"
2929

30-
#define MICROPY_HW_BOARD_NAME "SparkFun MicroMod nRF52840"
30+
#define MICROPY_HW_BOARD_NAME "SparkFun MicroMod nRF52840 Processor"
3131
#define MICROPY_HW_MCU_NAME "nRF52840"
3232

33+
// Status LED
34+
#define MICROPY_HW_LED_STATUS (&pin_P0_13)
35+
3336
#define DEFAULT_I2C_BUS_SCL (&pin_P0_11)
3437
#define DEFAULT_I2C_BUS_SDA (&pin_P0_08)
3538

ports/nrf/boards/sparkfun_nrf52840_micromod/mpconfigboard.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
USB_VID = 0x1B4F
22
USB_PID = 0x0021
3-
USB_PRODUCT = "SFE_nRF52840_MicroMod"
3+
USB_PRODUCT = "SparkFun MicroMod nRF52840 Processor"
44
USB_MANUFACTURER = "SparkFun Electronics"
55

66
MCU_CHIP = nrf52840

0 commit comments

Comments
 (0)