2069570_en-US

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

2069570_en-US

2069570_en-US

How S32G3 Linux BSP 35 enable ttyLF1

Hi NXP team,


I referenced S32G399ardb3 and designed out custom board and use Linux BSP 35.


Our S32G3 customized board can not receive UART data from PC,but PC can received UART data from S32G3


How do we know what function PINMUX FUNC X represents in device tree?

If we enable UART2 how should PINMUX FUNC X be set?


Below is our device tree (I follow BSP 43 to modify)

uart1_pins: uart1_pins {
	uart1_pins_grp0 {
		pinmux = FUNC2)>;	// PC_08
		output-enable;
		slew-rate = ;
	};

	uart1_pins_grp1 {
		pinmux = FUNC0)>;	// PC_04
		input-enable;
		slew-rate = ;
	};

	uart1_pins_grp2 {
		pinmux = FUNC2)>;
	};
};
&uart1 { pinctrl-0 = <&uart1_pins>; pinctrl-names = "default"; status = "okay"; };

I use command in S32G3 to send data

echo "Test" > /dev/ttyLF1

My PC can use command to received data

cat /dev/ttyUSB1

Thanks

回复: How S32G3 Linux BSP 35 enable ttyLF1

Hi @GG0712,

Thanks for share your solution. 


回复: How S32G3 Linux BSP 35 enable ttyLF1

Hi @carlos_o ,


I solved this issue and thanks for your support.

I modify Linux serial driver in "drivers/tty/serial/serial_core.c"

normal->init_termios.c_cflag = B921600 | CS8 | CREAD | HUPCL | CLOCAL;
normal->init_termios.c_ispeed = normal->init_termios.c_ospeed = 921600;

Now, the ttyLF1 and ttyLF2 default baud rate is 921600 and serial console baud rate is 115200


Below is my test log (I jump the ttyLF2 and connect it to USB to TTL dongle)

root@s32g399ardb3:~# stty -F /dev/ttyLF1
speed 921600 baud; line = 0;
-brkint -imaxbel
root@s32g399ardb3:~# echo "test" > /dev/ttyLF2
root@s32g399ardb3:~#
root@s32g399ardb3:~# cat /dev/ttyLF2
PC to GW

PC

PC:~$ stty -F /dev/ttyUSB1 921600 -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke -icrnl -inlcr
PC:~$
PC:~$ cat /dev/ttyUSB1
test
^C
PC:~$
PC:~$ echo "PC to GW" > /dev/ttyUSB1

Thanks

回复: How S32G3 Linux BSP 35 enable ttyLF1

Hi @GG0712,

You are right the documentation I shared is to change the baudrate for the UART used as console.

In this case the recommendation is to use the stty command to change to another standard baudrate. This because the serial driver used for the UART is the provided with linux. 

回复: How S32G3 Linux BSP 35 enable ttyLF1

Hi @carlos_o ,


It looks like same as BSP 43 User Manual at chapter 29.6

My understanding is that this is to change the serial console and the baud rate of the default tty during the startup phase.

But my requirement is that the baud rate of ttyLF0 is 115200 and still serves as the serial console. The baud rate of ttyLF1 needs to be changed from the default 9600 to other values.


Thanks

回复: How S32G3 Linux BSP 35 enable ttyLF1

Hi @GG0712,

You can find that information at the BSP 42 User Manual at chapter 27.5 Changing UART baud rate.

carlos_o_0-1743196707967.png

carlos_o_1-1743196768388.png

carlos_o_2-1743197668929.png



回复: How S32G3 Linux BSP 35 enable ttyLF1

Hi NXP team,


Currently working correctly.

But how do I set the baud rate without using stty comand?


Note: ttyLF1 is internal UART instead of serial console

回复: How S32G3 Linux BSP 35 enable ttyLF1

Hi @GG0712,

As you say, the FUNCX is described at the S32G3_IOMUX 2.xlsx file attached at the Reference Manual (it needs to be open with Acrobat Reader to open the attached files). 

After changing this setting, is the UART working correctly?

Let me know if you face any other issue with this. 

回复: How S32G3 Linux BSP 35 enable ttyLF1

Hi NXP team,


I found these issue in S32G3_IOMUX 2.xlsx file


PC_04 PINMUX function "LIN Receive Data" SSS is 0000_0100, so it should be FUNC4


uart1_pins_grp2 {
	pinmux = FUNC4)>;
};

Thanks

Tags (1)
No ratings
Version history
Last update:
‎11-21-2025 09:45 PM
Updated by: