Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stmhal: Add support for the STM32F401NUCLEO board.
Includes full version of pins.csv file with correct mapping of the Nucleo STM32F401RE chip (LQFP64 package).
- Loading branch information
Showing
4 changed files
with
500 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#define MICROPY_HW_BOARD_NAME "F401NUCLEO" | ||
#define MICROPY_HW_MCU_NAME "STM32F401xE" | ||
|
||
#define MICROPY_HW_HAS_SWITCH (1) | ||
#define MICROPY_HW_ENABLE_RTC (1) | ||
|
||
// HSE is 8MHz, CPU freq set to 84MHz | ||
#define MICROPY_HW_CLK_PLLM (8) | ||
#define MICROPY_HW_CLK_PLLN (336) | ||
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV4) | ||
#define MICROPY_HW_CLK_PLLQ (7) | ||
|
||
// UART config | ||
#define MICROPY_HW_UART2_PORT (GPIOA) | ||
#define MICROPY_HW_UART2_PINS (GPIO_PIN_2 | GPIO_PIN_3) | ||
#define MICROPY_HW_UART6_PORT (GPIOC) | ||
#define MICROPY_HW_UART6_PINS (GPIO_PIN_6 | GPIO_PIN_7) | ||
|
||
// I2C busses | ||
#define MICROPY_HW_I2C1_SCL (pin_B6) | ||
#define MICROPY_HW_I2C1_SDA (pin_B7) | ||
|
||
// USRSW is pulled low. Pressing the button makes the input go high. | ||
#define MICROPY_HW_USRSW_PIN (pin_C13) | ||
#define MICROPY_HW_USRSW_PULL (GPIO_NOPULL) | ||
#define MICROPY_HW_USRSW_EXTI_MODE (GPIO_MODE_IT_FALLING) | ||
#define MICROPY_HW_USRSW_PRESSED (0) | ||
|
||
// LEDs | ||
#define MICROPY_HW_LED1 (pin_A5) // Green LD2 LED on Nucleo | ||
#define MICROPY_HW_LED_OTYPE (GPIO_MODE_OUTPUT_PP) | ||
#define MICROPY_HW_LED_ON(pin) (pin->gpio->BSRRL = pin->pin_mask) | ||
#define MICROPY_HW_LED_OFF(pin) (pin->gpio->BSRRH = pin->pin_mask) | ||
|
||
// USB config | ||
#define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_A9) | ||
#define MICROPY_HW_USB_OTG_ID_PIN (pin_A10) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
MCU_SERIES = f4 | ||
CMSIS_MCU = STM32F401xE | ||
AF_FILE = boards/stm32f401_af.csv | ||
LD_FILE = boards/stm32f401.ld |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
PC0,PC0 | ||
PC1,PC1 | ||
PC2,PC2 | ||
PC3,PC3 | ||
PA0,PA0 | ||
PA1,PA1 | ||
PA2,PA2 | ||
PA3,PA3 | ||
PA4,PA4 | ||
PA5,PA5 | ||
PA6,PA6 | ||
PA7,PA7 | ||
PC4,PC4 | ||
PC5,PC5 | ||
PB0,PB0 | ||
PB1,PB1 | ||
PB2,PB2 | ||
PB10,PB10 | ||
PB12,PB12 | ||
PB13,PB13 | ||
PB14,PB14 | ||
PB15,PB15 | ||
PC6,PC6 | ||
PC7,PC7 | ||
PC8,PC8 | ||
PC9,PC9 | ||
PA8,PA8 | ||
PA9,PA9 | ||
PA10,PA10 | ||
PA13,PA13 | ||
PA14,PA14 | ||
PA15,PA15 | ||
PC10,PC10 | ||
PC11,PC11 | ||
PC12,PC12 | ||
PD2,PD2 | ||
PB4,PB4 | ||
PB5,PB5 | ||
PB6,PB6 | ||
PB7,PB7 | ||
PB8,PB8 | ||
PB9,PB9 | ||
PC13,PC13 | ||
PC14,PC14 | ||
PC15,PC15 | ||
PH0,PH0 | ||
PH1,PH1 | ||
LED_GREEN,PA5 | ||
LED_ORANGE,PA5 | ||
LED_RED,PA5 | ||
LED_BLUE,PA4 | ||
SW,PC13 |
Oops, something went wrong.