How to develop your own embedded system

2022-08-05
  • Detail

How to develop your own embedded system

the story that embedded systems are older than Moses

the history of computers used to control devices or embedded systems is almost as long as that of computers themselves. In the field of communication, in the late 1960s, computers were used in electronic switches, called "stored program control" systems. The word "computer" was not common at that time. Stored program means that the memory contains program and routine information. Storage control logic, rather than solidifying it in hardware, was indeed a breakthrough at that time. Today, we believe that it should have been

at that time, computers were customized for every application. According to today's standards, they had large errors. They were abnormal and integrated into one computer by strange special instructions and I/O devices

microprocessors have changed all this by providing a small, low-cost, CPU engine for building large system modules. It proposes a fixed hardware architecture with peripherals connected by bus and a general programming model called programming

software is also proposed along with hardware. Initially, there were only simple programming development tools for writing and testing software. The software actually running on each project usually comes from the modification of the draft. Assembly language or macro language is often used in programming, because compilers often have defects and lack of perfect debugging tools. Software building blocks and standardized libraries were only popular concepts in the 1970s

and can only be used for specific microprocessors. When a microprocessor is eliminated, its operating system will be eliminated unless it is rewritten for a new processor. Today, many of these early systems have become vague memories; Does anyone else remember MTOs? When C language appeared, the efficiency, stability and portability of the operating system were improved a lot. This was immediately demonstrated in management. It brought hope to protect software investment when microprocessors were eliminated. This is good news for the market. Operating systems written in C language are becoming more and more popular today. Generally speaking, reusable software is dominant and getting better

in the early 1980s, my favorite operating system was the Wendon operating system. You can get a C source code library for about $150. It is a package. You can build your own operating system by selecting components, which is similar to ordering on the menu. For example, you can click work scheduling and memory management scheme on the library list. Many commercial operating systems for embedded systems appeared in the 1980s. This upsurge continues until now. Today, there are many feasible commercialized operating systems to choose from. Some bigwigs appeared, such as VxWorks, PSOs, neculeus and windows CE

many embedded systems have no operating system at all, only loop control. This is enough for some simple devices, but as the system becomes more and more complex, the operating system becomes necessary or the software becomes incredibly complex. Unfortunately, some embedded systems are horribly complex because the designers insist on not operating systems

gradually, more embedded systems need to be connected to various networks, so network functions are required. Even the hotel door handles are embedded with microprocessors to connect with the network. For the embedded system which is only a coding control loop, adding network functions will increase the complexity of the system and require the operating system

in addition to commercial operating systems, there are also a large number of dedicated operating systems. Most of them come from the draft, such as Cisco's IOS; Others are derived from other operating systems. For example, many operating systems are derived from the same version of Berkeley UNIX system because it has complete networking capabilities. Others are based on major operating systems, such as ka9q from Phil Karn

As an embedded system, Linux is a new member with many advantages. It is portable, stable, powerful and easy to develop for many CPU and hardware platforms

toolkit breaks through ice obstacles

the key to developing embedded systems is the available toolkit. Like any job, good tools make it faster and better. Different tools are required at different stages of development

traditionally, the first tool used to develop embedded systems is the internal circuit simulator (ice), which is a relatively expensive component used to implant in the circuit between the microprocessor and the bus, allowing users to monitor and control the access of all microprocessor signals. This is a bit difficult because it is allogeneic and may cause instability. However, it provides a clear working condition of the bus and avoids many guesses about the working condition of the underlying hardware and software

in the past, some work relied on ice as the main debugging tool for the whole development process. However, once the initialization software supports the serial port well, most debugging can be done by other methods without ice. Newer embedded systems utilize a very clear microprocessor design. Sometimes, the corresponding initial code has been available, which can quickly obtain the serial port work. This means that people can work easily without ice. Eliminating ice reduces the cost of development. Once the serial port starts working, it can support various professional development tools

linux is a GNU based C compiler that works with the GDB source debugger as part of the GNU tool chain. It provides all the software tools for developing embedded Linux system. There are some typical debugging tools for developing embedded Linux systems on new hardware

1. Write or implant guides because of their outstanding water resistance code

2 Print the encoding of the string to the serial port, such as "Hello world" (in fact, I prefer "Watson, come HRE I need you", the first word commonly used in.)

