If you want to use the JLink probe to do some advanced debugging, you can read the separate chapter for that.
The easiest way to debug and also the way how all the things started was just to print out whatever you consider important to know.
We will use the serial port to print the information over USB into the connected PC.
The Core Module has an integrated FTDI chip connected to the UART2. You do not need to use a separate serial converter, just connect the USB cable to your computer.
You can visit the twr_log SDK Module.
Logging Code Example
// LED instance
// Button instance
void button_event_handler(twr_button_t *self, twr_button_event_t event, void *event_param)
if (event == TWR_BUTTON_EVENT_PRESS)
// Logging in action
twr_log_info("Button event handler - event: %i", event);
// Initialize logging
// Initialize LED
twr_led_init(&led, TWR_GPIO_LED, false, false);
// Initialize button
twr_button_init(&button, TWR_GPIO_BUTTON, TWR_GPIO_PULL_DOWN, false);
twr_button_set_event_handler(&button, button_event_handler, NULL);
Example of output:
# 4.54 <I> Button event handler - event: 0
# 4.84 <I> Button event handler - event: 1
# 4.84 <I> Button event handler - event: 2
# 10.24 <I> Button event handler - event: 0
# 12.24 <I> Button event handler - event: 3
# 13.64 <I> Button event handler - event: 1
You can colorize logs into 4 different colors with commands down below.
Read Logs With HARDWARIO Code
If you didn’t already, you should install HARDWARIO Code.
You can use our Visual Studio Code extension to attach the console to the connected Core Module.
You can use two commands in the extension to attach the console:
It is advised to use the first one. It will build the firmware so it includes all the changes that you did and flashes it to the device. After the flashing is done the console will be attached and you can see all the logs.
If you just want to attach the console to the running Core Module without building and flashing, you can use the Attach console command.
Either way, you should see the log messages in the console at the bottom tab
To learn more about this console you can visit HARDWARIO TOWER Console chapter.
You can check those links for more information: