AnsweredAssumed Answered

HAL_UART_TxCpltCallback callback not serviced on completion

Question asked by murugesan.kudiarasu on Dec 29, 2015
Latest reply on Dec 31, 2015 by Clive One

I  am developing application for  stm32l0 using CUBEmx and keil, my intention is to  transmit command to modem and receive  response , so I have used to Transmit data and receive data through UART RX DMA.

I am able to transmit data through hlpuart1 , huart2 successfully , but unable to get  HAL_UART_TxCpltCallback on data reception ,

I have enabled breakpoint and checked Rx and Tx buffer , as expected transmitted data in TxBuffer  received in RXBuffer, But  callback has not serviced.

Main loop

                if(current_state == IDLE){

                                                                current_state = TRANSMITTING;

                                                                HAL_UART_Receive_DMA(&hlpuart1,RxBuffer,6);

                                                                HAL_UART_Transmit(&hlpuart1,TxBuffer,sizeof(TxBuffer),1000);

                                                                HAL_Delay(5000);

                                                  HAL_UART_Transmit(&huart2,RxBuffer,6,1000);

                                                while(current_state != RECV_READY)   (Control stalled here because current stare  not cleared  by HAL_UART_TxCpltCallback)   

                                                {

                                                }

                                                HAL_UART_Transmit(&huart2,TxBuffer,6,1000);

                                                current_state = IDLE;

 

                                 }

 

 

void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)

{

                current_state = RECV_READY;

}

 

Any one can throw some light where I made mistake

Attachments

Outcomes