3. The GDB object code is implanted into the working serial port, which can talk with another Linux host system running GDB program. Simply tell GDB to debug the program through the serial port. It talks with the GDB object code of the tester through the serial port. You can debug the C source code, or use this function to load more codes into RAM or flash memory

4. Use GDB to make the hardware and software initialization code work when the Linux kernel starts

5. Once the Linux kernel is started, the serial port becomes the Linux control port and can be used for subsequent development. Using kgdb, the kernel debug version of GDB, this step is often not required. If you are connected to a network, such as 10baset, you may want to start it next

6. If you have a full Linux kernel running on your target hardware, you can debug your application processes. Utilize other GDBS or overlay GDB graphics such as xgdb

what is a real-time system

embedded systems are often mistakenly classified as real-time systems, although most systems generally do not require real-time functionality. Real time is a relative term. Purists often strictly define real time as responding to an event in a predetermined way in a very short time, such as microseconds. Gradually, the strict real-time function within such a short time interval is realized on a special DSP chip or ASIC. Only when designing low-level hardware FIFO, decentralized/aggregated DMA engine and customized hardware can such requirements be met

many designers are anxious about the real-time requirements because they have a clear understanding of the requirements that truth should be tested, corrected and improved through practice. For most large

systems, an approximate real-time response of one to five microseconds is sufficient. Similarly, soft demand is acceptable. If Windows 98 has crashed, the interrupt must be processed within 4 milliseconds (± 98%) or 20 milliseconds (± 0)

this soft requirement is relatively easy to meet, including environment transition time, interrupt waiting time, task priority and sequencing. Environment transition time was a hot topic in operating systems. In short, most CPUs handle these requirements very well, and the CPU speed is much faster now, so this problem is not important

strict real-time requirements are usually handled by interrupt routines or other kernel environment driver functions to ensure stable performance and waiting time. Once a request occurs, the time required for service largely depends on the priority of interrupts and other software that can temporarily mask interrupts

interrupts must be handled and managed to ensure that time requirements are met, as in many other operating systems. In intelx86 processors, this work is easily handled by Linux real-time extensions. This provides an interrupt processing schedule for running Linux in the background task mode. Critical interrupt responses do not have to be notified to Linux. So we can get a lot of control for the key clock. It provides an interface between the real-time control level and the basic Linux level with loose time constraints, which provides a real-time framework similar to other embedded operating systems. Therefore, real-time critical code is isolated and "designed" to meet the requirements. The result of code processing is perhaps only at the application task level in a more general way

definition of embedded system

one view is that if an application does not have a user interface, it must be embedded, because users cannot directly interact with it. Of course, this is simplified. An elevator control computer is considered to be embedded: press the key to select the floor indicator to display the landing of the elevator. For an embedded system, if the system includes a web browser for monitoring and control, the boundary will be even more blurred. A better definition focuses on the centralized functions and main purposes of the system

because Linux provides the basic kernel to complete the embedded function and all the user interfaces you need, it is multifaceted. It can handle embedded tasks and user interfaces. Linux is regarded as a continuous entity, from a micro kernel with memory management, task switching, time service and other partitions to a complete server, supporting all file systems and network services

a small embedded Linux system only needs the following three basic elements:

a) boot tool: Linux micro kernel, which is composed of memory management, process management and transaction processing

b) initialization process if you want it to do something and continue to keep miniaturization, you have to add:

c) hardware driver: one or more applications that provide the required functions

to add more functions, you may need these: a file system (perhaps in ROM or RAM) TCP/IP network stack stores semi transitional data and disks for exchange

hardware platform

selecting the best hardware is a complex work, full of politics, prejudices and traditions of other projects of the company, and lack of complete or accurate information. Cost is often the key issue. When considering the cost, make sure you are considering the whole cost of the product, not just the CPU. Sometimes a fast and cheap CPU can become an expensive dog product once it is added with bus logic and delay to work with peripherals. If you are looking for software, the first thing is that the hardware already has products. If you are a system designer, it is up to you to decide whether you are satisfied with the real-time budget and hardware

how fast CPU is needed to complete a task in reality, and then zoom in three times. It's strange that the CPU speed in theory is the same as that in reality. Don't forget that applications will make full use of cache

imagine how fast the bus needs to be. If there are other buses, such as PCI bus, include them. A slow bus or a bus that generates DMA blocking will slow down the CPU and cause congestion. With integration

Copyright © 2011 JIN SHI