cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB debug messages

matteverze
Associate

Hi,

I'm trying to build a custom BLE application following the "Get Started" videos provided by ST and I want to print the default debug messages on the virtual COM port, as shown in the provided examples (e.g., BLE_Custom). As explained in some tutorials, I changed the values of the macros CFG_DEBUGGER_SUPPORTED, CFG_DEBUG_BLE_TRACE, and CFG_DEBUG_APP_TRACE to 1. However, I encountered build errors because the hw_uart.c file was not generated (the same error is reported here ).

I discovered that the same variables need to be enabled from the MX project file (.ioc file) under Pinout & Configuration -> Middleware -> STM32_WPAN -> Configuration. I edited the variables CFG_HW_USART1_ENABLED, CFG_DEBUG_TRACE_UART, along with the previously mentioned macros. After doing this, the build process completed successfully, but there was no output on the UART.

The issue might be related to the fact that the debugger messages are printed using a printf function, which should be redirected to a UART transmit function. However, I can't figure out how to generate the necessary code. I tried enabling BSP support, but doing so made UART1 unselectable in the Connectivity menu.

Does anyone know the solution?

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
STTwo-32
ST Employee

Hello @matteverze 

Have you followed all the steps of trace configuration as mentioned on the https://wiki.st.com/stm32mcu/wiki/Connectivity:STM32WB_BLE_STM32CubeMX#Enable_traces

Best Regards.

STTwo-32 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

2 REPLIES 2
STTwo-32
ST Employee

Hello @matteverze 

Have you followed all the steps of trace configuration as mentioned on the https://wiki.st.com/stm32mcu/wiki/Connectivity:STM32WB_BLE_STM32CubeMX#Enable_traces

Best Regards.

STTwo-32 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Thank you for the reference to the guide. It works now!

Best,

Matteo