8000 stm32/boards: Add new board B_L475E_IOT01A based on STM32L475. · devmonkZA/micropython@bd71b32 · GitHub
[go: up one dir, main page]

Skip to content

Commit bd71b32

Browse files
tobbaddpgeorge
authored andcommitted
stm32/boards: Add new board B_L475E_IOT01A based on STM32L475.
1 parent e6fbee0 commit bd71b32

File tree

6 files changed

+542
-3
lines changed

6 files changed

+542
-3
lines changed

ports/stm32/adc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
defined(STM32F746xx) || defined(STM32F767xx) || \
9696
defined(STM32F769xx) || defined(STM32F446xx)
9797
#define VBAT_DIV (4)
98-
#elif defined(STM32L476xx)
98+
#elif defined(STM32L475xx) || defined(STM32L476xx)
9999
#define VBAT_DIV (3)
100100
#else
101101
#error Unsupported processor
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#define MICROPY_HW_BOARD_NAME "B-L475E-IOT01A"
2+
#define MICROPY_HW_MCU_NAME "STM32L475"
3+
4+
#define MICROPY_HW_HAS_SWITCH (1)
5+
#define MICROPY_HW_HAS_FLASH (0)
6+
#define MICROPY_HW_HAS_SDCARD (0)
7+
#define MICROPY_HW_HAS_MMA7660 (0)
8+
#define MICROPY_HW_HAS_LIS3DSH (0)
9+
#define MICROPY_HW_HAS_LCD (0)
10+
#define MICROPY_HW_ENABLE_RNG (1)
11+
#define MICROPY_HW_ENABLE_RTC (1)
12+
#define MICROPY_HW_ENABLE_TIMER (1)
13+
#define MICROPY_HW_ENABLE_SERVO (0)
14+
#define MICROPY_HW_ENABLE_DAC (0)
15+
#define MICROPY_HW_ENABLE_CAN (0)
16+
17+
// MSI is used and is 4MHz
18+
#define MICROPY_HW_CLK_PLLM (1)
19+
#define MICROPY_HW_CLK_PLLN (40)
20+
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV7)
21+
#define MICROPY_HW_CLK_PLLR (RCC_PLLR_DIV2)
22+
#define MICROPY_HW_CLK_PLLQ (RCC_PLLQ_DIV4)
23+
24+
#define MICROPY_HW_FLASH_LATENCY FLASH_LATENCY_4
25+
26+
// USART1 config connected to ST-Link
27+
#define MICROPY_HW_UART1_TX (pin_B6)
28+
#define MICROPY_HW_UART1_RX (pin_B7)
29+
// USART2 config connected to PMOD: Flow control is defined and therfore used
30+
#define MICROPY_HW_UART2_CTS (pin_D3)
31+
#define MICROPY_HW_UART2_RTS (pin_D4)
32+
#define MICROPY_HW_UART2_TX (pin_D5)
33+
#define MICROPY_HW_UART2_RX (pin_D6)
34+
// USART3 config for internal use
35+
#define MICROPY_HW_UART3_TX (pin_D8)
36+
#define MICROPY_HW_UART3_RX (pin_D9)
37+
// USART4 config
38+
#define MICROPY_HW_UART4_TX (pin_A0)
39+
#define MICROPY_HW_UART4_RX (pin_A1)
40+
// USART 1 is connected to the virtual com port on the ST-LINK
41+
#define MICROPY_HW_UART_REPL PYB_UART_1
42+
#define MICROPY_HW_UART_REPL_BAUD 115200
43+
44+
// I2C busses
45+
#define MICROPY_HW_I2C1_SCL (pin_B8)
46+
#define MICROPY_HW_I2C1_SDA (pin_B9)
47+
#define MICROPY_HW_I2C2_SCL (pin_B10)
48+
#define MICROPY_HW_I2C2_SDA (pin_B11)
49+
50+
// SPI busses
51+
#define MICROPY_HW_SPI1_NSS (pin_A4)
52+
#define MICROPY_HW_SPI1_SCK (pin_A5)
53+
#define MICROPY_HW_SPI1_MISO (pin_A6)
54+
#define MICROPY_HW_SPI1_MOSI (pin_A7)
55+
56+
#define MICROPY_HW_SPI2_NSS (pin_D0)
57+
#define MICROPY_HW_SPI2_SCK (pin_D1)
58+
#define MICROPY_HW_SPI2_MISO (pin_D3)
59+
#define MICROPY_HW_SPI2_MOSI (pin_D4)
60+
61+
#define MICROPY_HW_SPI3_NSS (pin_A15)
62+
#define MICROPY_HW_SPI3_SCK (pin_C10)
63+
#define MICROPY_HW_SPI3_MISO (pin_C11)
64+
#define MICROPY_HW_SPI3_MOSI (pin_C12)
65+
66+
// User and wake-up switch. Pressing the button makes the input go low.
67+
#define MICROPY_HW_USRSW_PIN (pin_C13)
68+
#define MICROPY_HW_USRSW_PULL (GPIO_NOPULL)
69+
#define MICROPY_HW_USRSW_EXTI_MODE (GPIO_MODE_IT_FALLING)
70+
#define MICROPY_HW_USRSW_PRESSED (0)
71+
72+
// LEDs
73+
#define MICROPY_HW_LED1 (pin_A5) // green
74+
#define MICROPY_HW_LED2 (pin_B14) // green
75+
#define MICROPY_HW_LED_ON(pin) (mp_hal_pin_high(pin))
76+
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
MCU_SERIES = l4
2+
CMSIS_MCU = STM32L475xx
3+
# The stm32l475 does not have a LDC controller which is
4+
# the only diffrence to the stm32l476 - so reuse some files.
5+
AF_FILE = boards/stm32l476_af.csv
6+
LD_FILE = boards/stm32l476xg.ld
7+
TEXT_ADDR = 0x08004000
8+
OPENOCD_CONFIG = boards/openocd_stm32l4.cfg
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
PA0,PA0
2+
PA1,PA1
3+
PA2,PA2
4+
PA3,PA3
5+
PA4,PA4
6+
PA5,PA5
7+
PA6,PA6
8+
PA7,PA7
9+
PA8,PA8
10+
PA9,PA9
11+
PA10,PA10
12+
PA11,PA11
13+
PA12,PA12
14+
PA13,PA13
15+
PA14,PA14
16+
PA15,PA15
17+
PB0,PB0
18+
PB1,PB1
19+
PB2,PB2
20+
PB3,PB3
21+
PB4,PB4
22+
PB5,PB5
23+
PB6,PB6
24+
PB7,PB7
25+
PB8,PB8
26+
PB9,PB9
27+
PB10,PB10
28+
PB11,PB11
29+
PB12,PB12
30+
PB13,PB13
31+
PB14,PB14
32+
PB15,PB15
33+
PC0,PC0
34+
PC1,PC1
35+
PC2,PC2
36+
PC3,PC3
37+
PC4,PC4
38+
PC5,PC5
39+
PC6,PC6
40+
PC7,PC7
41+
PC8,PC8
42+
PC9,PC9
43+
PC10,PC10
44+
PC11,PC11
45+
PC12,PC12
46+
PC13,PC13
47+
PC14,PC14
48+
PC15,PC15
49+
PD0,PD0
50+
PD1,PD1
51+
PD2,PD2
52+
PD3,PD3
53+
PD4,PD4
54+
PD5,PD5
55+
PD6,PD6
56+
PD7,PD7
57+
PD8,PD8
58+
PD9,PD9
59+
PD10,PD10
60+
PD11,PD11
61+
PD12,PD12
62+
PD13,PD13
63+
PD14,PD14
64+
PD15,PD15
65+
PE0,PE0
66+
PE1,PE1
67+
PE2,PE2
68+
PE3,PE3
69+
PE4,PE4
70+
PE5,PE5
71+
PE6,PE6
72+
PE7,PE7
73+
PE8,PE8
74+
PE9,PE9
75+
PE10,PE10
76+
PE11,PE11
77+
PE12,PE12
78+
PE13,PE13
79+
PE14,PE14
80+
PE15,PE15
81+
PH0,PH0
82+
PH1,PH1

0 commit comments

Comments
 (0)
0