Initial values of static variables during state transitions

This post describes the initial values of static variables during state transitions.

Initial values of static variables in embedded software are usually set at Power On Reset. However, in an embedded system, when the hardware or software state transitions as shown in the figure below, it may be required to set initial values according to each state.

Initial values of static variables in C language are set at E1 (S1) in the figure below, and E2 to E10 are often set at each component of the application layer. Judging and executing state transitions on a component-by-component basis tends to complicate components and can lead to the creation of bugs. It is recommended that state transition judgments, initialization of static variables at state transitions, and component execution for each state be created as quasi-RTOS services.

OSS-ECAL English
error: Content is protected !!