By default, Eclipse provides ‘stop-mode-debugging’: in order to inspect the target code and data, I have to stop the target. But with the right extensions as present in the Eclipse based MCUXpresso IDE, it is possible to inspect the target even while it is running.
Inspecting and visualizing variables with the debugger while the target is running is incredible useful: I don’t have to stop the target to inspect the state of the system. But of course there are limiations: The debug probe only can read memory mapped variables (so no CPU core registers), and the variables should be global (it does not make much sense to use local variables, as their location on the stack changes all the time). The amount of data (number of variables, frequency of updates) is limited, so this works for a few variables updated every few 100s of milliseconds. The feature is usually named ‘live variables’ or similar.
I’m using the NXP MCUXpresso IDE V11.0 which implements the ability to read and interact with the target while it is running (gdb non-stop mode). That features has been introduced from V11.2 and has been enhanced in later releases with V11 the most recent one.
The feature depends to some extend on the debug probe capabilities, and with V11 it works seamless for all supported probes, including P&E, SEGGER and the NXP LPC-Link2/CMSIS-DAP ones.
If using LinkServer as debug connection, make sure it is is in Non-Stop mode. If it is in full-stop mode, see https://mcuoneclipse.com/2019/01/13/gdb-all-stop-and-non-stop-mode-with-linkserver/ how to change an existing configuration.
To monitor the variables, the ‘Global Variables’ view is used:
Use the ‘glasses’ icon to open a dialog to select the variable(s) to monitor:
The dialog has a filter functionality. Select the variables which shall be monitored:
The update frequency in milliseconds is configured in the view:
With the ‘play’ button pressed, the variables in the list get updated with the specified update frequency. Changed values are marked with yellow background:
The view has a ‘Details’ pane: selecting one or more lines shows a graph of the variable over time:
The data can be plotted in different formats:
including a list of values which can be exported too:
Happy Variabling 🙂
- MCUXpresso IDE 11.0: New NXP MCUXpresso Eclipse IDE v11.0
- MCUXpresso IDE 10.2: https://mcuoneclipse.com/2018/05/20/overview-of-mcuxpresso-ide-v10-2-0/
- Live Variables View in CodeWarrior: https://mcuoneclipse.com/2013/01/27/live-view-for-variables-and-memory/
- GDB all-stop and non-stop mode with LinkServer: https://mcuoneclipse.com/2019/01/13/gdb-all-stop-and-non-stop-mode-with-linkserver/