Debugging Applications using DMCIX
The Data Monitor and Control Interface (DMCI) provide dynamic input control of application variables in MPLAB IDE projects. Application-generated data can be viewed graphically using any of 4 dynamically-assignable graph windows. This article lists out the debugging capabilities available under DMCI.
About this Code Example
The Data Monitor and Control Interface (DMCI) provide dynamic input control of application variables in MPLAB IDE projects. Application-generated data can be viewed graphically using any of 4 dynamically-assignable graph windows.
Data logging is an important feature for an embedded application. Embedded application requires precise data viewing facility tool to capture the data while debugging/running the application. DMCI enables the embedded developer to fine tune the project application variables and view the output to suit their requirements.
DMCI v2.71 Updates:
- Updated RTDM target code to achieve more stable communication
- Updated DMCI delay logic(turnaround time delay) in coordination with RTDM target logic changes
- Updated DMCI trigger logic to fix issue at lower trigger level
- Updated logic to fix issue - trigger value gets deleted on “enter” key
- Fixed – Trigger range should vary w.r.t selected variable data type
Major Updates DMCI v2.70:
RTDM Support for PIC32 family – Updated logic to support RTDM communication for PIC32 bit family devices.
RTDM Speed Optimization – Updated logic to optimize RTDM speed by removing fixed length read operation delay and void delay used for PIC16F/PIC18F.
DMCI GAP Analysis – Did GAP analysis between different tools (DV and X2C) and identifying the differences.
Automatic y scaling is calculated based on the base variable in the graph - Noticed an error with Merge graphs. The automatic y scaling is calculated based on the base variable in the graph. If you merge it, it fails to re-scale based on larger values in the new graph for which was merged.
Fixed absolute address handling for the graph control- all the graph features should use the absolute addressing and it also support for Data capture, Run time watch, DMA and Simulator.
Incremental Delay Handling with individual automated event control - Incremental Delay handling option for individual automated event is not proper, need to handle with respect to each event.
Provide option to remove individual OTW and Boolean button from list - OTW and Boolean Configurator Button window provides option to add and configure Buttons, but there is no option to delete single button.
Fix Automated Event Control UI Issues – Automated event dropdown list is not updated with current symbols configured. List is will also showing unchecked symbols. This situation will come, if the user first time checked Boolean symbols and immediately if the symbol is unchecked, still the automated event dropdown menu list will have the unchecked symbol.
OTW Validation with each Element - Update logic to validate the OTW element properly in the list.
Trigger- RTDM/DMCI transmits waveform data continuously from the target. This is like an oscilloscope’s “auto” triggering mode. We would like the ability to detect some kind of trigger condition, so that infrequent events can be captured. But we need to switch between the “auto” and “normal” triggers at runtime. Perhaps the target application could determine whether the trigger condition has occurred and transmit this as a Boolean value along with the waveform data? Then users can select whether they want DMCI to show all data (important when verifying that the waveforms seem to be measuring the correct data) or only the data when the trigger condition is met.
Implementation Details –Graph trigger is a new feature supported for DMCI 2.70 release. The data is displayed on graph based on the trigger conditions.Once you click on “Graph Trigger Configuration” button then following window will open,
Libraries/ Documentation and Examples:
Following five features enables debugging capability with DMCI tool
1. Modify/Capture on a Debugger break
2.Simulator runtime, Data capture
3. Runtime watch
These features enable the user to view and fine tune the data in different environments. Based on the debugger and device selected we need to use the appropriate feature.
Debugging an Embedded project application can be done in distinct steps.
Step 1: Develop your application using simulator as the debugger. Modify the variable values on a debugger break and rerun the application. View the array data on a graph during a debugger halt.
Step 2: Now you can use simulator runtime to view the graph while running.
Step 3: Use a Real time debugger such as Real Ice and use real time debugging facility available under the debugger/device using DMCI to recheck the application.
Step 4: Creates a production build and check the application using RTDM feature available under DMCI.
All the features are listed below
1. Modify/Capture data on a Debug break
Application input variables should be configured under DMCI input controls and the output should be configured under the graph controls. Debug the application and change the variable values on a debugger halt and view the array values on a graph. Repeat the process to verify the output on input changes.
User can use Simulator , Real ICE and In-Circuit Debuggers(ICD 2,ICD 3) to support this feature
2. Simulator runtime
If the user selected simulator as the debugger then he can use this feature. Data will be logged to the Graph on a project debug. Please go through the video to check how can we achieve this with the DMCI under MPLAB X IDE.
Once the program is debugged and verified using simulator, we may need to verify the same by running the target using the real time debuggers. Depending on the hardware capability (device and debugger) we can use the runtime data logging facility under DMCI.
If the user selected simulator as the debugger then he can use this feature. Data will be logged to the Graph on a project debug.
3. Data capture and Runtime watches
Data capture support provides streaming data from a device to the DMCI Graph. Device should support this feature to enable the data logging.
A runtime watch updates variable data to the DMCI graph. This is a debugger supported feature and Real ICE debugger supports this feature. These debug functions are specific to 8 bit and 16 bit devices.
4. DMA(Direct Memory Access)
Device should have DMA controller to use this feature. Use real time debugger which supports supports DMA (i.e., MPLAB REAL ICE in-circuit emulator), the DMCI will be able to transmit and receive Control (Sliders, Booleans, User Defined Input) and Graph data to/from the target data memory.DMA used with the DMCI provides real-time operation without halting. Therefore you may change application variable values and have these values written to the target device in real-time. These feature support is there under PIC32 devices.
5. Real-Time Data Monitoring (RTDM)
A RTDM library must be linked into the target application for this function to be available. The RTDM agent on the running target will allow DMCI to transmit and receive Control (Slider, Boolean, User Defined Input) and Graph data to/from the target data memory using a UART on the target.
You may communicate directly with the target device or through a debug tool to the target device. RTDM uses the run-time control and update buttons.
- Oct 22, 2015