stm32/boards/NUCLEO_WL55: Add new board definition.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2021-02-22 11:55:34 +11:00
parent e0a0719416
commit e306f2285b
5 changed files with 155 additions and 0 deletions

View File

@ -0,0 +1,15 @@
{
"deploy": [
"../deploy.md"
],
"docs": "",
"features": [],
"images": [
"nucleo_wl55.jpg"
],
"mcu": "stm32wl",
"product": "Nucleo WL55",
"thumbnail": "",
"url": "",
"vendor": "ST Microelectronics"
}

View File

@ -0,0 +1,63 @@
/* This file is part of the MicroPython project, https://micropython.org/
* MIT License; Copyright (c) 2021 Damien P. George
*/
#define MICROPY_HW_BOARD_NAME "NUCLEO-WL55"
#define MICROPY_HW_MCU_NAME "STM32WL55JCI7"
#define MICROPY_EMIT_THUMB (0)
#define MICROPY_EMIT_INLINE_THUMB (0)
#define MICROPY_PY_BUILTINS_COMPLEX (0)
#define MICROPY_PY_GENERATOR_PEND_THROW (0)
#define MICROPY_PY_MATH (0)
#define MICROPY_PY_FRAMEBUF (0)
#define MICROPY_PY_USOCKET (0)
#define MICROPY_PY_NETWORK (0)
#define MICROPY_PY_ONEWIRE (0)
#define MICROPY_PY_STM (0)
#define MICROPY_PY_PYB_LEGACY (0)
#define MICROPY_PY_UHEAPQ (0)
#define MICROPY_PY_UTIMEQ (0)
#define MICROPY_HW_HAS_FLASH (1)
#define MICROPY_HW_ENABLE_RTC (1)
#define MICROPY_HW_ENABLE_RNG (1)
#define MICROPY_HW_ENABLE_ADC (0) // use machine.ADC instead
#define MICROPY_HW_HAS_SWITCH (1)
// There is an external 32kHz oscillator
#define MICROPY_HW_RTC_USE_LSE (1)
#define MICROPY_HW_RTC_USE_US (1)
// UART buses
#define MICROPY_HW_UART1_TX (pin_B6) // Arduino D1, pin 7 on CN9
#define MICROPY_HW_UART1_RX (pin_B7) // Arduino D0, pin 8 on CN9
#define MICROPY_HW_LPUART1_TX (pin_A2) // ST-link
#define MICROPY_HW_LPUART1_RX (pin_A3) // ST-link
#define MICROPY_HW_UART_REPL PYB_LPUART_1
#define MICROPY_HW_UART_REPL_BAUD 115200
// I2C buses
#define MICROPY_HW_I2C1_SCL (pin_A12) // Arduino D15, pin 10 on CN5
#define MICROPY_HW_I2C1_SDA (pin_A11) // Arduino D14, pin 9 on CN5
#define MICROPY_HW_I2C3_SCL (pin_B13) // Arduino A5, pin 6 on CN8
#define MICROPY_HW_I2C3_SDA (pin_B14) // Arduino A4, pin 5 on CN8
// SPI buses
#define MICROPY_HW_SPI1_NSS (pin_A4) // Arduino D10 pin 3 on CN5
#define MICROPY_HW_SPI1_SCK (pin_A5) // Arduino D13, pin 6 on CN5
#define MICROPY_HW_SPI1_MISO (pin_A6) // Arduino D12, pin 5 on CN5
#define MICROPY_HW_SPI1_MOSI (pin_A7) // Arduino D11, pin 4 on CN5
// User switch; pressing the button makes the input go low
#define MICROPY_HW_USRSW_PIN (pin_A0)
#define MICROPY_HW_USRSW_PULL (GPIO_PULLUP)
#define MICROPY_HW_USRSW_EXTI_MODE (GPIO_MODE_IT_FALLING)
#define MICROPY_HW_USRSW_PRESSED (0)
// LEDs
#define MICROPY_HW_LED1 (pin_B15) // blue
#define MICROPY_HW_LED2 (pin_B9) // green
#define MICROPY_HW_LED3 (pin_B11) // red
#define MICROPY_HW_LED_ON(pin) (mp_hal_pin_high(pin))
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))

View File

@ -0,0 +1,13 @@
MCU_SERIES = wl
CMSIS_MCU = STM32WL55xx
AF_FILE = boards/stm32wl55_af.csv
STARTUP_FILE = $(STM32LIB_CMSIS_BASE)/Source/Templates/gcc/startup_stm32wl55xx_cm4.o
LD_FILES = boards/stm32wl55xc.ld boards/common_basic.ld
TEXT0_ADDR = 0x08000000
# MicroPython settings
MICROPY_VFS_FAT = 0
MICROPY_VFS_LFS2 = 1
# Don't include default frozen modules because MCU is tight on flash space
FROZEN_MANIFEST ?=

View File

@ -0,0 +1,46 @@
,PA0
,PA1
,PA2
,PA3
,PA4
,PA5
,PA6
,PA7
,PA8
,PA9
,PA10
,PA11
,PA12
,PA13
,PA14
,PA15
,PB0
,PB1
,PB2
,PB3
,PB4
,PB5
,PB6
,PB7
,PB8
,PB9
,PB10
,PB11
,PB12
,PB13
,PB14
,PB15
,PC0
,PC1
,PC2
,PC3
,PC4
,PC5
,PC6
SW,PA0
SW1,PA0
SW2,PA1
SW3,PC6
LED_GREEN,PB9
LED_RED,PB11
LED_BLUE,PB15
1 PA0
2 PA1
3 PA2
4 PA3
5 PA4
6 PA5
7 PA6
8 PA7
9 PA8
10 PA9
11 PA10
12 PA11
13 PA12
14 PA13
15 PA14
16 PA15
17 PB0
18 PB1
19 PB2
20 PB3
21 PB4
22 PB5
23 PB6
24 PB7
25 PB8
26 PB9
27 PB10
28 PB11
29 PB12
30 PB13
31 PB14
32 PB15
33 PC0
34 PC1
35 PC2
36 PC3
37 PC4
38 PC5
39 PC6
40 SW PA0
41 SW1 PA0
42 SW2 PA1
43 SW3 PC6
44 LED_GREEN PB9
45 LED_RED PB11
46 LED_BLUE PB15

View File

@ -0,0 +1,18 @@
/* This file is part of the MicroPython project, https://micropython.org/
* The MIT License (MIT)
* Copyright (c) 2021 Damien P. George
*/
#ifndef MICROPY_INCLUDED_STM32WLXX_HAL_CONF_H
#define MICROPY_INCLUDED_STM32WLXX_HAL_CONF_H
// Oscillator values in Hz
#define HSE_VALUE (32000000)
#define LSE_VALUE (32768)
// Oscillator timeouts in ms
#define HSE_STARTUP_TIMEOUT (100)
#define LSE_STARTUP_TIMEOUT (5000)
#include "boards/stm32wlxx_hal_conf_base.h"
#endif // MICROPY_INCLUDED_STM32WLXX_HAL_CONF_H