loading

MCU Knowledge Is One of the Foundations of Linux Driver Development

This is the wiki text version of lesson 1 and lesson 2 of arm bare metal phase 1 enhanced version.

Why do you want to learn SCM without a future?

Because it's a good entrance.

Learning MCU can let us put aside the complex software structure and master the hardware operation first, such as looking at the schematic diagram, chip manual, writing program operation register, etc. In the last video, I just belittled the single chip microcomputer to nothing, saying that the single chip microcomputer has no future. In this video, I want to tell you that if there is no future, you should also learn the single chip microcomputer. Why?

First of all, I don't need to learn MCU, which means don't use the old learning methods to learn MCU. What is the old way?

·Hardware: do not use C51, STM32 these special MCU development boards. If you don't plan to engage in MCU development in the future, why do you use these chips? After studying for two or three months, you can use these registers clearly, and you can't use them. It's unnecessary.

·Software: do not use KEIL, MDK and other highly integrated software. If you use these software, you can write main (), and then call various libraries for fool operation. These easy-to-use tools encapsulate many technical details, making it impossible for us to understand the essence of bare metal and single chip microcomputer.

In the future, we will use a new set of methods to develop MCU. A new set of methods will be introduced later.

The reason why we have to learn MCU is that its knowledge is still useful for us to learn Linux. Let's first look at what a Linux system is all about. Software composition of an embedded Linux system: MCU bootloader – > linux driver – > linux app – > linux GUI (Android / Qt). When our PC is powered on, the BIOS will be displayed on the black screen. The purpose of this BIOS is to start the windows kernel. The windows kernel then mounts Disk C (system disk) and disk D (application disk), and finally starts applications, such as QQ and online games. Similarly, our Android phones or industrial control devices also have BIOS, but the embedded Linux system is not called BIOS, but bootloader. Its purpose is to start the Linux kernel. It first identifies the storage device where the application is located, mounts the root file system (Disk C and disk D in Windows system, called root file system in Linux), and finally starts the application.

Carefully analyze the bootloader. It starts the kernel. Where does it start the kernel? Obviously, it reads the kernel somewhere. For example, BIOS reads the windows kernel from disk C, and our bootloader reads the kernel from flash or SD card. Therefore, bootloader should have the ability to read flash or SD card. Some bootloaders also display logo, so it also has the ability to operate LC D. bootloader also needs to set the environment of the development board, such as initializing the clock, initializing the memory, and setting the network card. So many things are implemented in bootloader, which is too complex. It is very difficult to analyze the whole bootloader when you come.

So how do we learn? Take it apart and write a separate program, such as LED lighting, clock, network card and flash. These are single-chip microcomputer programs. Therefore, bootloader is a complete collection of single-chip microcomputer programs. In order to better learn bootloader, we should practice the hardware one by one in advance. When we are familiar with each hardware , and then combined, it's a bootloader.

Let's take another look at bootloader. After bootloader starts the kernel, the kernel mounts the root file system, which means that the kernel also has the ability to operate the hardware, which is the driver. First, let's take a look at a simple driver. First, our application calls open(), read(), write() These standard interfaces are used to access the hardware. Then enter the driver, which has the corresponding drive_open(), drive_read(), drive_write(). Finally, configure the hardware in the driver. For example, for an LED lighting driver, drive_open() should set the GPIO as the output pin, drive_read(), return the GPIO status, and driver_write() Write GPIO and let the pin output high level or low level.

For our LED driver, you need to provide drive_open(), drive_read(), drive_write(). This is its framework. The specific operation of hardware is hardware operation. Therefore, we are familiar with and master the hardware operation in the single chip microcomputer in advance. That is, the composition of the driver:

Driver = software framework hardware operation

You need to learn to see the schematic diagram, how to connect the hardware, read the chip manual, and know how to read and write registers. All these can be learned and mastered in the single chip microcomputer. When learning linux driver in the future, focus on the software framework.

We can learn single chip microcomputer in advance. The learning of single chip microcomputer allows us to put aside the complex software structure and master the hardware operation first, such as looking at the schematic diagram, chip manual, writing program operation register, etc. This is why single chip microcomputer has no future, and we also need to learn. It is because the hardware operation involved in it is very useful for our subsequent learning.

Now we know that we learn MCU not to master the development skills of MCU, but to master bootloader and hardware operation.

Original post transferred from: http://bbs.elecfans.com/jishu_1544437_1_1.html

MCU Knowledge Is One of the Foundations of Linux Driver Development 1

GET IN TOUCH WITH Us
recommended articles
Related Blogs Info Center
Insights network launched the install blockchain, which is one of the most unique blockchain technology use cases seen in the world. In this article, we will discuss...
Reasons why we should impose tariffs on goods from China...?I really see no good so I will give you things to prepare for. 1.) Trade is good for everyone 2.) This wo...
On March 8, the new surface Pro X was officially launched in China. As Microsoft's lightest, strongest and most connected surface product so far, surface Pro x adopt...
Well there is a lot of empty space in an atom.They actually say that if you take all the space out of atoms then the Empire State building would shrink to the size o...
Beijing, August 4, 2011 - Texas Instruments (TI) recently announced the launch of a 50 Ma, 60 V synchronous swift â„¢ The step-down regulator can pr...
Since the outbreak of the epidemic, health codes, online diagnosis and treatment, infrared thermometers, etc. have been gradually known by the public. They share a "...
Both begin with S.And the word Soul also begins with the letter S as well.Songs have hooks, bass lines, riddim, lyrics, chord progression, solos and song structure.S...
Recently, the Ministry of education, the national development and Reform Commission and the Ministry of Finance jointly issued several opinions on building "double f...
As users and enthusiasts of traditional cars, facing the rapid development of new energy vehicles, there will indeed be a period of pain. However, from a macro persp...
Displays and awards gained at the Queensland ExhibitionNov 1875: Silver medal, value 3: J. W. Sutton, smelted tin. Certificate of merit: J. W. Sutton, mineral cabine...
no data
Contact Us
Contact Person: AI customer service
Tel: +86 0757-23368757
Address: No.4 Of Xingye Road, Shafu Industrial Park, Longjiang Town, Shunde District, Foshan 
WHATSAPP: +86-15919090839
WECHAT: w87735492
Better Touch Better Business
Contact Sales at JuJiao.
Call Us
+86 0757-23368757
  
Customer service
detect