No UART messages show up after adding USART0 through configurator in Simplicity Studio.

There’s a nice article at the link below describing the steps needed.

 

https://siliconlabs.my.site.com/community/s/article/Understanding-the-IO-Stream-module?language=en_US

 

What’s happening here is that the newly added UART takes ownership of the stdio so it no longer appears on the UART connected to the USB port, but on the newly added UART.

 

‘When the project is added one more IO Stream instances, please refer to the following code that the last initialized instance is used as the default IO stream’.

 

To correct this, the following can be added to the application.

 

  // Initialize Silicon Labs device, system, service(s) and protocol stack(s).

  // Note that if the kernel is present, processing task(s) will be created by

  // this call.

  sl_system_init();

 

  // Redirect stdio

  sl_iostream_t *sl_iostream = sl_iostream_get_handle("hostcom");

  sl_iostream_set_default(sl_iostream);

 

  // Initialize the application. For example, create periodic timer(s) or

  // task(s) if the kernel is present.

  app_init();

 

Essentially what’s happening is that one UART is used to send data from underlying printf statements – the above change is used to set the destination UART for this back to the USB based serial port.

Categories

Products