Play the Raspberry Pi 3--Serial port problem Solving

Source: Internet
Author: User
Tags config

Buy Raspberry Pi 3, want to play through the serial console

The results found that the serial port is not available

This means that during the boot process, you don't see those strings printed, and then you can't use the serial console


Checked the relevant articles on the Internet.

The main reason is that the Raspberry Pi 3 with Bluetooth function, and the Bluetooth module is connected through the hardware serial port UART0/TTYAMA0

There is also a software serial port Mini-uart (ttyS0), but can not produce a stable frequency, because the software serial port frequency is related to the CPU frequency

Because the Raspberry Pi official, not only did not announce the circuit diagram of the board, but also can not find the CPU BCM2837 chip manual

So don't think about how to make this problem even better from a hardware perspective.

So, from the perspective of software to solve this problem


Related articles on the Internet, there are many, some of the final results, but also can use the serial console can be used up, to achieve the purpose

But the problem is that some write a lot and add unnecessary parts to it.

Some seem to be very concise, but in accordance with this method to solve, and did not achieve the purpose


I'm going to summarize some of the articles on the web.

Some steps are mentioned, some of the steps are some articles, some articles are not

If this is a sequential logic, then how to extract the necessary steps, and then in a certain order to implement, is the key to solve the problem


To sum up, there is this step, which is mentioned by everyone:

1.sudo systemctl Disable Hciuart

2.DTOVERLAY=PI3-DISABLE-BT---/boot/config.txt

3.edit/lib/systemd/system/hciuart.service
and replace ttyAMA0 with ttyS0
4.DTOVERLAY=PI3-MINIUART-BT---/boot/config.txt

5./boot/cmdline.txt

So the question is, are these 5 steps necessary, and are there time periods between these steps?


The solution to the problem, or from the most fundamental/boot/overylays/readme:

*******************************************************************************************************

Name:pi3-disable-bt
Info:disable Pi3 Bluetooth and restore uart0/ttyama0 over GPIOs & 15
N.B. To disable the SYSTEMD service, that initialises, the modem so it
Doesn ' t use the UART, use ' sudo systemctl disable Hciuart '.
Load:dtoverlay=pi3-disable-bt
Params: <None>


Name:pi3-miniuart-bt
Info:switch Pi3 Bluetooth function to use the Mini-uart (ttyS0) and restore
Uart0/ttyama0 over GPIOs & 15. Note that this may reduce the maximum
Usable baudrate.
N.B. It's also necessary to Edit/lib/systemd/system/hciuart.service
and replace ttyAMA0 with ttyS0, unless the a system with UDEV rules
That's create/dev/serial0 And/dev/serial1, in the which case use
/dev/serial1 instead because it'll always be correct. Furthermore,
You must also set core_freq=250 in Config.txt or the Miniuart would not
Work.
Load:dtoverlay=pi3-miniuart-bt
Params: <None>

*******************************************************************************************************


In fact, in this readme, how to use the hardware serial port, write very clear.

I wonder if you can solve it in two steps.


Being an engineer for so many years, came to a conclusion that doing a lot of projects is certainly a good thing

You will find that there are many engineers, age is not small, interview, resume also written on a lot of projects, seemingly have a very rich work experience, experience is very broad, knowledge is also very broad

But as soon as he had a problem, he was flustered, and there was no clue.

The fundamental problem with this situation is that he is just doing things, having no time to think, and having a good workout on the problem from appearance to root cause.


Therefore, the project is not many, but in the fine ...




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.