Using the Debug Console

From openlabs wiki
Jump to: navigation, search

If you're going to do any kind of development with your openOBC, you're likely going to want to make use of the debug console. This is the primary means of determining what the openOBC is doing at any given time. All errors and debug output will go here, as will any printf debugging that you do yourself. If you're not sure you're familiar with debug consoles or serial terminals, there's an excellent primer here that should get you acquainted with the basics.

The easiest way to access the debug console is through the DEBUG header using some kind of FTDI cable or UART-RS232 shifter or equivalent, like this:


In this way, any terminal program can be used to access the debug console as a standard serial port on the host computer. Just make sure to set the baud rate to 115200. Popular terminal programs include picocom and TeraTerm.

The alternative is to connect a micro-USB cable to the USB DEVICE port, like this:


This is practically the same thing, but with one important difference. When using the USB DEVICE port to access the debug console, it is necessary to configure the terminal program to disable DTR and RTS. Unfortunately not all terminal programs have this option, however CoolTerm is one example that does:


Leaving DTR and RTS off is necessary because these two control lines are used to signal the microcontroller during flashing through the USB DEVICE port. DTR is used to reset the microcontroller, and RTS is used to signal it to enter firmware flash mode. If DTR is kept asserted by the terminal program, the microcontroller will remain in reset and the firmware will not execute.

If DTR and RTS are properly configured and your terminal is all set up (make sure the baud rate is set to 115200), you should get a bunch of output when you hit the reset button and let it boot up with the terminal connected:


That should do it. Having a working debug console will make development significantly easier.