Code Debugging

ANSI C code synthesis of MLDesigner FSM models supports monitoring of relevant information within several areas of generated FSM module applications.

The debug code sections can be enabled and disabled via the boolean switches defined in the CFG_Base.h configuration file. Debug information are streamed via the fprintf C function to the stderr output channel.

FSM Behavior

#define FSMn_DEBUG 1

The configuration unit for debug settings includes a boolean switch for each involved state machine model, to enable monitoring of appropriate instance behavior. In case that debugging for a specific FSM model is enabled and an instance of this state machine is able to perform a state change, all related execution steps are displayed. These execution steps include the firing transition, performed actions and the new current state.

Task Execution

#define OS_DEBUG_TASK 1

To validate an accurate RTOS task execution order, especially in conjunction with given real-time conditions, task debugging enables monitoring of the currently executing FSM instance.

Data Transfer


Based on corresponding debug settings, the complete RTOS task interaction and interface data transfer can be displayed. This means that, whenever an instance output port emits new data to be scheduled for an appropriate instance input port, both procedures, data sending and delivery, can be independently debugged. Respectively, interface debugging can be enabled to monitor received input data and sent output data.

Dynamic Memory

#define MEM_DEBUG 1

Concerning to an optimized memory consumption, memory partitions can be debugged in such a way that all associated partition information are displayed, whenever a memory block is allocated or deallocated.

Additionally, in case the application has been aborted after a specific run-time period, final partition snapshots provide information about how many blocks have been maximally used within this execution duration.