How to Invoke MDB

1

LaunchCommandPrompt.png

Launch a terminal / command prompt window

In Windows, from the Start menu, select Accessories ▶ Command Prompt

2

In some versions of MPLAB X IDE you must run mdb from inside its directory:

Platform MDB Directory
Windows (32-bit) C:\Program Files\Microchip\MPLABX\mplab_ide\bin
Windows (64-bit) C:\Program Files (x86)\Microchip\MPLABX\mplab_ide\bin
Linux /opt/microchip/mplabx/mplab_ide/bin
Macintosh /Applications/microchip/mplabx/mplab_ide.app/Contents/Resources/mplab_ide/bin

cd directory_path_from_table_above

From the Windows command line, run the command:

mdb.bat

From the Linux or Mac OSX command line, run the command:

mdb.sh

3

When MDB is running, you should see its command prompt:

>_

You can enter commands at the mdb prompt, or you can use mdb to execute scripts.

If you type help and hit Enter you should be presented with a list of available commands.

>help

The list of classes of commands:

breakpoints -- Making program stop at certain points
data -- Examining/Changing data
deviceandtool -- Selecting debug tool and device
others -- Others
programming -- Programming device and its relative functions
running -- Running the program
stack -- Examining stack

Type "help" followed by a class name for a list of commands in that class.
Type "help" followed by command name for full documentation.

Add a command alias to simplify changing directories on the Windows command line

  • Create a file called C:\doskey.cmd with the following content:
    @echo off
    DOSKEY cdm=cd "C:\Program Files (x86)\Microchip\MPLABX\mplab_ide\bin"

  • Right click on your command prompt launcher and select Properties. Change the Target to the following:
    %windir%\system32\cmd.exe /K C:\doskey.cmd
© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.