question

mtnscott avatar image
mtnscott asked

rpi 3b Venus OS: Can you disable the GPIO UART console so the GPIO UART can be used for other devices?

Hi,

I have been researching the Venus OS on Raspberry PI 3b. I am trying to use the GPIO UART for an additional device but it appears that the default behavior on the Venus OS is to use this for the serial console. Most of the standard raspberry pi configuration tools are not present so I was hoping someone could help with how I can change the Venus configuration to NOT put the console on the GPIO UART pins.

Venus OS
3 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

jeroen avatar image jeroen ♦ commented ·

indeed, the uart1 is used as console.

0 Likes 0 ·
mtnscott avatar image mtnscott jeroen ♦ commented ·

Can this be changed by changing the 'console=ttyAMA0,115200' command line reference?

0 Likes 0 ·
Show more comments
1 Answer
mtnscott avatar image
mtnscott answered ·

For anyone interested in this topic, I thought I would post my learning -

Studying the raspberry pi build 2.6x - I've made some progress but still running into console messages on the GPIO UART

1. it uses busybox on jessie so much of the standard rpi tools are just missing

2. the console is hard coded into the .elf startup binaries located in /u-boot

console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait

3. the boot already swaps the PL011 with the miniUART so that may impact the bluetooth implementation. This also enables the PL011 aka /dev/ttyAMA0 device to be present on the GPIO pins as indicated in the /u-boot/config.txt. If you want to use the UART for other communications add this line to the config.txt file

enable_uart=1

before this line

dtoverlay=pi3-miniuart-bt

4. To change the boot environment variables to change the console from ttyAMA0 you need to comment out the following line in /u-boot/uEnv.txt

#console=ttyAMA0,115200n8

5. if you wish to use the GPIO UART then you will also need to stop the getty process from taking any data from the /dev/ttyAMA0 device stream. Comment out the following line in the /etc/inittab file by adding '#' to the beginning of the following line

#AMA0:12345:respawn:/sbin/getty -L -l /sbin/autologin -n 115200 ttyAMA0 vt102

In summary -

I suspect until we can get the hardcoded console assignment out of the .elf binary files in the /u-boot directory we will still get messages injected on the GPIO UART stream.

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

aquaeatrae avatar image aquaeatrae commented ·

Thanks!

I too would prefer to utilize the Pins 8 & 10 UART for a HAT (4G cellular / GPS)... but with a Raspberry Pi Zero 2 W in my case. I've installed Venus OS v3.00-39 and I successfully enabled wifi and bluetooth by swapping Broadcom drivers.

https://community.victronenergy.com/questions/144249/no-wifi-on-pi-zero-2w-venus-os-v29016-and-14.html?childToView=192441#comment-192441


FWIW: I found a few differences with this newer version Venus at least on my Rpi Zero 2 W but I suspect I may have achieved the same.

I do still see console hardcoded in the elf files. I'm not sure how those work or what complications exactly they may cause.

https://www.raspberrypi.com/documentation/computers/configuration.html#start-elf-start_x-elf-start_db-elf-start_cd-elf-start4-elf-start4x-elf-start4db-elf-start4cd-elf

I too inserted the line into /u-boot/config.txt under the [pi02] section, just above the dtoverlay line.

enable_uart=1

However, I did not find a /u-boot/uEnv.txt file as you had. Instead, I edited the file /u-boot/cmdline.txt to remove the console option I found there. I don't know if this perhaps disables or inhibits access for those references you spotted in the elf files or is independent of them.

Before:

dwc_otg.lpm_enable=0 console=serial0,115200

After:

dwc_otg.lpm_enable=0

Lastly, I found and commented out the AMA0:12345 line from the /etc/inittab just as you had.

#AMA0:12345:respawn:/sbin/getty -L -l /sbin/autologin -n 115200 ttyAMA0 vt102

Testing remains to be done. At least I didn't brick the little board. It still boots normally, connects with wifi and bluetooth.

Hoping this works... and perhaps helps others trying to squeeze all they can out of their Raspberry Pi.

PS: According to the Documentation, the boards each have different primary and secondary UART controllers.

https://www.raspberrypi.com/documentation/computers/configuration.html#primary-and-secondary-uart

0 Likes 0 ·

Related Resources