Mistake on this page?
Report an issue in GitHub or email us

Debugging the quick start

Using printf

The easiest way to do basic debugging is to use the printf command in your code, then read the output using a serial terminal, such as PuTTY or CoolTerm.

For example, add printf("Hello World!\n\r"); to the top of your main function, and then recompile the program and flash it to your device.

Note: Unless otherwise specified, printf defaults to a baud rate of 9600 on Mbed OS. You can modify this value in the mbed_app.json file. To configure your terminal client to this baud rate, change the speed option when selecting the port. You can view the configuration options page to learn more about how to configure OS-level options.

To determine which communication port your board connects to:

  1. On Windows:

    1. Open the Device Manager by pressing Windows key + R.
    2. Enter devmgmt.msc.
    3. Click OK.
    4. Under Ports (COM & LPT): your Mbed board is listed as a USB Serial Device next to its COM port.
  2. On Linux: Run dmesg | grep tty from your command-line.

  3. On macOS: Run ls /dev/tty.* from your command-line.

Exporting to a desktop IDE

To debug using a desktop IDE such as Keil uVision, IAR or Eclipse:

  1. Under Program Details, click the Export button.
  2. Select your export platform and IDE.
  3. Click Export.
  4. Your browser downloads a .zip file with the project files.

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.