stm32/boards/NUCLEO_L073RZ: Add definition files for new board.

This commit is contained in:
Damien George 2019-07-05 17:28:54 +10:00
parent 6053e450b8
commit 7c2e83324b
4 changed files with 165 additions and 0 deletions

View File

@ -0,0 +1,53 @@
/* This file is part of the MicroPython project, http://micropython.org/
* MIT License; Copyright (c) 2019 Damien P. George
*/
#define MICROPY_HW_BOARD_NAME "NUCLEO-L073RZ"
#define MICROPY_HW_MCU_NAME "STM32F073RZT6"
#define MICROPY_EMIT_THUMB (0)
#define MICROPY_EMIT_INLINE_THUMB (0)
#define MICROPY_PY_BUILTINS_COMPLEX (0)
#define MICROPY_PY_MATH (0)
#define MICROPY_PY_FRAMEBUF (0)
#define MICROPY_PY_USOCKET (0)
#define MICROPY_PY_NETWORK (0)
#define MICROPY_PY_STM (0)
#define MICROPY_PY_PYB_LEGACY (0)
#define MICROPY_VFS_FAT (0)
#define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (0)
#define MICROPY_HW_ENABLE_RTC (1)
#define MICROPY_HW_ENABLE_ADC (0)
#define MICROPY_HW_HAS_SWITCH (1)
// UART config
#define MICROPY_HW_UART1_TX (pin_B6)
#define MICROPY_HW_UART1_RX (pin_B7)
#define MICROPY_HW_UART2_TX (pin_A2)
#define MICROPY_HW_UART2_RX (pin_A3)
// USART2 is connected to the ST-LINK USB VCP
#define MICROPY_HW_UART_REPL PYB_UART_2
#define MICROPY_HW_UART_REPL_BAUD 115200
// I2C busses
#define MICROPY_HW_I2C1_SCL (pin_B8) // Arduino D15, pin 3 on CN10
#define MICROPY_HW_I2C1_SDA (pin_B9) // Arduino D14, pin 5 on CN10
// SPI busses
#define MICROPY_HW_SPI1_NSS (pin_A15) // pin 17 on CN7
#define MICROPY_HW_SPI1_SCK (pin_A5) // Arduino D13, pin 11 on CN10
#define MICROPY_HW_SPI1_MISO (pin_A6) // Arduino D12, pin 13 on CN10
#define MICROPY_HW_SPI1_MOSI (pin_A7) // Arduino D11, pin 15 on CN10
// USER B1 has a pull-up and is active low
#define MICROPY_HW_USRSW_PIN (pin_C13)
#define MICROPY_HW_USRSW_PULL (0)
#define MICROPY_HW_USRSW_EXTI_MODE (GPIO_MODE_IT_FALLING)
#define MICROPY_HW_USRSW_PRESSED (0)
// NUCLEO-64 has one user LED
#define MICROPY_HW_LED1 (pin_A5) // green
#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,7 @@
MCU_SERIES = l0
CMSIS_MCU = STM32L073xx
AF_FILE = boards/stm32l072_af.csv
LD_FILES = boards/stm32l072xz.ld boards/common_basic.ld
# Don't include default frozen modules because MCU is tight on flash space
FROZEN_MPY_DIR ?=

View File

@ -0,0 +1,87 @@
D0,PA3
D1,PA2
D2,PA10
D3,PB3
D4,PB5
D5,PB4
D6,PB10
D7,PA8
D8,PA9
D9,PC7
D10,PB6
D11,PA7
D12,PA6
D13,PA5
D14,PB9
D15,PB8
A0,PA0
A1,PA1
A2,PA4
A3,PB0
A4,PC1
A5,PC0
RX,PA3
TX,PA2
SCL,PB8
SDA,PB9
SCK,PA5
MISO,PA6
MOSI,PA7
CS,PB6
BOOT0,PF11
SWDIO,PA13
SWCLK,PA14
USER_B1,PC13
LED_GREEN,PA5
PA0,PA0
PA1,PA1
PA2,PA2
PA3,PA3
PA4,PA4
PA5,PA5
PA6,PA6
PA7,PA7
PA8,PA8
PA9,PA9
PA10,PA10
PA11,PA11
PA12,PA12
PA13,PA13
PA14,PA14
PA15,PA15
PB0,PB0
PB1,PB1
PB2,PB2
PB3,PB3
PB4,PB4
PB5,PB5
PB6,PB6
PB7,PB7
PB8,PB8
PB9,PB9
PB10,PB10
PB11,PB11
PB12,PB12
PB13,PB13
PB14,PB14
PB15,PB15
PC0,PC0
PC1,PC1
PC2,PC2
PC3,PC3
PC4,PC4
PC5,PC5
PC6,PC6
PC7,PC7
PC8,PC8
PC9,PC9
PC10,PC10
PC11,PC11
PC12,PC12
PC13,PC13
PC14,PC14
PC15,PC15
PD2,PD2
PF0,PF0
PF1,PF1
PF11,PF11
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

View File

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