Skip to content

Commit c2f8056

Browse files
committed
stm/boards: Add support for SparkFun STM32 MicroMod Processor board.
Signed-off-by: Chris Wilson <[email protected]>
1 parent 00b617c commit c2f8056

File tree

14 files changed

+1017
-310
lines changed

14 files changed

+1017
-310
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ jobs:
369369
- "sparkfun_samd21_mini"
370370
- "sparkfun_samd51_micromod"
371371
- "sparkfun_samd51_thing_plus"
372+
- "sparkfun_stm32f405_micromod"
372373
- "sparkfun_thing_plus_rp2040"
373374
- "spresense"
374375
- "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/mpconfigboard.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
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

3333
#define DEFAULT_I2C_BUS_SCL (&pin_P0_11)

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

ports/nrf/boards/sparkfun_nrf52840_micromod/pins.c

Lines changed: 216 additions & 108 deletions
Large diffs are not rendered by default.
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
#define MICROPY_HW_BOARD_NAME "SparkFun MicroMod ATP - RP2040"
1+
#define MICROPY_HW_BOARD_NAME "SparkFun MicroMod RP2040 Processor"
22
#define MICROPY_HW_MCU_NAME "rp2040"
33

4+
// Status LED
5+
#define MICROPY_HW_LED_STATUS (&pin_GPIO25)
6+
47
#define DEFAULT_I2C_BUS_SCL (&pin_GPIO5)
58
#define DEFAULT_I2C_BUS_SDA (&pin_GPIO4)
69

7-
#define DEFAULT_SPI_BUS_SCK (&pin_GPIO14)
8-
#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO15)
9-
#define DEFAULT_SPI_BUS_MISO (&pin_GPIO12)
10+
#define DEFAULT_SPI_BUS_SCK (&pin_GPIO22)
11+
#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO23)
12+
#define DEFAULT_SPI_BUS_MISO (&pin_GPIO20)
1013

1114
#define DEFAULT_UART_BUS_RX (&pin_GPIO1)
1215
#define DEFAULT_UART_BUS_TX (&pin_GPIO0)

ports/raspberrypi/boards/sparkfun_micromod_rp2040/mpconfigboard.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
USB_VID = 0x1B4F
22
USB_PID = 0x0024
3-
USB_PRODUCT = "MicroMod RP2040"
4-
USB_MANUFACTURER = "SparkFun"
3+
USB_PRODUCT = "SparkFun MicroMod RP2040 Processor"
4+
USB_MANUFACTURER = "SparkFun Electronics"
55

66
CHIP_VARIANT = RP2040
77
CHIP_FAMILY = rp2

ports/raspberrypi/boards/sparkfun_micromod_rp2040/pins.c

Lines changed: 218 additions & 100 deletions
Large diffs are not rendered by default.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
#include "supervisor/board.h"
28+
#include "mpconfigboard.h"
29+
30+
void board_init(void) {
31+
}
32+
33+
bool board_requests_safe_mode(void) {
34+
return false;
35+
}
36+
37+
void reset_board(void) {
38+
39+
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2021 Chris Wilson
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
// Micropython setup
28+
29+
#define MICROPY_HW_BOARD_NAME "SparkFun STM32 MicroMod Processor"
30+
#define MICROPY_HW_MCU_NAME "STM32F405RG"
31+
32+
#define FLASH_SIZE (0x100000)
33+
#define FLASH_PAGE_SIZE (0x4000)
34+
35+
#define HSE_VALUE ((uint32_t)12000000)
36+
#define LSE_VALUE ((uint32_t)32768)
37+
#define BOARD_HAS_LOW_SPEED_CRYSTAL (1)
38+
39+
// Status LED
40+
#define MICROPY_HW_LED_STATUS (&pin_PA15)
41+
42+
// On-board SPI flash
43+
#define SPI_FLASH_MOSI_PIN (&pin_PC12)
44+
#define SPI_FLASH_MISO_PIN (&pin_PC11)
45+
#define SPI_FLASH_SCK_PIN (&pin_PC10)
46+
#define SPI_FLASH_CS_PIN (&pin_PC03)
47+
48+
// Bootloader only
49+
#ifdef UF2_BOOTLOADER_ENABLED
50+
#define BOARD_VTOR_DEFER (1) // Leave VTOR relocation to bootloader
51+
#endif
52+
53+
#define DEFAULT_I2C_BUS_SCL (&pin_PB10)
54+
#define DEFAULT_I2C_BUS_SDA (&pin_PB11)
55+
56+
#define DEFAULT_SPI_BUS_SCK (&pin_PA05)
57+
#define DEFAULT_SPI_BUS_MOSI (&pin_PA07)
58+
#define DEFAULT_SPI_BUS_MISO (&pin_PA06)
59+
60+
#define DEFAULT_UART_BUS_RX (&pin_PA03)
61+
#define DEFAULT_UART_BUS_TX (&pin_PA02)
62+
63+
// USB is always used internally so skip the pin objects for it.
64+
#define IGNORE_PIN_PA11 (1)
65+
#define IGNORE_PIN_PA12 (1)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
USB_VID = 0X1B4F
2+
USB_PID = 0x0027
3+
USB_PRODUCT = "SparkFun STM32 MicroMod Processor"
4+
USB_MANUFACTURER = "SparkFun Electronics"
5+
6+
SPI_FLASH_FILESYSTEM = 1
7+
EXTERNAL_FLASH_DEVICES = W25Q128JVxM
8+
9+
MCU_SERIES = F4
10+
MCU_VARIANT = STM32F405xx
11+
MCU_PACKAGE = LQFP64
12+
13+
LD_COMMON = boards/common_default.ld
14+
LD_DEFAULT = boards/STM32F405_default.ld
15+
# UF2 boot option
16+
LD_BOOT = boards/STM32F405_boot.ld
17+
UF2_OFFSET = 0x8010000
18+
19+
CIRCUITPY_RGBMATRIX ?= 1

0 commit comments

Comments
 (0)