cancel
Showing results for 
Search instead for 
Did you mean: 

Send trace information to USART2 instead of USART1 in BLE_p2pServer example?

ledi7
Associate III

Hi,

with the BLE_p2pServer example for STM32WBA55, i want to change the interface from USART1 to USART2. How can i use the trace information like

2025-01-21_11h25_29.png

with USART2?

6 REPLIES 6
ledi7
Associate III

Hi Andrew,

Thanks for the information, but this is not what I want to do. I am using the BLE_p2pServer example for WBA55 and there is already a lot of log information here that I want to use and which is handled in stm32_adv_trace.c for example. This works for USART1, but I want to output this information to USART2. There must be a definition somewhere where I can define the interface for the output.


@ledi7 wrote:

there is already a lot of log information here that I want to use and which is handled in stm32_adv_trace.c .


So the question was: does that handling use printf ?

If it does, then the link shows you how that works and, thus, how to change it to a different output device.

If not, then just look at the stm32_adv_trace.c code to see where it does handle its UART, and change that ...

No, printf is not used here. I tried to find some hints in stm32_adv_trace.c or log_module.c but unfortunately without success.

According to the readme.txt,

@note Debug traces can be enabled/disabled in app_conf.h 

      To get the traces, you have to enable CFG_USB_INTERFACE_ENABLE, with CFG_DEBUG_BLE_TRACE for BLE services traces 
      or with CFG_DEBUG_APP_TRACE for application traces.

      On the PC side:
       - open a terminal window with the following settings:
         baud rate of 115200
         Byte size of 8
         Parity None
         Stop bits 1
         Data Flow Control None

Available Wiki pages:
  - https://wiki.st.com/stm32mcu/wiki/Connectivity:BLE_overview

For more details refer to the Application Note: 
  AN5289 - Building a Wireless application    

https://github.com/STMicroelectronics/STM32CubeWB/tree/master/Projects/P-NUCLEO-WB55.USBDongle/Applications/BLE/BLE_p2pServer

So there's some things to look into ...

 

STTwo-32
ST Employee

Hello @ledi7 

To send the trace information to USART2 instead of USART1 in the BLE_P2PServer app for the Nucleo-WBA55CG you have to:

  • Open the .ioc file of the project.
  • Enable USART2.
  • Go to the STM32_WPAN middleware>Configurations>Platform Settings>Serial Link for Logs>Found Solutions and select USART2

STTwo32_0-1737459666719.png

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.