1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

boards/nucleo-l433rc: use lpuart for stdio

- this UART is connected to st-link and can be reached via USB
    - the second UART is linked to Arduino RX/TX pins
This commit is contained in:
Alexandre Abadie 2018-05-21 21:46:57 +02:00
parent 133968ce8a
commit 8c6a7bc370
4 changed files with 19 additions and 6 deletions

View File

@ -1 +1,3 @@
FEATURES_REQUIRED += periph_lpuart
include $(RIOTBOARD)/common/nucleo/Makefile.dep

View File

@ -1,5 +1,6 @@
# Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_gpio periph_gpio_irq
FEATURES_PROVIDED += periph_lpuart
FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_rtc
FEATURES_PROVIDED += periph_rtt

View File

@ -2,10 +2,5 @@
export CPU = stm32l4
export CPU_MODEL = stm32l433rc
# stdio is not available over st-link but on the Arduino TX/RX pins
# A serial to USB converter plugged to the host is required
PORT_LINUX ?= /dev/ttyUSB0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
# load the common Makefile.include for Nucleo boards
include $(RIOTBOARD)/common/nucleo64/Makefile.include

View File

@ -106,6 +106,18 @@ static const timer_conf_t timer_config[] = {
* @{
*/
static const uart_conf_t uart_config[] = {
{
.dev = LPUART1,
.rcc_mask = RCC_APB1ENR2_LPUART1EN,
.rx_pin = GPIO_PIN(PORT_A, 3),
.tx_pin = GPIO_PIN(PORT_A, 2),
.rx_af = GPIO_AF8,
.tx_af = GPIO_AF8,
.bus = APB12,
.irqn = LPUART1_IRQn,
.type = STM32_LPUART,
.clk_src = 0, /* Use APB clock */
},
{
.dev = USART1,
.rcc_mask = RCC_APB2ENR_USART1EN,
@ -115,6 +127,8 @@ static const uart_conf_t uart_config[] = {
.tx_af = GPIO_AF7,
.bus = APB2,
.irqn = USART1_IRQn,
.type = STM32_USART,
.clk_src = 0, /* Use APB clock */
#ifdef UART_USE_DMA
.dma_stream = 5,
.dma_chan = 4
@ -122,7 +136,8 @@ static const uart_conf_t uart_config[] = {
}
};
#define UART_0_ISR (isr_usart1)
#define UART_0_ISR (isr_lpuart1)
#define UART_1_ISR (isr_usart1)
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
/** @} */