How can embedded system development become simpler?

Last Update Time: 2021-03-06 11:07:03

It's like people in very distant times are still very conservative in their thinking, clinging to their own pure land and enjoying a comfort. For that era, materials were relatively scarce, technology was relatively backward, and there was no so-called big data, cloud computing, the Internet, and mobile Internet.

image.png


There are many techniques for developing high-reliability embedded systems, from standardized development cycles to strict execution and system inspection. This article introduces 7 easy-to-use and long-term techniques that can help ensure that the system runs more reliably and catches abnormal behavior.

Tip 1- Avoid volatile memory allocation

Engineers who are not used to working in resource-constrained environments may try to use the features of their programming language, which allows them to use volatile memory allocation. After all, this is a technique commonly used in calculator systems , where memory is allocated only when necessary. For example, when developing in C, engineers may prefer to use malloc to allocate space on the heap. There is an operation that will be performed. Once completed, you can use free to return the allocated memory for heap usage.

In a resource-constrained system, this can be a disaster! One of the problems with using volatile memory allocation is that wrong or improper techniques can cause memory leaks or memory fragmentation. If these problems occur, most embedded systems do not have the resources or knowledge to monitor the heap or handle it properly. And when they happen, what happens if the application puts forward space requirements, but there is no requested space available?

The problems caused by the use of volatile memory allocation are very complex, and it is a nightmare to properly handle these problems! An alternative method is to simplify memory allocation directly in a static manner. For example, as long as a buffer with a size of 256 bytes is simply created in the program, instead of requesting a memory buffer of this size via malloc. This allocated memory can be maintained throughout the entire life cycle of the application without concerns about heap or memory fragmentation issues.

Tip 2-Build a powerful watchdog system

One of the most popular watchdog implementations you will often find is where the watchdog is enabled (this is a good start), but you can also use a periodic timer to Where the watchdog is cleared; the activation of the timer is completely isolated from any occurrence in the program. The purpose of using the watchdog is to help ensure that if an error occurs, the watchdog will not be cleared. That is, when the work is suspended, the system will be forced to perform a hardware reset to recover. Using a timer independent of system activity can keep the watchdog clear, even if the system has failed.

Embedded developers need to carefully consider and design how to integrate application tasks into the watchdog system. For example, there may be a technique that allows each task that runs within a certain period of time to indicate that they can successfully complete their task. In this event, the watchdog is not cleared, it is forcibly reset. There are some more advanced technologies, such as using an external watchdog processor, which can be used to monitor how the main processor behaves and vice versa.

For a reliable system, it is important to build a powerful watchdog system. Because there are too many technologies, it is difficult to fully cover these few paragraphs, but for this topic, the author will publish related articles in the future.

 

In conclusion

These are just some methods that allow developers to start building more reliable embedded systems. There are many other techniques, such as the use of good coding standards, monitoring of bit flips, performing array and pointer boundary checks, and using assertions. All these technologies are the secrets that allow designers to develop more reliable embedded systems.

 

If you want to know more, our website has product specifications for embedded system, you can go to ALLICDATA ELECTRONICS LIMITED to get more information