2025-04-09 1:13 AM
Hello ST Community,
I'm using the STM32MP257F-DK MPU board and wanted to enable the USART6 interface. We can access it from the 40-Pin GPIO expansion header of the board.
For this, I have enabled the 'status' node settings of the usart6 from the device tree (dts) file as mentioned below.
serial@40220000 {
compatible = "st,stm32h7-uart";
reg = <0x40220000 0x400>;
interrupts-extended = <0x1e 0x1d 0x04>;
clocks = <0x16 0x116>;
dmas = <0x1c 0x13 0x20 0x10012 0x1c 0x14 0x20 0x3021>;
dma-names = "rx\0tx";
access-controllers = <0x1b 0x24>;
power-domains = <0x0c>;
wakeup-source;
status = "okay";
pinctrl-names = "default\0idle\0sleep";
pinctrl-0 = <0x34>;
pinctrl-1 = <0x35>;
pinctrl-2 = <0x36>;
uart-has-rtscts;
phandle = <0xe5>;
};
After setting 'status = okay' in the dts, I'm able to see the '/dev/ttySTM1' device entry on my board on bootup. Now, just to check the uart is enabled or not, I have looped back Tx-Rx pins of the GPIO expansion header and tried to write to the usart (echo "hello" > /dev/ttySTM1") but I see nothing on the console.
I tried to see the clock_summary and found that somehow, the clock status for the usart6 is not enabled. I'm not sure how to enable the clock or what the correct clock_source and clock_id are for this particular usart. [DTS uses clocks = <0x16 0x116>; node for the clock].
root@stm32mp2:~# cat /sys/kernel/debug/clk/clk_summary | grep usart6
ck_icn_p_usart6 0 0 0 200000000 0 0 50000 N deviceless no_connection_id
ck_ker_usart6 0 0 0 64000000 0 0 50000 N serial@40220000 no_connection_id
Tried to enable clock at runtime (Using 'echo on > /sys/class/tty/ttySTM1/device/power/control') for usart6 but it doesn't work. Any thought on how I can enable the usart and get the Tx-Rx loopback working?
Thanks,
Mayank