2025-01-30 02:19 AM
Hi,
i am using the BLE_p2pServer_ota example with NUCLEOWBA55 and i want transmitt a 20 Byte package over USART2 with DMA in circular mode (19200 Baud). Here as an example, i send 20 bytes every second via HTerm to USART2. BLE advertising (every 2s) is working (but i am not connected to the cellphone app).
The Rx Callback function is inside p2p_server_app.c and here i want to toggle the blue LED:
/* USER CODE BEGIN FD_LOCAL_FUNCTIONS*/
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
if(huart->Instance == USART2) // Rx Callback for USART2
{
BSP_LED_Toggle(LED_BLUE);
}
/* USER CODE END FD_LOCAL_FUNCTIONS*/
But after several transmissions (between 50 and 150) the callback function is no longer called.
Does anyone have an idea what is going wrong?
2025-02-06 02:50 AM
I'm not clear what that scope trace is supposed to be showing?
2025-02-06 02:59 AM
The scope image shows a strong jitter. Here at 115200 baud the jitter is not as strong, but still present.
2025-02-06 03:15 AM
What do you mean by "jitter"?
You won't get a steady scope display unless the data being sent is constant!
So either:
2025-02-06 04:54 AM
Yes, the measurement method is probably not optimal. It looks better with a single shot, but when I measure the oscilloscope image precisely, I counted the number of bits in it from your trigger point (-500ns) to 399.5 µs.
I counted 46 bits in 400 µs, which gives 8.69565217... µs/bit, which is exactly 115000 baud and not 115200!
115200 baud would correspond to a length of 399.3 µs for 46 bits, so the edge change in the last bit should come a little BEFORE the raster line, but in the image it is more after it.
All in all, this corresponds to a deviation of 0.17% and I don't think it should be a problem.
Here i used the Protocoll measurement method with 19200 baud and PCLK2 as clock source for USART1:
And here I occasionally get an error when I get data from the NUCLEO board when I press button 1.