Raspberry Pi (Raspberry Pi 3) system programming and use

Today we will explain the programming and use of Raspberry Pi 3 step by step in detail. Raspberry Pi 3 is a relatively advanced ARM development board with a high degree of integration. It is rich in functions. Let's first take a look at its structure and the respective uses of the 40 GPIO ports, so as to avoid mistakes in wiring.



We first log in to the official website of Raspberry Pi https://www.raspberrypi.org/downloads/ to download the raspbian system. It is recommended to download the full version of Niu for subsequent learning. Download the one on the right, download and unzip to get the image file.




After downloading, we need to insert the SD card (above 16G) into the card reader. At this time, we need two auxiliary small applications, one is SD Card Formatter to format the SD card more cleanly, and the other is win32diskimager for convenience We flash the system to the Raspberry Pi. Be careful not to write the wrong path when formatting, then find the system image we just downloaded and write it to the SD card.



After we burn the system, we will see that the U disk becomes a boot with only 40 MB.




Then an important modification came. The new version of Raspberry Pi 3 is different from the previous one. We need to make the following modifications before it can be used normally.

1. Download the pi3-miniuart-bt-overlay file, extract the pi3-miniuart-bt-overlay.dtb file, and copy the dtb file to the /boot/overlays/ directory

2. Edit the config.txt file in the /boot directory and add the following two lines

dtoverlay=pi3-miniuart-bt-overlay

force_turbo=1

3. Edit the cmdline.txt file in the /boot directory and modify it with reference to the following content:

dwc_otg.lpm_enable=0 console=serial1,115200  console=tty1 root=/dev/mmcblk0p2  kgdboc=serial1,115200 rootfstype=ext4 elevator=deadline fsck.repair=yes  rootwait

4. Add the ssh text file under boot, and then remove the file suffix. save and exit

Then we can connect the Raspberry Pi. The GND, txd, and rxd of the serial port of the Raspberry Pi are connected to the GND, rxd, and txd of the transfer interface respectively. The network cable connects the adapter to the computer, and it can be found in the Ports option on the computer's device manager. The red light of the Raspberry Pi is always on, and the green light flashes intermittently.

If there is no port option in the device manager, please add outdated hardware in the operation option, if it still does not, please install the cp210x vcp driver.




We use secureCRT to run the Raspberry Pi system, first download secureCRT, open options and select session options option, pay attention to my settings, my interface is com3.

After that, quick connect also matches it, fill in the same interface and speed, and confirm the connection.




Wait for a moment, our system starts to run, the default user name of the system is pi, the password is raspberry, type in one after another, and our system is installed like this.


Finally, if you are familiar with vim editing, you can download vim and enter   sudo apt-get install -y vim



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325580686&siteId=291194637