When we are going to use the UART Rx and Tx pins of Raspberry Pi device for some purpose like communicating with an external device, we face a little problem. Linux operating systems send it's kernel messages in boot time to the serial port. Additionally it allows the user to login to the system though a serial console provided though the UART pins. Therefore when we use the UART pins for some other purpose we may get data belongs to the operating system.
After searching the web, the solution I found is to disable this Linux kernel messages coming to the UART port and also the serial console login facility. Here's how I did that.
To disable kernel messages coming to the UART port, open the following file by issuing the command,
sudo nano /boot/cmdline.txt
Edit the content of the file by removing all the parameters which involve ttyAMA0 device. So, the resulting content would look like the following.
dwc_otg.lpm_enable=0 rpitestmode=1 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
Now save and exit from the nano editor.
To disable the serial console through the UART port, open the following file by issuing the command,
sudo nano /etc/innitab
Find the following line in that file.
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
Now add a '#' character in front of that like to comment that out so that it looks as follows.
# T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
Now save and exit from the nano editor. After editing these two files we are done. When the next time you reboot the Raspberry Pi, you will be able to use the UART port without any disturbance from system level.
After searching the web, the solution I found is to disable this Linux kernel messages coming to the UART port and also the serial console login facility. Here's how I did that.
To disable kernel messages coming to the UART port, open the following file by issuing the command,
sudo nano /boot/cmdline.txt
Edit the content of the file by removing all the parameters which involve ttyAMA0 device. So, the resulting content would look like the following.
dwc_otg.lpm_enable=0 rpitestmode=1 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
Now save and exit from the nano editor.
To disable the serial console through the UART port, open the following file by issuing the command,
sudo nano /etc/innitab
Find the following line in that file.
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
Now add a '#' character in front of that like to comment that out so that it looks as follows.
# T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
Now save and exit from the nano editor. After editing these two files we are done. When the next time you reboot the Raspberry Pi, you will be able to use the UART port without any disturbance from system level.
No comments:
Post a Comment