Page 1 of 1

UART1 (/dev/ttyS1) disapear after reboot (PICO ULTRA / Ubuntu)

Posted: 2024-09-12 13:03
by cem
Hello!

I have PICO Ultra board with latest Ubuntu image flashed.
With "sudo luckfox-config" all 6 UART available ports were enabled. (UART2 - debug, all other works as expected).
After system reboot only 5 ports are visible, UART1 (/dev/ttyS1) is missing.

Code: Select all

pico@luckfox:~$ ls /dev/ttyS*
/dev/ttyS0  /dev/ttyS2  /dev/ttyS3  /dev/ttyS4  /dev/ttyS5

Code: Select all

pico@luckfox:~$ cat /etc/luckfox.cfg
SPI0_M0_CS_ENABLE=1
SPI0_M0_MODE=1
TS_ENABLE=0
RGB_ENABLE=0
CSI_ENABLE=0
UART3_M0_STATUS=1
UART4_M0_STATUS=1
UART2_M1_STATUS=1
UART5_M1_STATUS=1
UART1_M1_STATUS=1
UART0_M1_STATUS=1
Could you please explain this behavior ? How to fix it ?

Thanks!

Re: UART1 (/dev/ttyS1) disapear after reboot (PICO ULTRA / Ubuntu)

Posted: 2024-09-12 19:02
by cem
Couple of finding may be it will help to understand the issue.

I can edit cfg file and then perform config reload

Code: Select all

sudo nano /etc/luckfox.cfg
sudo luckfox-config load
It works for all UART except UART4_M1 and UART1_M1,

Code: Select all

sudo luckfox-config show
does not display * sign on it.

If on/off for these ports done via gui menu, * sign is displayed

Code: Select all

PWM8_M1 -              *UART4_M1_RX - GPIO1_C4 |       | GND
 PWM9_M1 -              *UART4_M1_TX - GPIO1_C5 |       | MICBIAS
         - I2C4_M0_SCL - UART1_M1_RTS- GPIO2_A1 |       | MIC1P
         - I2C4_M0_SDA - UART1_M1_CTS- GPIO2_A0 |       | MIC1N
                        *UART1_M1_RX - GPIO2_A5 |       | GND
                        *UART1_M1_TX - GPIO2_A4 |       | GPIO1_C7 -             -             - PWM11_M1
but after reload config it disappears again

Code: Select all

sudo luckfox-config load

So during boot process config load is performed (?) and it does not work for UART4_M1 and UART1_M1 on PICO Ultra board.

Re: UART1 (/dev/ttyS1) disapear after reboot (PICO ULTRA / Ubuntu)

Posted: 2024-09-12 19:32
by cem
Solved by editing luckfox-config script

Code: Select all

sudo nano /usr/bin/luckfox-config

Code: Select all

multi_pins_group+=("$(echo "$pin" | sed -E 's/(UART[0-9]+_M[0-9]+)_.*$/\1/g' | sed 's/^ //')")
does not delete leading spaces and should be replaced by this one

Code: Select all

multi_pins_group+=("$(echo "$pin" | sed -E 's/(UART[0-9]+_M[0-9]+)_.*$/\1/g' | sed 's/^ //' | sed 's/[[:space:]]//g')")
difference is in

Code: Select all

 | sed 's/[[:space:]]//g'

Re: UART1 (/dev/ttyS1) disapear after reboot (PICO ULTRA / Ubuntu)

Posted: 2024-09-13 1:44
by Crocodile
Thank you for your feedback, we'll update after verifying that there are no issues