The author is Xie Enming, an official account of Programmer Union (wechat id: CoderHub). Please indicate the source of reprint. Original: www.jianshu.com/p/d59378613…

Content abstract


  1. What is embedded
  2. What is cross-compilation
  3. Getting started and improving embedded

1. What is embedded


Embedded can be said to be one of the most extensive and hot professions. So what is embedded?

This question is really hard to explain in a few words.

Embedded, embedded, embedded

Because first of all, embedded has a lot of combination terms, such as embedded system, embedded software, Linux embedded, Android embedded, embedded Web, and so on.

The common definition of embedded is actually the definition of “embedded system”.

The Chinese definition of embedded system on the Internet is really difficult to understand. The official Chinese definition is:

Embedded system is a special computer system that takes application as the center, takes computer technology as the foundation, software and hardware can be cut, and ADAPTS to application system’s strict requirements on function, reliability, cost, volume, power consumption and so on.

My personal feeling: if you have never been in touch with embedded friends, read the above definition, it is estimated that you have not seen the same, or confused. I felt the same way when I saw this explanation when I first started learning embedded.

Of course, this definition is correct, but it’s a bit pedantic, not graphic, not “down to earth”.

So how to define an embedded system grounding?

I can start by listing the areas of IT where embedded systems are currently used:

  • The Internet of things
  • Android embedded development.
  • Linux embedded development.
  • Smartphones, tablets, smartwatches.
  • Wearable devices, such as Google Glass and Xiaomi Wristband.
  • Microsoft’s Xbox and Kinect.
  • drone
  • VR headsets.
  • Wireless routers.
  • , etc.

I don’t need to list any more to feel that, yes, embedded is permeating every aspect of our lives and will be used more and more.

However, pure app development for Android and iOS, for example, is generally not considered embedded, only software development.

In the future, maybe we can have a portable wearable device that can be used for everything. In the future, you could even wear a flimsy ‘flying suit’ and go wherever you want.

Embedded programming, although the threshold of entry is relatively high, but if you can hit the embedded this “hard persimmon”, learn a lot of knowledge, then some other programming fields, perhaps can be relatively easy to master. For example, if you are familiar with C and C++, other programming languages are generally easy to master.

I thought the original English definition would be easier to understand, so I translated wikipedia’s definition of embedded systems as follows:

An embedded system is a computer system with a dedicated function within a larger mechanical or electrical system, often with real-time computing constraints. It is embedded as part of a complete device often including hardware and mechanical parts. Embedded systems control many devices in common use today. Ninety-eight percent of all microprocessors are manufactured as components of embedded systems. An embedded system is primarily a functional computer system that is contained within a larger mechanical or electronic system and usually has real-time computing constraints. An embedded system is embedded as a component in a complete device (add: this is where the term “embedded” comes from), which usually has hardware and mechanical components. Today, embedded systems control many common devices. Ninety-eight percent of microprocessors are produced as components for embedded systems.

Examples of properties of typically embedded computers when compared with general-purpose counterparts are low power consumption, small size, rugged operating ranges, and low per-unit cost. This comes at the price of limited processing resources, which make them significantly more difficult to program and to interact with. Embedded systems differ from conventional systems mainly in the following characteristics: low power consumption, small size, limited computing range, low unit cost. These features come at the cost of limited processing resources, making embedded systems more difficult to program and interact with.

Modern embedded systems are often based on microcontrollers (i.e. CPUs with integrated memory or peripheral interfaces), but ordinary microprocessors (using external chips for memory and peripheral interface circuits) are also common, especially in more-complex systems. In either case, the processor(s) used may be types ranging from general purpose to those specialised in certain class of computations, or even custom designed for the application at hand. A common standard class of dedicated processors is the digital signal processor (DSP). Modern embedded systems are usually based on microcontrollers (that is, cpus (central processing units) with integrated memory or peripheral interfaces), but common microprocessors (using external chips for memory and peripheral interface circuits) are also common, especially in more complex systems. In either case, the processors used can range from generic to those dedicated to certain computing classes, or even customized to the current application. Digital signal processor (DSP) is a general standard category of specialized processors.

Since the embedded system is dedicated to specific tasks, design engineers can optimize it to reduce the size and cost of the product and increase the reliability and performance. Because embedded systems are dedicated to specific tasks, design engineers can optimize them to reduce product size and cost, and improve reliability and performance.

Embedded systems range from portable devices such as digital watches and MP3 players, to large stationary installations like traffic lights, factory controllers, and largely complex systems like hybrid vehicles and avionics. Complexity varies from low, with a single microcontroller chip, to very high with multiple units, peripherals and networks mounted inside a large chassis. Embedded systems are found in many devices today, from digital watches and MP3 players to traffic lights, industrial controllers, hybrid cars, and aerospace equipment. The complexity of embedded system also varies greatly. A simple embedded system may have only one microcontroller chip. Complex ones have many cells, peripherals, and networks that are “soldered” onto a large “backplane.”

2. What is cross-compilation


There is also the concept of cross-compilation in embedded programming.

So, what is cross-compilation?

Cross-compiling, English is cross-compiling. Compiling is the present participle of the verb compile.

In simple terms, it means “generating executable code on one platform on another”.

Common software development process, if the compiled programming language, such as C language, C++, Java, and so on. If you want to run your program, you need to compile the code into an executable using a compiler (of course, there are several steps in between, such as preprocessing, assembly, and linking, which are omitted here).

