Skip to content

Serial Logging

mdemeyer edited this page Sep 21, 2020 · 1 revision

[[TOC]]

The stack has serial logging on the debug USB enabled by default (baudrate 115200). If required, the FTDI USB can used by configuring this in the application Makefile.

Printf Prototype

Instead of having to use the HAL_UART_Transmit() functions, a printf() function is used, which redirect this print to the configured serial port. Furthermore, three different logging levels are provided.

PrintINF

This is used for normal info messages, where the buffer passed to this function is automatically preceded by a [INF] print.

[INF] this is an info message

PrintERR

This is used for logging error messages, where the buffer passed to this function is automatically preceded by a [ERR] print.

[ERR] this is an error message

PrintDBG

This is used for logging debug messages, where the buffer passed to this function is automatically preceded by a [DBG] print. This function can always be called, but will only do something when the DEBUG flag is set to 1 in the application Makefile.

[DBG] this is a debug message

PrintWelcome()

During the initialization of the platform, which is done at the start of every application, the printWelcome() function is called. This function prints:

  • Application name
  • Application version
  • octa-stack version
  • configured Makefile parameters
  • octa-uid: unique identifier of the microcontroller
***************************************************
Application: hello-world
Version: 0.1.0
Stack version: 0.1.0
Settings: scheduler, lowpower mode 0
octa-uid (u64 le hex): 1050365750356c20
***************************************************

Clone this wiki locally