The embedded development technique of website design
The embedded development technique of website design one - use MPU
In the past, it was difficult to find a memory protection unit (MPU) in a small and cheap microcontroller, but this situation has begun to change. Now, from high-end to low-end microcontrollers, MPU is already available. These MPU provide an opportunity for embedded software developers to significantly improve their firmware (Firmware) robustness (robustness).
MPU has been gradually coupled with the operation system to establish memory space, where the processing is separated or the task can execute its code without fear of being stomped on. If something really happens, the uncontrolled treatment will be cancelled and other protective measures will be carried out. Please pay attention to the microcontroller with this component. If there is, please use this feature more.
Site design embedded development technique two - building a powerful watchdog system
Often you will always a favorite watchdog found (watchdog) implementation is in place, the watchdog is enabled (which is a very good start), but also can use periodic timer will the watchdog timer reset; enabled is completely isolated from the program at any the situation. The purpose of using watchdog is to help ensure that if a mistake occurs, the watchdog will not be cleared. If the work is suspended, the system will be forced to perform the hardware reset (hardware reset) to restore. Using a timer independent of the system activity can keep the watchdog zero even if the system has failed.
Embedded developers need to be carefully considered and designed to integrate the application tasks into the watchdog system. For example, there is a kind of technology that may allow each task that runs in a certain period to indicate that they can accomplish their tasks successfully. In this event, the watchdog is not cleared and is forced to be reset. There are some more advanced techniques, such as the use of an external watchdog processor, which can be used to monitor how the main processor performs, and vice versa. For a reliable system, it is important to establish a powerful watchdog system.
Site design embedded development technique three - avoid volatile memory allocation
Engineers who are not accustomed to working in limited resource environment may try to use the characteristics of their programming languages, which allows them to use volatile memory allocation. After all, this is a technique that is often used in a calculator system, and in a calculator system, memory will be allocated only if necessary. For example, when developing with C, engineers may tend to use malloc to allocate space on the heap. One operation will be executed, and once completed, free can be used to return the allocated memory for the use of the heap.
In resource constrained systems, this can be a disaster. One of the problems with the use of volatile memory allocation is that improper or improper technologies can cause memory leaks or memory fragments. When these problems arise, most embedded systems do not have the resources or knowledge to monitor the heap or properly handle it. And when they occur, if the application of space requirements, but not the requested space can be used, what will happen? The use of nonvolatile memory allocation problems are very complex. To solve these problems properly, can be said to be a nightmare! One alternative is direct, in a static way, simplified memory allocation. For example, simply set up a 256 byte long buffer in the program, rather than a memory buffer of such a size via the malloc. This allocated memory can be kept during the life cycle of the entire application, and there is no concern about the problem of heap or memory debris.
The above embedded development tutorial allows the development of technical personnel to get better embedded systems. All of these technologies are the secret of a designer to develop a more reliable embedded system.