From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Hobbyist Toolkit

Showing results for 
Search instead for 
Did you mean: 

Can I use more Uart on Raspberry Pi CM4

Go to solution


    I am using raspi Cm4, as the documents stated out Cm4 exist 5 uart and i enable and dtoverlay uart2,uart3. however, in labview linx device not able to use them. how can i fix it?  

uart error.PNG

0 Kudos
Message 1 of 8
Accepted by topic author Billy.Deng

The number of UARTs that Linx supports are hardcoded in the library. But you are trying to use VISA instead and that should support additional serial ports IF they are properly installed in Linux. There is a potential issue with VISA recognizing those UART channels though. Traditionally Linux installs serial ports as ttyXXXYY in the /dev tree. XXX depends on the serial port driver that is used to access them and YY is an increasing number. Linux also likes to install many pseudo ttySomething devices that are not real serial ports, so VISA can't just go and try to detect every device starting with tty in its name. You would end up with several dozen VISA serial ports that can not be used for communicating with anything useful.


So you need to do some work on your Raspi.


First complication is that the environment the LabVIEW executable runs in is not directly the Raspbian host OS but a sort virtual machine running inside your host OS. This uses the Linux chroot system.


So you need to open a command line shell on your Raspi and then change into that chroot subsystem:

sudo schroot -r -c lv

This will change the prompt to indicate that you are now operating inside the LabVIEW chroot environment. 


Once you are in there you need to verify a few things about VISA.


Points 1 to 3 should not be relevant. If that was not correctly setup you could not even connect to the ASRL1 port.


Rolf Kalbermatter
My Blog
Message 2 of 8

Hi Billy
Did you solve it? I have same problem but I wanna use UART3 in CM4.

0 Kudos
Message 3 of 8

yes, i did. please go back to see the solution.

0 Kudos
Message 4 of 8

I read Rolfk's solution but it seems that in LINX just first serial (Serial0) is defined (Maybe because LINX is written for Raspberry 2 & 3). 

I activate UART3 and use it with python so my hardware works fine but in LabVIEW(LINX) I can't make it.

(UART1 works fine & charm.)

Did you change Raspbian parameters (like config.txt or cmdline.txt or...) ? Could you send for me your steps in Raspbian & your VI? ‌‌‌‌

0 Kudos
Message 5 of 8

i just follow that and you need config overlay pins. then everything goes well

0 Kudos
Message 6 of 8
Thank you for your time.. Is this correct? dtoverlay=uart3,txd3_pin=4,rxd3_pin=5
0 Kudos
Message 7 of 8

Finally, I get my desired goal with these steps:
1- The kernel use of the serial port must be disabled in /boot/cmdline.txt file by removing this flag:


So, it should be something like this:

         console=tty1 root=PARTUUID=295be2ff-02 rootfstype=ext4 elevator=deadline rootwait
2- Add these flags in the /boot/config.txt file (if you want to use UART3):



Or these “dtoverlay” if want to use UART4 or UART5:


3- In your VI, when configure VISA port, use this syntax:

4- Use “VISA Find Resource” before read or write on VISA.





0 Kudos
Message 8 of 8