2024-10-06 2:36 AM - last edited on 2025-10-18 2:04 AM by Andrew Neil
Hello All,
I am using STM32F103C8T6 dev board and implemented UART code with RX idle line interrupt. I tested using USB to TTL converter it working as expected. But when I connected this UART to the Bluetooth module, it did not get interrupt if the command length was more than 1 byte.
This behavior is very wired because it works when connect USB to TTL and not work when want to actual hardware with Bluetooth module.
My working simple code is
HAL_UARTEx_ReceiveToIdle_DMA(&huart3, Serial3RxData, UART3_RX_MAX_LEN);
void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size)
{
// printf("UART SERIAL REC:%s\r\n", Serial3RxData);
isSerialAvailble = 1;
HAL_UARTEx_ReceiveToIdle_DMA(&huart3, Serial3RxData, UART3_RX_MAX_LEN);
} //when isSerialAvailble is set trigger the function and execute RX command.
Edited to apply source code formatting - please see How to insert source code for future reference.
2025-10-18 2:02 AM - edited 2025-10-18 2:07 AM
Welcome to the forum.
@vsb wrote:I am using STM32F103C8T6 dev board ... the Bluetooth module
What board? What Bluetooth module? How, exactly, are they connected?
Please give details - see: How to write your question to maximize your chances to find a solution.
@vsb wrote:I tested using USB to TTL converter ,
How, exactly, did you test?
Do you mean with the STM32 connected to a PC terminal via the USB-to-UART converter ?
Did you also try connecting this "Bluetooth module" to the PC terminal via the USB-to-UART converter ?
Does that work?
Are you sure that this "Bluetooth module" has compatible logic levels, correct baud rate, etc?
Tips on debugging serial comms.
PS:
Please also show your full code.
The code posted uses DMA - have you tried using just basic, blocking calls before adding the complications of DMA?