2025-04-28 5:58 AM
Hi guys,
I'm working on a pretty simple cable replacement client/server program to exchange data form one device to another.
When I enable traces in CubeMX for the WPAN/BLE part, my STM32WB5 is visible (I can see it from my phone or using a Nordic USB Dongle, connect to it and exchange data). All traces go to USART1.
Then, since everything works, I disable traces (CFG_HW_USART1_ENABLED to Disabled, CFG_DEBUG_* to Disabled, BLE_DBG_APP_EN to Disabled, etc.). At this point, I can't see anymore my device in the phone list even tough aci_gap_set_discoverable returns 0.
I don’t understand how disabling traces can prevent the rest of the BLE stack from running.
Any help on this would be appreciated.
Thx !
2025-04-28 10:02 AM - edited 2025-04-28 10:02 AM
Hello @GuilhemG
Without CFG_DEBUGGER_SUPPORTED, CFG_DEBUG_BLE_TRACE and CFG_DEBUG_APP_TRACE defines, the UART is not configured, then each access to the UART for any printf or traces are forbidden to do not generate some hardfault. CFG_DEBUG_BLE_TRACE and CFG_DEBUG_APP_TRACE defines can be disabled with the CFG_DEBUGGER_SUPPORTED define enabled. CFG_DEBUG_BLE_TRACE and CFG_DEBUG_APP_TRACE defines cannot be enabled without the CFG_DEBUGGER_SUPPORTED define enabled. This is managed with the following lines of the app_conf.h file:
#if ( (CFG_DEBUG_BLE_TRACE != 0) || (CFG_DEBUG_APP_TRACE != 0) )
#define CFG_DEBUG_TRACE 1
#endif
#if (CFG_DEBUG_TRACE != 0)
#undef CFG_LPM_SUPPORTED
#undef CFG_DEBUGGER_SUPPORTED
#define CFG_LPM_SUPPORTED 0
#define CFG_DEBUGGER_SUPPORTED 1
#endif
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.