cancel
Showing results for 
Search instead for 
Did you mean: 

Enabling USART6 as a serial Port

monica_s
Associate

Hello ST,
      We are trying to enable USART6 as a serial console, in the stm32mp257f-dk board, we have builded the SDK using Openstlinux "Distribution package", I had done the below changes in the stm32mp257f-dk.dts device tree present in the kernel-source and u-boot directory : 

aliases {
    serial1 = &usart6;
	};
    chosen {
		stdout-path = "serial1:115200n8";  
		#address-cells = <2>;
		#size-cells = <2>;
		ranges;
           };

&usart2 {
	pinctrl-names = "default", "idle", "sleep";
	pinctrl-0 = <&usart2_pins_a>;
	pinctrl-1 = <&usart2_idle_pins_a>;
	pinctrl-2 = <&usart2_sleep_pins_a>;
	/delete-property/dmas;
	/delete-property/dma-names;
	status = "okay";
};

&usart6 {
	pinctrl-names = "default", "idle", "sleep";
	pinctrl-0 = <&usart6_pins_a>;
	pinctrl-1 = <&usart6_idle_pins_a>;
	pinctrl-2 = <&usart6_sleep_pins_a>;
	uart-has-rtscts;
	status = "okay";
};

 And also modified the stm32mp257f-dk-u-boot.dtsi device tree and pin configurations as shown below : 

&usart6 {
	bootph-all;
};

&usart6_pins_a {
	bootph-all;
	pins1 {
		bootph-all;
	};
	pins2 {
		bootph-all;
	};
};

But getting the below error :

E/TC:0   stm32_serc_handle_ilac:133 SERC exceptions [63:32]: 0x10
E/TC:0   stm32_serc_handle_ilac:139 SERC exception ID: 36
root@stm32mp25-disco-e3-cc-91:~# stty -F /dev/ttySTM1
E/TC:0   stm32_serc_handle_ilac:133 SERC exceptions [63:32]: 0x10
E/TC:0   stm32_serc_handle_ilac:139 SERC exception ID: 36
[  426.789010] SError Interrupt on CPU0, code 0x00000000bf000002 -- SError
[  426.789029] CPU: 0 PID: 1625 Comm: stty Tainted: G           O       6.6.78 #1
[  426.789039] Hardware name: STMicroelectronics STM32MP257F-DK Discovery Board (DT)
[  426.789044] pstate: 80000005 (Nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[  426.789053] pc : stm32_usart_rx_dma_start_or_resume+0x80/0x234
[  426.789072] lr : stm32_usart_startup+0x8c/0x130
[  426.789082] sp : ffff8000839db950
[  426.789085] x29: ffff8000839db950 x28: ffff00008c143e40 x27: 0000000000020800
[  426.789101] x26: ffff800081037828 x25: ffff800081037468 x24: 0000000000000000
[  426.789113] x23: 0000000000000000 x22: ffff000081b23800 x21: ffff8000819ed048
[  426.789126] x20: 0000000000000000 x19: ffff800081b08210 x18: ffffffffffffffff
[  426.789138] x17: 0000000000000000 x16: 0000000000000000 x15: ffff8000839db700
[  426.789149] x14: 0000000000000001 x13: 006c61697265732e x12: 0000000000000000
[  426.789161] x11: ffff0000890e2920 x10: ffffffffffffffc0 x9 : ffffffffffffffff
[  426.789174] x8 : 0000000000000228 x7 : 0000000000000000 x6 : 0000000000000000
[  426.789185] x5 : ffff000081bad748 x4 : ffff000081bad808 x3 : 0000000000000000
[  426.789197] x2 : ffff800081dd5000 x1 : 0000000000000000 x0 : ffff0000824f2080
[  426.789211] Kernel panic - not syncing: Asynchronous SError Interrupt
[  426.789216] CPU: 0 PID: 1625 Comm: stty Tainted: G           O       6.6.78 #1
[  426.789223] Hardware name: STMicroelectronics STM32MP257F-DK Discovery Board (DT)
[  426.789227] Call trace:
[  426.789231]  dump_backtrace+0x94/0x114
[  426.789245]  show_stack+0x18/0x24
[  426.789256]  dump_stack_lvl+0x48/0x60
[  426.789265]  dump_stack+0x18/0x24
[  426.789272]  panic+0x324/0x380
[  426.789282]  nmi_panic+0x8c/0x90
[  426.789290]  arm64_serror_panic+0x6c/0x78
[  426.789298]  do_serror+0x3c/0x70
[  426.789304]  el1h_64_error_handler+0x30/0x48
[  426.789314]  el1h_64_error+0x64/0x68
[  426.789321]  stm32_usart_rx_dma_start_or_resume+0x80/0x234
[  426.789331]  stm32_usart_startup+0x8c/0x130
[  426.789341]  uart_startup+0x13c/0x2fc
[  426.789351]  uart_port_activate+0x34/0x9c
[  426.789360]  tty_port_open+0x8c/0x13c
[  426.789371]  uart_open+0x1c/0x30
[  426.789380]  tty_open+0x138/0x6dc
[  426.789388]  chrdev_open+0xbc/0x208
[  426.789400]  do_dentry_open+0x1b0/0x524
[  426.789413]  vfs_open+0x2c/0x38
[  426.789420]  path_openat+0xb14/0xdf0
[  426.789430]  do_filp_open+0x9c/0x14c
[  426.789440]  do_sys_openat2+0xc4/0x104
[  426.789447]  __arm64_sys_openat+0x64/0xac
[  426.789455]  invoke_syscall+0x48/0x114
[  426.789466]  el0_svc_common.constprop.0+0x40/0xe0
[  426.789476]  do_el0_svc+0x1c/0x28
[  426.789486]  el0_svc+0x38/0xc8
[  426.789493]  el0t_64_sync_handler+0x120/0x12c
[  426.789501]  el0t_64_sync+0x190/0x194
[  426.789510] SMP: stopping secondary CPUs
[  426.789527] Kernel Offset: disabled
[  426.789529] CPU features: 0x0,00000000,00020000,0000421b
[  426.789536] Memory Limit: none
[  427.047254] ---[ end Kernel panic - not syncing: Asynchronous SError Interrupt ]---
E/TC:1   Panic 'Watchdog' at /usr/src/debug/optee-os-stm32mp/4.0.0-stm32mp-r2/core/drivers/stm32_iwdg.c:218 <stm32_iwdg_it_handler>

then the device gets rebooted.

Can you suggest a simple straight forward documentation for resolving the SREC error as I am new the technology :)

1 REPLY 1
Christophe Guibout
ST Employee

Hello @monica_s,

 

Most of the time, a SERC is caused by an unclocked hardware IP : see this wiki page for more details.

The SERC ID 36 corresponds to USART6 (see "Table 994. SERF resources mapping" in the reference manual)

 

I would recommand to also configure usart6 in op-tee which is owner of clock and security:

- clock needs to be set

- rif configuration has to be set to allow A35 to access the IP : default configuration looks good.

 

Don't forget to configure tf-a console as well.

 

BR,

Christophe

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.