cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP257, USART and SERC exception

altsir_sga
Associate III

Hi,

I am trying to use USART6 on STM32MP257F-DK development board. I have enabled it in the device tree, recompiled it and I now can see the /dev/ttySTM1 node. The problem is, that sometimes, after reboot, any access to the USART (even changing its baudrate using stty -F /dev/ttySTM1 command) causes SERC exception (with ID 36 which corresponds to USART6) to happen.

This does not happen all the time, but most of the time. Once and it doesn't happen after boot it won't happen again until next reboot and the UART works just fine.

here my device tree change:

&usart6 {
pinctrl-names = "default", "idle", "sleep";
pinctrl-0 = <&usart6_pins_a>;
pinctrl-1 = <&usart6_idle_pins_a>;
pinctrl-2 = <&usart6_sleep_pins_a>;
/delete-property/dmas;
/delete-property/dma-names;
status = "okay";
};

 

it seemed first that disabling the DMA helps, but I am not so sure now

usart6_pins_a: usart6-0 {
pins1 {
pinmux = <STM32_PINMUX('F', 13, AF3)>; /* USART6_TX */
bias-disable;
drive-push-pull;
slew-rate = <0>;
};
pins2 {
pinmux = <STM32_PINMUX('F', 14, AF3)>; /* USART6_RX */
bias-pull-up;
};
};
 
usart6_idle_pins_a: usart6-idle-0 {
pins1 {
pinmux = <STM32_PINMUX('F', 13, ANALOG)>; /* USART6_TX */
};
pins3 {
pinmux = <STM32_PINMUX('F', 14, AF3)>; /* USART6_RX */
bias-pull-up;
};
};
 
usart6_sleep_pins_a: usart6-sleep-0 {
pins {
pinmux = <STM32_PINMUX('F', 13, ANALOG)>, /* USART6_TX */
<STM32_PINMUX('F', 14, ANALOG)>; /* USART6_RX */
};
};
 
Thanks!
Alexey.
11 REPLIES 11

Hi @GatienC 

When you're saying "USART6 is used by the UCSI firmware running on the cortex M33". Does this mean that if you're enabling USART6 in the device tree of TF-A or other. They cannot be used on the A35 processor? Only on Cortex M33 processor?

I'm having issues with USART6. I want to have USART6 as early boot instead of USART2.

STM32MP151AAC3 custom board with STM32-OS as operating system: https://github.com/DanielMartensson/STM32-Computer

STM32MP257FAK3 custom board with STM64-OS as operating system: https://github.com/DanielMartensson/STM64-Computer
GatienC
ST Employee

Hello,

By that, I mean that the UCSI firmware running on the CortexM33 default uses the USART6. So if USART6 is not isolated to a compartment and that both Cortex A35s and M33 access it, then you'll get an erratic behavior because 2 independent entities use the same peripheral (concurrent clock and registers accesses). There is nothing preventing you from using the USART6 on Cortex A35s, but do not use the UCSI firmware then... Or change the USART it uses.

Best regards,

Gatien