However, the embedded system has limited computing capacity, memory and storage space, so it cannot complete the compilation process that requires resources and speed.

For example, in Android embedded development, you can’t just have an Android phone build your own system or software.

Therefore, we compile the program on a regular computer (which has more computing power, more memory, and more storage space than an Android phone) (requiring a different compiler than we compile regular software, called a “cross-compiler/software.” The most common is the ARM-Linux-gcc family) as a specific executable for Android phones (usually packaged as an image file), and then “burned” to the Android phone through specialized tools.

I believe that after these explanations, we should have a preliminary understanding of embedded bar. But these explanations are impossible to understand and must be learned. In practice, you will have a better understanding of what embedded programming is.

3. Get started and improve embedded


In this modern age of hurry, you’re losing out if you don’t take advantage of the great (mostly free) resources available online. If you spend a lot of money on a training course, you may lose even more (if you don’t have self-control, going to a training institution is basically a waste).

  1. Embedded software doesn’t necessarily require a lot of hardware knowledge (as much as possible). Can use some burn tools, compile, debug tools (such as JTAG) can, then use the learning. There are no fixed development tools, and you don’t usually have to use an IDE. You can write Code using text editors (Vim, Emacs, Nano, VS Code, etc.). Compilation generally uses the GCC variant.

  2. Learn C for embedded applications (see my series of tutorials on exploring C. And “C language in-depth anatomy”, “C programming language” these two books. You can also dig into Programming with C language Experts, etc.). C++ is also a common language.

  3. Linux is a must. Because cross-compiling is often done on Linux, even on Windows, it’s done with things like Cygwin. You can learn my practical course “Linux Core Skills and Applications” and the column “Linux Command line and Shell Scripting” on MOOC. You can also see the Linux dishes from Taiwan’s Bird Brother’s Bird brother. You can visit China Linux commune. See the book Advanced Programming in Unix Environments. Pig brother’s embedded Linux public house dishes are also ok, I did not finish reading, feel a bit chaotic (of course the author is much better than me), not bird brother’s writing so smooth and clear.

  4. Best spend some time to learn assembly, to understand the principles of the computer, especially memory, Pointers, binary, hexadecimal have very good help, do not need to learn very deep. Recommend Wang Shuang teacher “assembly language” book, is an excellent textbook for entry.

  5. Embedded The current main processor architecture is ARM (formerly ARM7, ARM9, ARM11, now all Cortex family). Mobile phones, tablets, most development boards are ARM’s. So I need to learn the ARM architecture to have an understanding. You don’t need to go too deep into ARM at the beginning, depending on the situation in the future. The INTEGRATED development environment of ARM includes ADS (ARM Developer Suite), which is the main development tool of ARM processor.

  6. Go out and buy a cheap development pad to get started. (THE only thing I find expensive about self-learning embedded is that it costs a lot of money. Dozens, hundreds of yuan is very good). Raspberry Pie (www.raspberrypi.org; www.raspberrypi.com.tw), Arduino, and so on. Also can buy home the development board that a few manufacturers own, do not buy too bad to go.

  7. If you buy a development board, you can go to the development board counterpart forum. For example, I used to buy a student TQ2440 days embedded (now early upgrade to do not know what, days embedded forum has a lot of good information. Embedded Linux Forum. Forum of Huaqing Foresight. Electronic Engineering World Forum. Of course, the forums and blogs of CSDN, the largest IT community in China, are also good learning areas. 51CTO is good as well as ChinaUnix. The lab building has a good online lab environment, most of which is Ubuntu, a Linux distribution.

  8. Learn English well, programming is very helpful, so never waste English. Also, math needs to get by, with all the underlying shifts, and/or operations, hexadecimal, binary, decimal conversions, and so on. Check out my post on why English is More Important than Math for programmers. How to learn.

  9. There are many books that can be read, so it is important to choose good ones and read them efficiently. Understanding Computer Systems in Depth is very good and kind of a primer. There are also many embedded books. Take your time. Lay the groundwork first. Embedded this field is too wide, can learn too many things, now the technology changes with each passing day, lay a foundation to learn what new knowledge is fast. Orange’s: The Implementation of an OPERATING System is a highly recommended book. Follow the author step by step to write your own operating system.

  10. If learn more difficult embedded real-time (Real Time) system (VxWorks, ECOS, UCOS, and so on. Drive development and so on, that will be C language (and assembly) foundation is stronger, to read more in-depth books. But for the time being, the introduction of embedded, these more difficult areas to see interest, not to learn can also.

  11. If you need any programming information, you can pay attention to my wechat public account “Programmer Union” (wechat id: CoderHub) (There are a lot of programming information in the QQ group files of programmer Union and baidu cloud disk of Programmer Union (2T capacity).

  12. Don’t be afraid, I was also from the embedded knowledge to self-study, to now “only understand a orificio”. Self-education has never been easier than it is today. So, standing on the shoulders of so many giants (there are so many great bloggers online), are you afraid that you won’t be able to get started? Boy, you’re one step away from success.

I don’t want to mislead you. If you have any questions, please contact us in the message area.

Disclaimer: The company or product mentioned in this article is not intended as an advertisement.


My name is Xie Enming, the operator of the public account “Programmer Union” (wechat id: CoderHub), the moOCs elite lecturer Oscar, and a lifelong learner. Love life, like swimming, a little cooking. Life motto: “Run straight for the pole”