serial port issue

This forum is for topics dealing with problems with software specifically in the AArch64 repo.

serial port issue

Postby df8oe » Wed Aug 17, 2022 7:58 am

Hi to all,
I have run rpi 3b with vanilla kernel until today. Serial port was available and usable - it looks like this:
crw-rw---- 1 root uucp 4, 65 15. Aug 12:09 /dev/ttyS1
But vanilla kernel seems not to support rpi hardware perfectly - rpi often stops with a kernel panic. So I decided to switch to linux-rpi kernel. Swapping was successful - system aarch64 is running now with linux-rpi kernel. Of course I looked at /boot/config.txt and /boot/cmdline.txt and adapted my changes which were saved in *.pacsave files.

After reboot the serial port /dev/ttyS1 was vanished - but I get an /dev/ttyAMA0. It looks different:
crw-rw---- 1 root uucp 204, 64 17. Aug 09:39 /dev/ttyAMA0
and - badly - it does no longer work. I have checked /boot/cmdline.txt if anything "serial" was present there but it was not. I can write in the device and read from it - but it is the same as if I use /dev/null. I have looked at the RXD and TXD pins using a scope - but they are "silent". I am missing the negative level. It looks as /dev/ttyAMA0 is mapped to something different than the serial port.

Here my config.txt-settings related to uart:
$this->bbcode_second_pass_code('', '
# enable serial port
core_freq=250
enable_uart=1
')

EDIT:
There are both /proc/device-tree/aliases/uart0 and /proc/device-tree/aliases/uart1 present - but ttyS1 is not created.

Now I am stuck at this - I need the serial port...
df8oe
 
Posts: 57
Joined: Fri Oct 01, 2021 5:10 pm

Re: serial port issue

Postby lategoodbye » Thu Aug 18, 2022 2:48 am

Mainline kernel:
ttyAMA0 = real UART
ttyS1 = mini UART

RPI kernel:
ttyAMA0 = real UART
ttyS0 = mini UART

Usually the ttyAMA0 is connected to the bluetooth chip.

It would be nice if you can post the mainline kernel panics in a separate thread.
lategoodbye
 
Posts: 116
Joined: Sat Dec 29, 2018 1:24 am

Re: serial port issue

Postby df8oe » Thu Aug 18, 2022 7:48 am

Sorry - I have left vanilla kernel because I must rely on rpi functionality. But the issues with kernel panic are related with "big data transfer to external USB RAID array". During the night several rsync processes with other servers take place and often during this processes kernel panic occurs. Sadly I could not reproduce in a stable way - sometimes the processes finished successfully.

Regarding serial ports on RPI kernel:
Yes, I already got these informations. ttyAMA0 is created, ttyS0 not. I have added
$this->bbcode_second_pass_code('', 'enable_uart=1')
to config.txt without any changes, I have tried to create device using
$this->bbcode_second_pass_code('', 'mknod "/dev/ttyS0" c 4 65')
(and other combinations like 4/64). I can create the device like this - but it is not working. So I am fiddling how to tell rpi kernel to create the mini UART. The protocol I will use is simple at a speed of 2400 baud - it worked with vanilla kernel without any issues. Now I am temporarily thrown back to the use of an USB - serial converter. Not the best choice because of I have freed one USB port by removing another hardware which I need, too - but with lower priority... So I want to get back serial port.
df8oe
 
Posts: 57
Joined: Fri Oct 01, 2021 5:10 pm

Re: serial port issue

Postby lategoodbye » Thu Aug 18, 2022 7:28 pm

Thanks for providing a test scenario. Do you at least remember the kernel version (5.18 or 5.19)?

In case you must rely on the functionality, forget about the mini UART. Use ttyAMA0, disable debug console and change the pinmux to the pinheader. Contact the Raspberry Pi documentation about this.
lategoodbye
 
Posts: 116
Joined: Sat Dec 29, 2018 1:24 am

Re: serial port issue

Postby df8oe » Fri Aug 19, 2022 6:19 am

Kernel version was 5.19. I have run vanilla kernel for about 1 year. There were issues from time to time (e.g. does not start without connected monitor) but all have been fixed. But this new one drove me crazy. It was definitely something in USB handling. I attach a RAID1 array via USB. First thing that popped up: sometimes booting hangs at identifying the device as a hdd. I have to power down and up again the drives incl. controller and then booting finished. But the USB handling seems to be unstable.

Thanks for your hint to "remapping" ttyAMA0 pins. I will take a look at the documentation.
df8oe
 
Posts: 57
Joined: Fri Oct 01, 2021 5:10 pm

Re: serial port issue

Postby lategoodbye » Thu Aug 25, 2022 5:05 pm

Since you report those kernel panics also occur with the linux-rpi, i've some questions:

1. Are you able to provide those kernel panics so we can see where the issue occur?
2. How is the RAID1 array connect to the Raspberry Pi 3 (directly or via powered USB hub)?
3. What kind of PSU do you use for the Raspberry Pi 3?
lategoodbye
 
Posts: 116
Joined: Sat Dec 29, 2018 1:24 am


Return to ARMv8

Who is online

Users browsing this forum: No registered users and 3 guests