Skip to content

Commit 7c2e833

Browse files
committed
stm32/boards/NUCLEO_L073RZ: Add definition files for new board.
1 parent 6053e45 commit 7c2e833

File tree

4 files changed

+165
-0
lines changed

4 files changed

+165
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/* This file is part of the MicroPython project, http://micropython.org/
2+
* MIT License; Copyright (c) 2019 Damien P. George
3+
*/
4+
5+
#define MICROPY_HW_BOARD_NAME "NUCLEO-L073RZ"
6+
#define MICROPY_HW_MCU_NAME "STM32F073RZT6"
7+
8+
#define MICROPY_EMIT_THUMB (0)
9+
#define MICROPY_EMIT_INLINE_THUMB (0)
10+
#define MICROPY_PY_BUILTINS_COMPLEX (0)
11+
#define MICROPY_PY_MATH (0)
12+
#define MICROPY_PY_FRAMEBUF (0)
13+
#define MICROPY_PY_USOCKET (0)
14+
#define MICROPY_PY_NETWORK (0)
15+
#define MICROPY_PY_STM (0)
16+
#define MICROPY_PY_PYB_LEGACY (0)
17+
#define MICROPY_VFS_FAT (0)
18+
19+
#define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (0)
20+
#define MICROPY_HW_ENABLE_RTC (1)
21+
#define MICROPY_HW_ENABLE_ADC (0)
22+
#define MICROPY_HW_HAS_SWITCH (1)
23+
24+
// UART config
25+
#define MICROPY_HW_UART1_TX (pin_B6)
26+
#define MICROPY_HW_UART1_RX (pin_B7)
27+
#define MICROPY_HW_UART2_TX (pin_A2)
28+
#define MICROPY_HW_UART2_RX (pin_A3)
29+
30+
// USART2 is connected to the ST-LINK USB VCP
31+
#define MICROPY_HW_UART_REPL PYB_UART_2
32+
#define MICROPY_HW_UART_REPL_BAUD 115200
33+
34+
// I2C busses
35+
#define MICROPY_HW_I2C1_SCL (pin_B8) // Arduino D15, pin 3 on CN10
36+
#define MICROPY_HW_I2C1_SDA (pin_B9) // Arduino D14, pin 5 on CN10
37+
38+
// SPI busses
39+
#define MICROPY_HW_SPI1_NSS (pin_A15) // pin 17 on CN7
40+
#define MICROPY_HW_SPI1_SCK (pin_A5) // Arduino D13, pin 11 on CN10
41+
#define MICROPY_HW_SPI1_MISO (pin_A6) // Arduino D12, pin 13 on CN10
42+
#define MICROPY_HW_SPI1_MOSI (pin_A7) // Arduino D11, pin 15 on CN10
43+
44+
// USER B1 has a pull-up and is active low
45+
#define MICROPY_HW_USRSW_PIN (pin_C13)
46+
#define MICROPY_HW_USRSW_PULL (0)
47+
#define MICROPY_HW_USRSW_EXTI_MODE (GPIO_MODE_IT_FALLING)
48+
#define MICROPY_HW_USRSW_PRESSED (0)
49+
50+
// NUCLEO-64 has one user LED
51+
#define MICROPY_HW_LED1 (pin_A5) // green
52+
#define MICROPY_HW_LED_ON(pin) (mp_hal_pin_high(pin))
53+
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
MCU_SERIES = l0
2+
CMSIS_MCU = STM32L073xx
3+
AF_FILE = boards/stm32l072_af.csv
4+
LD_FILES = boards/stm32l072xz.ld boards/common_basic.ld
5+
6+
# Don't include default frozen modules because MCU is tight on flash space
7+
FROZEN_MPY_DIR ?=
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
D0,PA3
2+
D1,PA2
3+
D2,PA10
4+
D3,PB3
5+
D4,PB5
6+
D5,PB4
7+
D6,PB10
8+
D7,PA8
9+
D8,PA9
10+
D9,PC7
11+
D10,PB6
12+
D11,PA7
13+
D12,PA6
14+
D13,PA5
15+
D14,PB9
16+
D15,PB8
17+
A0,PA0
18+
A1,PA1
19+
A2,PA4
20+
A3,PB0
21+
A4,PC1
22+
A5,PC0
23+
RX,PA3
24+
TX,PA2
25+
SCL,PB8
26+
SDA,PB9
27+
SCK,PA5
28+
MISO,PA6
29+
MOSI,PA7
30+
CS,PB6
31+
BOOT0,PF11
32+
SWDIO,PA13
33+
SWCLK,PA14
34+
USER_B1,PC13
35+
LED_GREEN,PA5
36+
PA0,PA0
37+
PA1,PA1
38+
PA2,PA2
39+
PA3,PA3
40+
PA4,PA4
41+
PA5,PA5
42+
PA6,PA6
43+
PA7,PA7
44+
PA8,PA8
45+
PA9,PA9
46+
PA10,PA10
47+
PA11,PA11
48+
PA12,PA12
49+
PA13,PA13
50+
PA14,PA14
51+
PA15,PA15
52+
PB0,PB0
53+
PB1,PB1
54+
PB2,PB2
55+
PB3,PB3
56+
PB4,PB4
57+
PB5,PB5
58+
PB6,PB6
59+
PB7,PB7
60+
PB8,PB8
61+
PB9,PB9
62+
PB10,PB10
63+
PB11,PB11
64+
PB12,PB12
65+
PB13,PB13
66+
PB14,PB14
67+
PB15,PB15
68+
PC0,PC0
69+
PC1,PC1
70+
PC2,PC2
71+
PC3,PC3
72+
PC4,PC4
73+
PC5,PC5
74+
PC6,PC6
75+
PC7,PC7
76+
PC8,PC8
77+
PC9,PC9
78+
PC10,PC10
79+
PC11,PC11
80+
PC12,PC12
81+
PC13,PC13
82+
PC14,PC14
83+
PC15,PC15
84+
PD2,PD2
85+
PF0,PF0
86+
PF1,PF1
87+
PF11,PF11
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/* This file is part of the MicroPython project, http://micropython.org/
2+
* The MIT License (MIT)
3+
* Copyright (c) 2019 Damien P. George
4+
*/
5+
#ifndef MICROPY_INCLUDED_STM32L0XX_HAL_CONF_H
6+
#define MICROPY_INCLUDED_STM32L0XX_HAL_CONF_H
7+
8+
#include "boards/stm32l0xx_hal_conf_base.h"
9+
10+
// Oscillator values in Hz
11+
#define HSE_VALUE (8000000)
12+
#define LSE_VALUE (32768)
13+
14+
// Oscillator timeouts in ms
15+
#define HSE_STARTUP_TIMEOUT (100)
16+
#define LSE_STARTUP_TIMEOUT (5000)
17+
18+
#endif // MICROPY_INCLUDED_STM32L0XX_HAL_CONF_H

0 commit comments

Comments
 (0)