2020-10-23 05:54 AM
I've assigned the UART8 device in the devicetree of the linux kernel (OpenSTLinux):
&pinctrl {
// ...
uart8_pins: uart8-0 {
pins1 {
pinmux = <STM32_PINMUX('E', 0, AF8)>; /* UART8_RX */
bias-disable;
};
pins2 {
pinmux = <STM32_PINMUX('E', 1, AF8)>; /* UART8_TX */
bias-disable;
drive-push-pull;
slew-rate = <0>;
};
};
uart8_sleep_pins: uart8-sleep-0 {
pins {
pinmux = <STM32_PINMUX('E', 0, ANALOG)>, /* UART8_RX */
<STM32_PINMUX('E', 1, ANALOG)>; /* UART8_TX */
};
};
// ...
}
// ...
&uart8 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&uart8_pins>;
pinctrl-1 = <&uart8_sleep_pins>;
/delete-property/dmas;
/delete-property/dma-names;
status = "okay";
};
The uart8 (0x40019000) is detected upon boot and the device /dev/STM1 is created:
[ 1.196012] stm32-usart 40010000.serial: interrupt mode for rx (no dma)
[ 1.196036] stm32-usart 40010000.serial: interrupt mode for tx (no dma)
[ 1.196076] 40010000.serial: ttySTM0 at MMIO 0x40010000 (irq = 53, base_baud = 4000000) is a stm32-usart
[ 2.321957] stm32-usart 40019000.serial: interrupt mode for rx (no dma)
[ 2.327129] stm32-usart 40019000.serial: interrupt mode for tx (no dma)
[ 2.333894] 40019000.serial: ttySTM1 at MMIO 0x40019000 (irq = 54, base_baud = 4000000) is a stm32-usart
Sending on TX is working fine, but we can't receive anything. Looking into the interrupt table in linux, i see that the interrupt for UART8 should be on irq 54, bit i can't find anything there:
root@hp00164:~# cat /proc/tty/driver/stm32-usart
serinfo:1.0 driver revision:
0: uart:stm32-usart mmio:0x40010000 irq:53 tx:76167 rx:1466 RTS|CTS|DTR|DSR|CD
1: uart:stm32-usart mmio:0x40019000 irq:54 tx:25 rx:0 CTS|DSR|CD
root@hp00164:~# cat /proc/interrupts | grep ".serial"
53: 8959 0 stm32-exti-h-direct 30 Level 40010000.serial
What could be the reason for the missing irq? Is this even the issue for not receiving data?
I appreciate any help, thank you.
Best regards,
Kevin
Solved! Go to Solution.
2020-10-26 08:02 AM
Hi @JeanPhilippeR ,
it's working now, it was a hardware issue. :grinning_face_with_sweat:
Thank you for your help!
Best regards,
Kevin
2020-10-23 06:08 AM
Hi @Community member
Do you have a look to the wiki page https://wiki.st.com/stm32mpu/wiki/Trace_and_debug_scenario_-_UART_issue
which provide some guidelines for such issue?
BR
Jean-Philippe
2020-10-23 06:30 AM
Hello Jean-Philippe,
thank you for the url. After looking into it, i see that for uart8_k (count=0) the clock is not enabled:
root@hp00164:~# grep -E "clock|uart" /sys/kernel/debug/clk/clk_summary | sed 's,\s\+, ,g' | column -t
clock count count count rate accuracy phase cycle
uart8_k 0 0 0 64000000 0 0 50000
uart7_k 0 0 0 64000000 0 0 50000
uart6_k 0 0 0 64000000 0 0 50000
uart5_k 0 0 0 64000000 0 0 50000
uart4_k 1 1 0 64000000 0 0 50000
uart8 0 0 0 104438965 0 0 50000
uart7 0 0 0 104438965 0 0 50000
uart5 0 0 0 104438965 0 0 50000
uart4 0 0 0 104438965 0 0 50000
The rest seems to look good:
root@hp00164:~# cat /sys/kernel/debug/pinctrl/soc\:pin-controller\@50002000/pinmux-pins | grep 40019000
pin 64 (PE0): device 40019000.serial function af8 group PE0
pin 65 (PE1): device 40019000.serial function af8 group PE1
Here the complete interrupt table:
root@hp00164:~# cat /proc/interrupts
CPU0 CPU1
18: 19857 42464 GIC-0 27 Level arch_timer
20: 0 0 GIC-0 232 Level arm-pmu
21: 0 0 GIC-0 233 Level arm-pmu
22: 0 0 GIC-0 43 Level dma1chan0
23: 0 0 GIC-0 44 Level dma1chan1
24: 0 0 GIC-0 45 Level dma1chan2
25: 0 0 GIC-0 46 Level dma1chan3
26: 0 0 GIC-0 47 Level dma1chan4
27: 0 0 GIC-0 48 Level dma1chan5
28: 0 0 GIC-0 49 Level dma1chan6
29: 0 0 GIC-0 79 Level dma1chan7
30: 0 0 GIC-0 88 Level dma2chan0
31: 0 0 GIC-0 89 Level dma2chan1
32: 0 0 GIC-0 90 Level dma2chan2
33: 0 0 GIC-0 91 Level dma2chan3
34: 0 0 GIC-0 92 Level dma2chan4
35: 0 0 GIC-0 100 Level dma2chan5
36: 0 0 GIC-0 101 Level dma2chan6
37: 0 0 GIC-0 102 Level dma2chan7
38: 32 0 GIC-0 169 Level mmci-pl18x (cmd)
39: 0 0 GIC-0 37 Level rcc irq
41: 0 0 GIC-0 179 Level stm_thermal
42: 0 0 GIC-0 112 Level 54002000.hash
43: 2 0 GIC-0 154 Level 58000000.dma
44: 0 0 GIC-0 124 Level 58003000.spi
45: 7548 0 GIC-0 81 Level mmci-pl18x (cmd)
46: 413 0 GIC-0 156 Level mmci-pl18x (cmd)
47: 3837 0 GIC-0 93 Level eth0
48: 1 0 GIC-0 106 Level ohci_hcd:usb2
49: 902 0 GIC-0 120 Level 5a001000.display-controller
50: 0 0 GIC-0 121 Level 5a001000.display-controller
51: 0 0 GIC-0 141 Level 59000000.gpu
52: 0 0 GIC-0 111 Level 54001000.cryp
53: 11625 0 stm32-exti-h-direct 30 Level 40010000.serial
55: 0 0 stm32-exti-h-direct 70 Level eth0
56: 0 0 stm32-exti-h-direct 43 Level ehci_hcd:usb1
57: 0 0 stm32-exti-h-direct 22 Level 40013000.i2c
58: 0 0 GIC-0 66 Level 40013000.i2c
60: 248 0 stm32-exti-h-direct 24 Level 5c002000.i2c
61: 0 0 GIC-0 128 Level 5c002000.i2c
62: 0 0 stm32-exti-h 55 Edge pmic_irq
63: 0 0 pmic_irq 16 Edge 5c002000.i2c:stpmic@33:regulators
64: 0 0 pmic_irq 17 Edge 5c002000.i2c:stpmic@33:regulators
65: 0 0 pmic_irq 19 Edge 5c002000.i2c:stpmic@33:regulators
66: 0 0 pmic_irq 20 Edge 5c002000.i2c:stpmic@33:regulators
67: 0 0 pmic_irq 21 Edge 5c002000.i2c:stpmic@33:regulators
68: 0 0 pmic_irq 14 Edge 5c002000.i2c:stpmic@33:regulators
69: 0 0 pmic_irq 12 Edge 5c002000.i2c:stpmic@33:regulators
70: 0 0 pmic_irq 13 Edge 5c002000.i2c:stpmic@33:regulators
71: 0 0 stm32-exti-h-direct 61 Edge 4c001000.mailbox
72: 0 0 GIC-0 133 Level 4c001000.mailbox
73: 0 0 stm32-exti-h-direct 44 Level 49000000.usb-otg, 49000000.usb-otg
IPI0: 0 0 CPU wakeup interrupts
IPI1: 0 0 Timer broadcast interrupts
IPI2: 1625 7452 Rescheduling interrupts
IPI3: 67 132 Function call interrupts
IPI4: 0 0 CPU stop interrupts
IPI5: 8684 28936 IRQ work interrupts
IPI6: 0 0 completion interrupts
Err: 0
2020-10-23 07:30 AM
Hi @Community member
Thank you for outputs.
Which version of OpenSTLinux are you using?
BR
Jean-Philippe
2020-10-23 07:44 AM
Hi @JeanPhilippeR,
we are using dunfell 5.4, the latest distribution.
Linux hp00164 5.4.31 #1 SMP PREEMPT Wed Apr 8 07:08:47 UTC 2020 armv7l armv7l armv7l GNU/Linux
Thanks,
Kevin
2020-10-23 07:49 AM
Note also that to get the interrupt present in the /proc/interrupts you have to listen for the port in Rx, i.e. cat /dev/ttySTM1.
How do you perform the Rx test on your side?
thank you
BR
Jean-Philippe
2020-10-26 02:29 AM
Hi @JeanPhilippeR
the RX and TX pins are connected together.
In the one terminal window i'm using cat for listing on the port:
root@hp00164:~# stty -a -F /dev/ttySTM1
speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S;
susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho -extproc
root@hp00164:~# cat /dev/ttySTM1
On the other terminal, i'm writing with echo:
root@hp00164:~# echo "Test" > /dev/ttySTM1
But nothing is displayed on the other terminal.
When i'm listing on the port with cat, the clock is now activated, so that seems fine.
Thank you.
Best regards,
Kevin
2020-10-26 08:02 AM
Hi @JeanPhilippeR ,
it's working now, it was a hardware issue. :grinning_face_with_sweat:
Thank you for your help!
Best regards,
Kevin
2020-10-27 12:39 AM
Hi @Community member
Good news, thank you for your feedback.
BR
Jean-Philippe