cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103 UART RX idle line interrupt not getting on other hardware

vsb
Associate

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.
Is there any external pullup or pulldown for Rx line required? What could happen when send more than 1 byte length and then not receive interrupt?
 
Thanks in advance, 

Edited to apply source code formatting - please see How to insert source code for future reference.

1 REPLY 1
Andrew Neil
Super User

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?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.