cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to implement receive data on UART interrupt on STM32F103C8T6

JPanc.1
Associate II

I bought STM32 blue pill(STM32F103C8T6) and started learning on STM32 usng STM32CubeMX and TRUEStudio and successfully LED and UART2 transmitt.

But I want to implement UART receive using interrupt but unable to do so.I have tried as per example but still not getting data.Can any body help me with this?

void HAL_UART_RxCpltCallback(UART_HandleTypeDef *UartHandle)

is i right function for uart recive interrupt??? 

12 REPLIES 12

>>arguments passed to sprintf call seems strange in my opinion. Not sure to understand what you want to do here

Evidently a memcpy(), at least the OP understood not to use the live buffer.

S.Ma
Principal

Other alternate way to interrupt would be to use a big RAM buffer cyclically updated by DMA from USART RX.

As long as main loop check it out before it could be overflow, at least reception is manageable.

My question was rather related to use of sprintf function, according to its prtotype : sprintf(char *str, const char *format, ...).

Calling :

sprintf(Tx_buffer,Rx_buffer,sizeof(Rx_buffer));

with sizeof(Rx_Buffer) as arg3, with Rx_buffer containing "Hello world" still seems strange to me.