The only available NBC debugger for LEGO Mindstorms NXT
November 16, 2007: Beta 3 downloadable
March 13, 2007: Beta 2 downloadable
December 15, 2006: Beta 1 downloadable
November 26, 2006: Alpha 2 downloadable
November 17, 2006: Alpha 1 downloadable
If you don't know what LEGO Mindstorms NXT is, check out my overview page.
The NBC debugger for NXT is available to download for free. Enjoy!
Special thanks to John Hansen for his ideas and building support in NBC and BricxCC for the debugger, and Philo and Rosco for test-driving the debugger from the first days.
What's NBC? Next Byte Codes (NBC) is a simple language with an assembly language syntax that can be used to program LEGO's NXT programmable brick (from the new LEGO Mindstorms NXT set).
Is there an Integrated Development Environment for NBC? Yes, it's called Bricx Command Center (BricxCC for short).
How much NBC and BricxCC cost? Thanks for John Hansen, both NBC and BricxCC are free.
Where can I download NBC and BricxCC from? Download BricxCC and NBC from sourceforge.net.
Do I need to reload the firmware in the NXT brick to use NBC and the NBC Debugger for NXT? No, NBC and the debugger use the default firmware provided by LEGO in the NXT brick.
What is the NBC Debugger for NXT? I'll just use the rest of the page to answer this question...
Added persistent soft break points across re-loads of same compiled file
Added flushing the debuglog message queue prior to program termination to ensure debug messages are transmitted
Added hotkeys (accelerators) compatible with Visual Studio debugger keyboard layout, now selectable from the options dialog
Added enable/disable feature to individual messages
Added a few new notification messages, changed existing messages to make them more accurate and understandable
Added user selectable optimization level to debug compilation preferences dialog to remove unused variables and functions
Fixed function list where after recent NBC changes system APIs showed up
Fixed debug function where after recent NBC changes debugger stopped working after some system API calls
Fixed motor start/stop syncronization where motors were not started when continued debugging
Fixed symbol file loading where symbols were not loaded sometimes
Fixed source window syntax coloring when user scrolled with mouse wheel
Fixed variable view where Auto-view did not present variables used in macros
Fixed accidental program execution at load time with debug level 0
Changed debuglog line maximum variable number per line from 16 to 32
Further file load performance improvements speeded up loading by about 50%
Added motor start/stop syncronization with the program's debug run/pause/stop state
Added context menu to breakpoint window and variable watch window
Added ability to remove user watch variables
Performance tuned file loading and initializing improved load time by over 70%
Added source code syntax coloring based on coloring set in BricxCC
Added source window status bar with file name and cursor location
Added "Goto Line" functionality to source window
Added "Find" functionality to source window
Fixed support for Bluetooth
Added device disconnect feature
Fixed W2K crash
Added context menu for the source window
Added "Go to definition" and "Go to file" features
Added support for full, user and auto variable view modes
Added progress dialog for the compiler
Bug fix in cmd line parameter handling
Minor UI changes and bug fixes
Due to Fantom SDK incompatibility, the debugger does not run on W2K Server systems. Fantom SDK is released by LEGO and provides connectivity to the NXT brick. As long as LEGO does not fix the SDK, the debugger will not run on W2K Servers.
Because of a recent change in NBC,
#pragma debugbreak instructions do not compile any more. Working on the solution.
3 levels of debugging
- Level 0: variable control only; start/stop and watch/modify variables; supports debug logs, but not debug breaks. Executable size and execution speed is comparable to normal size and speed.
- Level 1: pause/continue; start/stop/pause/continue support, watch/modify variables; supports debug logs, and hard coded debug breaks. Executable size is about 1.5x and execution speed is about 2.5x slower than normal size and speed.
- Level 2: step-by-step; start/stop/pause/continue/step into/step out/step over support, run to cursor, watch/modify variables; supports debug logs, hard coded and at run time defined soft debug breaks. Executable size is about 2x and execution speed is about 4x slower than normal size and speed.
Basic debugger functionality
- Compile and Debug menu item in the Compile main menu
- 1 touch compile, load into debugger, connect debugger to device (pre-requisite is that BricxCC is connected already and the debugger can inherit the same connection) and download code to NXT
- NBC bugs and errors need to be fixed with regular compilation before debug compilation
- Debugger Preferences menu item in the Compile main menu
- Preference dialog opens from BricxCC can be used to set debug level to one of the above mentioned
- Start program execution
- Stop program execution
- Restart execution
- Step into subroutines
- Step out of current subroutine
- Step over subroutines without debugging
- Motors are synchronized with program debug pause/run/stop state
- Source code integration
- Select any thread in case of multi-threaded program and debug that particular thread
- Look through entire call stack for any thread, jump to any call level in call stack
- Watch and modify variable values
- Debug logging
- Break points and debugbreaks
- Copy full debug status to clipboard
- Optional periodical data collection from NXT during program execution, period can be from 1 to 30 seconds or off
- Data communication status lights shows when there’s communication (and which direction) between the debugger and the NXT
- Keep alive, do not let NXT brick turn off while debugger is connected
- Optional window graphical watermarking for easy understanding of each window’s functionality
- Splitter window structure with source code, debug log, breakpoint, variable watch, threads and call stack windows
Debug breaks and breakpoints
- Simple debug log
- Multi-segment debug log built form max 32 segments, each can be a constant string in ’’ marks, a string or numeric value
- Asynchronous debug log transfer from NXT device
- A log line entry can be up to 56 characters, rest of the line is truncated
- Set font size
- Clear debug log window
- Copy one line or full log to clipboard
- For more details see the Debug Logging and Data Charting Tutorial
Source code integration
- Unlimited hard coded debug break in source code
- Enabled or disabled at run-time, each one equipped with hit counter which is visible in the UI, can be tested and reset at any time
- Unconditional (breaks before executing next line)
- Simple conditional (comparison of 2 variables or 1 variable and 1 constant value, breaks into debugger when logical expression evaluates as true)
- Counter type (breaks into debugger when execution passes the debugbreak and hit count is equal or larger then a specified value, optional automatic resetting of counter)
- Unlimited soft break points, defined, removed, enabled or disabled at run-time
- For performance reasons only 1 soft break point can be enabled per subroutine
- Displays location, type (hard or soft) and hit count for each breakpoint
- Tool-tip-like yellow pop-up window for all lines that are too long, partially not visible and truncated shows location, type and hit count
- Enable all/disable all
- Hit count follows how many times program execution passed through each hard coded debugbreak, hit count can be reset at any time from debugger
- Double click to show breakpoint line in source window
- Copy one or all breakpoint information to clipboard
- For more details see the Debug Breaks and Breakpoints Tutorial
Variable watch and modify
- Syntax colored source code window
- Find subroutines or threads by name in the project
- Jump to definition of any subroutine, thread, variable, label, macro or file in the project
- Add variables to watch window
- Point at variable to retrieve it's type and value in tip popup
- Follow test execution step-by-step during debugging
- Next instruction to be executed is marked in left margin
- All soft breakpoints and hard coded debugbreaks are color coded and show enabled/disabled state in left margin
- Show next instruction: jump back in the source code to the line to be executed
- Modify next instruction: force the execution to continue from an other line within the thread or subroutine
- Run to cursor: select a line anywhere in the project, and run until that line is being executed. At that point the program will stop in the debugger. Other breakpoints can stop execution before hitting the specified line.
- Point to any line and add, remove, enable or disable a soft break point
- Point to any line and enable or disable a hard coded debugbreak
- Go to line number
- Find in file
- User selected font
Threads and call stacks
- Display and modify each variable, array item or cluster item during program execution or while execution is paused
- 3 modes
- Show variables in currently executed section (auto mode; default)
- Show only user selected variables (user mode)
- Show all variables (full mode)
- Display variable name, type and value
- For arrays display array type and length
- For byte-type arrays display arrays as string values
- Tool-tip-like yellow pop-up window for all lines that are too long, partially not visible and truncated shows name, type and value
- Recognize that NXT memory is corrupt and gray out variable window if that happens
- Full support for viewing unlimited dimension nested arrays and clusters (limited only by NXT memory)
- Collapsible/expandable structure for clusters and arrays
- Filter any variable, array or cluster; filter array or cluster items together or individually
- Fully collapse or full expand all variables with one click
- Copy one or all the variables with values and type to clipboard
- Display each parallel thread’s current execution location with subroutine or thread name, file name and line number
- Click on any thread to show it’s currently executing instruction, and select for debugging
- Display full call stack for the current thread selected in threads window
- Display subroutine’s name, file name and line number
- Click on any call to show it’s currently executing instruction source code, and select for debugging
- Tool-tip-like yellow pop-up window for all lines that are too long, partially not visible or truncated
- Copy one or all the threads with location to clipboard
- Copy one or all the call stack items with full location to clipboard
Tutorial 1: Debug Logging and Data Charting
Learn how to use debug logging as a text output and also as a data logging and charting tool.
Jump to this tutorial
Tutorial 2: Debug Breaks and Breakpoints
Tutorial 3: Source Code Window
Learn about using the source code window during debugging.
Tutorial 4: Variables
Learn how to use the variable window in debugging.
Tutorial 5: Multi-Thread Debugging
Learn the basics of debugging multi-threaded NBC programs.
Download and Installation
You need to install either the LEGO Mindstorms NXT-G graphical programming environment provided by LEGO on a CD with the NXT kit, or the Fantom SDK prior to installing the debugger.
You will need to install the latest available version of BricxCC and NBC prior to installing the debugger.
You need Windows Installer 2.0 for installing the debugger. If your installation fails, I recommend that you download the latest version of the Windows Installer from the Microsoft Download Center or a mirror site.
You need to uninstall any previous version prior to the installation of a newer version.
If you are using any popup-killer you need to temporarily disable it in order to continue with download!
Please refer to your popup-killer's guide for instructions.
Most popup-killers can be temporarily disabled by holding down the Left Ctrl key or both the Left Ctrl and Left Alt keys while clicking on the link.
Use the following link to download the installer application.