Whenever we get started (ARM is like this, DSP is the same), there will always be many questions and concerns. We are eager to know what the prospects of learning STM32 are? What foundation is needed? Is it difficult? Is it suitable for me? But when can we start learning STM32 with excitement and anxiety? Days pass by day by day! Have you started to act? Without thinking about action, you will never get started! Use this time to read books, the effect will be 10,000 times better.
Everyone generally comes from 51 single-chip microcomputers. Think back, how did we get started when we learned single-chip microcomputers before? In fact, we all read books first (theory) and then play with boards (practice). Strictly speaking, it should be an imitation experiment. Only after familiarity will you write program code to implement a certain function. Therefore, if you are consulting STM32; if you are excited about STM32; if you want to get started with STM32; then, from now on, don't hesitate, don't think about the prospects of STM32 in detail. Make a decision that may affect your life! No need to consult, no need to get excited, just start reading books (documents). Everyone has come this far.
The so-called "materials" here include STM32 books and documents. Because STM32 has a feature that many datasheets are in Chinese, some students did not buy books and directly read the STM32 user manual. However, whether reading books or documents, we need a plan. It is not to read 3 pages today and 5 pages tomorrow. I have been reading a book for two months and I am still procrastinating. Please remember that you are not learning loneliness, but STM32! Reading books or documents is not a way to kill time. Fight a desperate battle and set a bottom line for yourself: go through it roughly within two weeks! It is not required to understand everything. In fact, it is impossible to understand everything. But we must understand the basic knowledge and have an impression of the difficult knowledge. At least when we encounter problems in the future, we will feel familiar and feel that we have seen it somewhere, so we will look up the information and search for answers on the Internet. When we have questions, the efficiency is super high.
Two weeks have passed. Have you gone through the knowledge of STM32? Not finished? Then, you should consider whether you have tried your best in these days? Do you really want to learn STM32? Or do you still want to follow the trend after seeing the popularity of STM32? Do you want to give up when you encounter a problem that you can't solve? Now is the time for you to make the second decision, please decide whether to continue studying STM32. If you want to follow the trend on impulse, please give up immediately - you have wasted two weeks, do you want to waste another 14 days? If you want to endure hardships and become a superior person, OK, please continue reading:)
After understanding some theoretical knowledge, there are two ways in front of you:
first, draw the PCB board, weld, and debug by yourself.
Second, buy a cost-effective development board.
The author has done PCB design several times before, and at that time, all expenses could be reimbursed in the laboratory, so he made a PCB board by himself. It is recommended that students who have reimbursement conditions design a board to learn by themselves. After all, the design of a 2-layer PCB is not very difficult.
Students who cannot be reimbursed can choose to buy a development board to learn. Because you need to pay for the board yourself, it will cost at least 150 yuan, plus the cost of chip components and LCD screen, it may cost about 250 yuan to make the smallest system. So it is more cost-effective to buy a development board. After all, the STM32 development boards on the market are now very cheap. It is not convenient to compare the STM32 development boards of various brands here.
In a word, the development board you choose must be the most cost-effective and the most affordable, not the most expensive. In fact, most students choose development boards for learning, not for project development. Therefore, the purpose of getting you started with STM32 has been achieved.
At this time, you can no longer stay in theory. Your current mood should be: seeing the development board, you immediately feel an indescribable excitement! However, you can't eat hot tofu in a hurry! Please patiently browse the development board user manual provided by the manufacturer and familiarize yourself with the development board you bought. According to the user manual, do all the relevant tests and operation steps on the development board, and you will find that it is so simple to develop STM32! So let's start the road to STM32 development!
For how to really get started with STM32, please see Chapter 2 "STM32 Getting Started".
Chapter 2 Getting Started
There is a common phenomenon among domestic users: after getting the development board, they don't know how to start. Because they don't have their own ideas, they are beginners and don't have a good breakthrough. Therefore, after buying the development board, they turn it on, look at the touch screen, sigh at the "beautiful" screen display, and then they are confused. The development board will not tell you how to use it. The CD of the development board? There are a lot of materials on the CD-ROM-which one should I read first? Which one should I read later? In short, how do I start learning STM32? ?
In response to this phenomenon, the Xinda STM32 development board provides detailed instructions for beginners. Please do two things after purchasing the Xinda STM32 development board:
1. Power on the development board to check whether the development board and LCD display are running normally (the HEX download test function needs to be learned after J-Link).
2. Follow the introductory textbook series we compiled step by step. This set of tutorials took more than two months from conception to writing. The content of the tutorials: from how to install J-Link and MDK (keil) debugging software after getting the development board, to the final UCOS porting on STM32, each document strives to explain in a popular and detailed way, so that you can get started with STM32 faster. With a special supporting tutorial, you will take fewer detours in the process of learning STM32 and improve your learning efficiency. In short, it will take you into the wonderful world of STM32! We believe that with your hard work, it will take less than a month to independently carry out simple STM32 development! (There are claims on the Internet that you can learn STM32 in just x days, but I think it is difficult. I have been engaged in STM32 development and have been teaching for a while after resigning. However, I dare not say that I have learned it all. I am just a rookie. I think I am an advanced rookie.)
Before doing anything, I am used to writing a plan-maybe when I was in the company, I had to write plans and summaries every day, every week, and every month. Haha. As mentioned in the previous section: We need to get started with STM32 within a month! We began to think about how to make better use of this month? I remembered the scene of joining the company on the first day. My work mentor asked me to get a PC, install the necessary software, and then told me what the task was for the next month. At that time, I was very disdainful because I had just participated in the training organized by the company and thought I knew everything, but failed. Reason: Blindly carry out the project without a plan.
Days without a plan will be miserable. It's like waking up and opening your eyes every morning, but you don't know what you are going to do today. Without further ado, let's talk about plans and schedules.
The author believes that learning STM32 is actually the process of carrying out a project. To carry out a project, you must have a project progress document, at least you need to estimate the time it takes to carry out the project. Although it is not so standardized, it is recommended that you at least give yourself a timetable: tell yourself that from x month y day, 2010 to m month n day, 2010, you must be able to carry out independent project development. For example, set it as 30 days, and divide this time into three stages:
Stage 1: Find the feeling-when talking about STM32, immediately react to how to debug. The second stage: modify the routine -
The third stage: take the initiative to attack -
After each stage has a goal, break down the goal into daily tasks and write down the tasks to be completed every day. Note that there should not be too many tasks every day, otherwise the time is too tight and the tasks of the day cannot be completed. Instead, it will enter a vicious cycle, resulting in the inability to complete the tasks of the second day, the third day, and the subsequent days. Eventually, the entire plan will fail.
The daily tasks need to be determined according to your specific situation. If there is enough time, you can arrange more tasks. If there are only 2 hours a day, remember that it is better to arrange fewer tasks than to pursue speeding up the project progress. Of course, when you have something in mind, you will naturally be busy every day! Your study life will be more fulfilling!
Learning will inevitably encounter problems. When participating in training in the company, the trainees were told: Difficulties are opportunities. So I hope everyone will face the problems calmly and not escape. A small number of students always think when they encounter problems: Can I avoid taking another path? For example, when debugging a program, if the syntax of a program is not well understood, I want to use another representation method to replace it, or comment it out directly. - This is terrible. Because once you let go of a problem now, it may mean that you may never have the opportunity to touch this problem in your life. Then your technology cannot reach the highest level. We are here to learn. To put it bluntly, our current efforts are to get better returns in the future.
In addition, when you encounter a problem, you cannot ask for help everywhere immediately. Reasons:
1. This question may be your question, but it is not specific yet. You cannot use the best language to make others accept, understand, and answer it. Many netizens will not answer when they see ambiguous questions. For example, how to transplant Linux? If you explain this question in detail, you need to use half a book to explain it-no one is willing to spend two or three hours to tell you how to transplant. So at this time, what you have to do is to look up information first and try to solve it yourself. When you encounter a specific step and you really can't figure it out, such as the file mounting and printing stuck during the Linux transplantation process. This phenomenon may be pointed out by experienced people in one sentence. And because you have the foundation of previous research, you can know where the problem is as soon as you hear it. This way, the learning efficiency is the highest.
2. The CPU is interoperable. I believe that most students have studied microcontrollers and have a certain foundation. If you encounter a problem, try it, and solve it yourself, you will feel a sense of accomplishment! ! Because this is the result of your independent thinking! ! Of course, you should write a summary document and save it in your PC for memo. You can also post the summary document on the forum (for example: http://www.eetrend.com/forum ). Such original documents have the highest rate of comments. Slowly, you have a network reputation in this field. ——This is definitely a fortune.
Of course, the author is not here to stop you from using other ways to discuss problems. On the contrary, I encourage everyone to speak up and discuss actively. Just now I was talking about the matter, and it was also my own little experience. Only after experiencing it, I found out how to do it more efficiently. [page]
Chapter 3 Learning Steps
In Chapter 2, we have already talked about the need for learning plans. So, in this chapter, we will elaborate on this plan in detail - for reference only. The author is an embedded enthusiast and a learner. He is not an expert, but a novice, an advanced novice.
In this tutorial, we assume that everyone has a certain understanding of STM32 books or documents. If you don’t understand, please read the STM32 documents immediately to obtain the most basic knowledge points.
There is a big difference between learning STM32 and learning ARM9. Learning ARM9 generally requires the purchase of books. For example, the official documents of Samsung's S3C2440 are all in English, and most engineers can only read books published in China. Students who are good at English, please don't think you are great and can only read English documents. After all, you are Chinese, and you are most familiar with and understand the best Chinese. The speed of reading English is still slower than reading Chinese. What we want is the shortest time, not the pursuit of remembering all the details in a short time. Of course, if it is a paper, it is recommended to read the original English version.
When the STM32 processor entered the domestic market, ST official (or third party) did a very good job of promotion. A large number of English documents have been translated to cater to the thinking of many domestic engineers. So now most of the STM32F103xxx user datasheets have Chinese versions. Therefore, you don't need to buy books, just read the electronic files. Of course, friends with strong financial conditions can buy this book~
When studying, pay attention to two more important documents:,
"STM32F103xxx Reference Manual" and "STM32 Firmware Library User Manual". All official Chinese and English documents of ST can be downloaded from ST's China ***** area website:
http://www.st.com/web/en/home.html
This website is for students who have sufficient time and energy. It is recommended to download the documents you need to consult for more information.
When reading the "STM32F103xxx Reference Manual", you must pay attention that you don't need to read it all - there is no time. It is recommended to read it selectively, but the first few chapters must be read. The first few chapters of memory and bus architecture, power control, backup registers, reset and clock control, general and multiplexed function I/O, interrupts and time, etc. must be read in time. The following
chapters describe the specific functional module design. If we use a module, we can read that module. For example, when using AD, we need to read Chapter 10 ADC. No other examples are given. I believe that every beginner has his own research direction and judgment.
Reading the "STM32 Firmware Library User Manual" is mainly to simplify programming. STM32 provides us with a very good firmware function library, we just need to call it. Of course, we can also not touch these firmware libraries - it is said that using them will make the code less efficient, which makes sense. There are also many codes written by netizens on the Internet, which do not use the firmware library functions. How to choose depends on your choice.
Here I mainly emphasize that when reading the "STM32 Firmware Library User Manual", the first few chapters must also be read. For example, the naming rules and encoding rules in the first chapter of the document and library specifications, these are all things that need to be paid attention to. Chapter 2 is the most critical, and I hope everyone will read it carefully. Chapter 2 describes the architecture of the firmware library, how we use the firmware library, etc. With the foundation of Chapter 2, we can write our own code with the help of the firmware library. After starting Chapter 4, you can read according to your needs. In fact, the subsequent chapters all describe what functions a certain module has, how to use each function, etc.
Regarding the following chapters, it is recommended to be familiar with the GPIO library functions, interrupt library functions, reset and clock setting library functions, because they are often used in daily life.
The two documents mentioned above are enough for you to read, haha. I hope you can get a lot of basic knowledge of STM32 from them.
1
2
If you only have spare time to study STM32 every day, it is recommended that you arrange your time according to your specific situation. After all, if the planned time is too tight, it will not achieve good results and will only enter a vicious circle, which is what we want to avoid.
However, it is recommended that you make a plan for yourself regardless of whether you have enough time or not.
Here is an idea for reference only.
Step 1. Install the STM32 learning software, such as J-Link, KeilforARM (MDK), and ISP (if you need to download from the serial port). For detailed steps for installing these software, please refer to the corresponding tutorials we have launched.
Step 2, select the HEX of some routines, such as the HEX file of the LED lamp routine, download it to the Xinda STM32 development board, and observe the flashing of the two LED lights. For this part of the operation, you can refer to the corresponding tutorial we launched.
In fact, the above two steps are just to familiarize yourself with the tool software to be used. It belongs to the stage of finding the feeling. In fact, we haven't started learning STM32 yet!
Step 3, prepare several commonly used documents, such as "STM32 User Manual", "STM32 Firmware Library User Manual" and other documents. For daily reference. These documents can be found in the chip manual directory in the CD.
Step 4, start to check the writing of the routine, see how the routine is written, and whether you can modify the routine to achieve the effect you want? The CD of the Xinda STM32 development board provides you with a wealth of routine codes for reference. You can definitely modify a more exciting routine!
Step 5, do you need to try the transplantation of Ucos-II?
Congratulations, at this point, you can already freely carry out independent development. The last step is to give yourself a goal (project) and realize it!
Once again, the above is just an idea for learning STM32 for your reference. The following lists the key steps in the previous steps, and I hope you can get started as soon as possible. For the programming of each subsequent module, please refer to our Xinda STM32 Getting Started series of tutorials.
Step 1: Familiar with the debugging software
For beginners, we need to install at least two software: J-Link driver software and MDK (the original Keil) software. These two software, with the words in "Country Love", "Must!"
The process of installing the software will not be repeated here. You can refer to our tutorials "How to Install J-Link Driver Software" and "How to Install MDK (Keil) Software".
How to verify that you are familiar with the operation of the debugging software? It's very simple. The Xinda STM32 development board CD comes with many HEX format files. You can select some HEX files to observe the running results. For example, the routine HEX file of the LED light is downloaded to the Xinda STM32 development board and observe the flashing of the two LED lights. The light is flashing, which means that your previous operation has burned the HEX file into the flash memory.
The goal of this step is to be familiar with the debugging software. If there is a problem when burning HEX, you can simply identify the problem and solve it independently.
Step 1: Programming
This is the first time to contact the programming of the firmware library. You must bite the bullet to understand the firmware library. It is recommended that you try to use the firmware library. Instead of avoiding the firmware library and writing the code yourself-this can only happen during learning. In actual projects, there are hundreds or thousands of codes. How to write them one by one? Calling the functions in the firmware library to complete them is the way of the king. The programming of
GPIO
1. Set the pin of the GPIO port to input or output mode. When we are performing the lighting code, it is generally set to push-pull output mode.
2. Operate the register, set or clear the register-this step, the firmware library has provided a special GPIO_SetBits function and GPIO_ResetBits function, we only need to call it to realize the setting and clearing of the IO port.
3. Realize a variety of LED flashing patterns to make yourself familiar with the GPIO programming process.
However, when calling the firmware library, we also need to pay attention to GPIO structure declaration, structure member initialization, system clock configuration, etc. You can refer to the "GPIO Programming" document we launched. The
goal of this step is to be familiar with the debugging software. If there is a problem with burning HEX, you can easily identify the problem and solve it independently.
Start a new in-depth study
After getting familiar with the above debugging software and programming and debugging the GPIO port, I believe you have a certain understanding of STM32. At least you know how to use the STM32 firmware library to write a code. OK, let's start a new in-depth study of STM32. At this stage, you will be exposed to serial port programming, TFT LCD driver programming, timer programming, serial peripheral interface SPI programming, memory programming, SD card and file system transplantation, USB reading and writing, UCOS transplantation, etc. If you have the energy, you can also study other peripherals.
Due to the length and subject limitations of this tutorial, how to program each module is not explained in detail here. Please refer to our Xinda STM32 Getting Started Series Tutorial, which is written according to this idea.
Finally, I wish you all to become STM32 masters as soon as possible!
Previous article:Design of GPS automatic positioning system based on MiniGUI
Next article:Application of STM32 MCU in alcohol detector
Recommended ReadingLatest update time:2024-11-16 15:34
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Oscilloscope probe compensation principle - explain the fundamental reason for oscilloscope probe compensation calibration
- About c0_init_calib_complete of ddr4
- MSP430F5529 generates PWM waves with CCS
- When communicating in 485 network, sometimes the slave does not return data after the host asks
- Detailed explanation of the working principle of linear regulated power supply
- Detailed explanation of MSP430F149 serial port receiving and sending program
- Embedded Development Electronic Technology Classic Data 12G
- The new TMS320F28377S cannot connect to the emulator, what should I do?
- 【EasyARM-RT1052 Review】 + cJSON transplantation and use
- EEWORLD University ---- FPGA-based SOPC development process (Intel official tutorial)