2020-05-19 07:14 AM
Hi Folks,
i created a custom dts and build it via the mx-addons howto. My goal is to activate USART3 on DK2.
For USART3 is create the following source in the DT:
&usart3{
pinctrl-names = "default", "sleep", "idle";
pinctrl-0 = <&usart3_pins_a>;
pinctrl-1 = <&usart3_sleep_pins_a>;
pinctrl-2 = <&usart3_idle_pins_a>
status = "okay";
/* USER CODE BEGIN usart3 */
/* USER CODE END usart3 */
};
usart3_pins_mx: usart3_mx-0 {
u-boot,dm-pre-reloc;
pins1 {
u-boot,dm-pre-reloc;
pinmux = <STM32_PINMUX('B', 10, AF7)>, /* USART3_TX */
<STM32_PINMUX('G', 8, AF8)>; /* USART3_RTS */
bias-disable;
drive-push-pull;
slew-rate = <0>;
};
pins2 {
u-boot,dm-pre-reloc;
pinmux = <STM32_PINMUX('B', 12, AF8)>, /* USART3_RX */
<STM32_PINMUX('B', 13, AF7)>; /* USART3_CTS */
bias-disable;
};
};
usart3_sleep_pins_mx: usart3_sleep_mx-0 {
u-boot,dm-pre-reloc;
pins {
u-boot,dm-pre-reloc;
pinmux = <STM32_PINMUX('B', 10, ANALOG)>, /* USART3_TX */
<STM32_PINMUX('B', 12, ANALOG)>, /* USART3_RX */
<STM32_PINMUX('B', 13, ANALOG)>, /* USART3_CTS */
<STM32_PINMUX('G', 8, ANALOG)>; /* USART3_RTS */
};
};
/* USER CODE BEGIN pinctrl */
/* USER CODE END pinctrl */
};
And i get in the bootmessage:
[ 0.430813] stm32-dma 48000000.dma: STM32 DMA driver registered
[ 0.432952] stm32-dma 48001000.dma: STM32 DMA driver registered
[ 0.514748] STM32 USART driver initialized
[ 0.516149] stm32-usart 4000e000.serial: Linked as a consumer to 48000000.dma
[ 0.516515] 4000e000.serial: ttySTM3 at MMIO 0x4000e000 (irq = 24, base_baud = 4000000) is a stm32-usart
[ 0.516810] serial serial0: tty port ttySTM3 registered
[ 0.516877] genirq: irq_chip stm32-exti-h did not update eff. affinity mask of irq 72
[ 0.517785] stm32-usart: probe of 4000f000.serial failed with error -22
[ 0.518837] stm32-usart 40010000.serial: interrupt mode used for rx (no dma)
[ 0.518863] stm32-usart 40010000.serial: interrupt mode used for tx (no dma)
[ 0.518892] 40010000.serial: ttySTM0 at MMIO 0x40010000 (irq = 26, base_baud = 4000000) is a stm32-usart
[ 1.463868] console [ttySTM0] enabled
The USART3 is at 400f000 so i get these error 22.
Does any one has any hints for me where to look?
Best regards and thanks,
Niklas
2020-05-19 07:34 AM
Hi @Niklas Voi
Do you know those links :
https://wiki.st.com/stm32mpu/wiki/Serial_TTY_device_tree_configuration
https://wiki.st.com/stm32mpu/wiki/Trace_and_debug_scenario_-_UART_issue
Better to double check if dts generated by CubeMX does not need to be manually customized, and then use debug technics to try to understand what's going on.
Hope it help
Olivier