cancel
Showing results for 
Search instead for 
Did you mean: 

The usart1 has issue with PZ6 and PZ7

SChen.11
Associate III

Hi all, I use PZ7 and PZ6 configure for usart1. But it show some error log.

[    1.633566] stm32mp157-pinctrl soc:pin-controller@50002000: invalid function.
[    1.640375] stm32-usart: probe of 5c000000.serial failed with error -22

It's right when II try to use another pins . Did you also had this issue?

8 REPLIES 8
PatrickF
ST Employee

Would be easier to support if you provide the DeviceTree.

Meanwhile, some clues

  • 50002000 is GPIOA, normal ?
  • Please check if you have not duplicated of same GPIO definition in the DT
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Thanks for your quick response. Below is my dts code. And I also enable all uart/usart in dts, only the usart1 had error.

 339         uart1_pins_a: uart1-0 {
 340                 pins1 {
 341                         pinmux = <STM32_PINMUX('Z', 7, AF7)>; /* USART1_TX */
 342                         bias-disable;
 343                         drive-push-pull;
 344                         slew-rate = <0>;
 345                 };
 346                 pins2 {
 347                         pinmux = <STM32_PINMUX('Z', 6, AF7)>; /* USART1_RX */
 348                         bias-disable;
 349                 };
 350         };
 
 856 &usart1 {
 857         pinctrl-names = "default", "sleep", "idle";
 858         pinctrl-0 = <&uart1_pins_a>;
 859         pinctrl-1 = <&uart1_sleep_pins_a>;
 860         pinctrl-2 = <&uart1_idle_pins_a>;
 861         status = "okay";
 862 };

I assume the nodes "uart1_sleep_pins_a" and "uart1_idle_pins_a" are defined elsewhere. otherwise, try to remove the "pinctrl-1" and "pinctrl-2" lines.

Please check if USART1 is defined as non-secure in etzpc node of TF-A Device Tree?

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Sorry for that I missing upload the "uart1_sleep_pins_a" and "uart1_idle_pins_a". I also try to remove those nodes. It also has same issue. Currently, I use basic chain with sdcard boot. I found the etzpc node in TFA device tree file. But I doesn't use the TFA, only the u-uboot-spl.stm32 and u-boot.img.

I'm not sure Basic boot support USART1 configuration which is a secure peripheral by default.

We recommend to use TF-A+uBoot as this is the official flow we commit to support for long time.

Basic boot is currently used only for DDR Tools usages and one this tool support will be available using TF-A+uBoot, Basic boot support will be discontinued.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

I switch to use trusted chain with TFA + uboot. And I follow the link to check the USART1 domain of TFA(by default, it's setting to DECPROT_NS_RW).

https://wiki.st.com/stm32mpu/wiki/ETZPC_device_tree_configuration

But also had same error log. My kernel branch is v4.19-stm32mp-r1.4.

I read the wiki link and found the USART1 can be assign to OPTEE and linux context.

https://wiki.st.com/stm32mpu/wiki/USART_internal_peripheral

Does it means the usart1 only used by optee with linux not the non-secure linux context?

JKlei.1
Associate

Hi,

I had the same problem. I muxed the pins in uboot and delete the muxing in devicetree.

After this the uasrt1 works fine.

Seems to be an issue in the pinctrl driver.