cancel
Showing results for 
Search instead for 
Did you mean: 

How to use USART2 instead of USART1 in BLE_p2pServer example?

ledi7
Associate III

Hi @STTwo-32 ,

I am using the BLE_p2pServer example with NUCLEO-WBA55 and want to use USART2 instead of USART1. If I use USART1 and send a byte via HTerm, the task UTIL_SEQ_SetTask( 1<<CFG_TASK_SEND_NOTIF_ID, CFG_SEQ_PRIO_0); should be executed as soon as an RxCpltCallback event (in file usart_if.c) is triggered.

static void UsartIf_RxCpltCallback(UART_HandleTypeDef *huart) { /* USER CODE BEGIN UsartIf_RxCpltCallback 1 */ UTIL_SEQ_SetTask( 1<<CFG_TASK_SEND_NOTIF_ID, CFG_SEQ_PRIO_0); /* USER CODE END UsartIf_RxCpltCallback 1 */ RxCpltCallback(&charRx, 1, 0); HAL_UART_Receive_IT(&huart1, &charRx, 1); /* USER CODE BEGIN UsartIf_RxCpltCallback 2 */ /* USER CODE END UsartIf_RxCpltCallback 2 */ }

When I establish a BLE connection with the ā€œnRF Connectā€ app, I receive the corresponding notification (Same effect as when I press button1)

2025-01-22_11h21_15.png

and I also receive the corresponding logs via HTerm.

2025-01-22_11h23_49.png

But if I now change ā€œserial links for logsā€ to USART2 and configure USART2 exactly the same as USART1, I get confused characters as log information like this:

2025-01-22_09h49_41.png

2 REPLIES 2
_Joe_
ST Employee

Hi,
Can you try activating Hardware Flow Control (RS232) CTS + RTS?
This can be done via MX in the UART config.
Let me know if you still have this behavior, please.
BR, JoƩ