2019-04-01 05:44 AM
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???
2019-04-15 09:35 AM
>>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.
2019-04-15 09:40 AM
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.
2019-04-16 12:22 AM
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.