Closed suyog44 closed 1 year ago
LwPKT uses 2 ringbufers for TX and RX operations. Every received character over UART at STM32 should be written to RX ringbuffer of LwPKT instance, and data that should be sent out from STM32 are available in the TX ringbuff.
Now receiving data and how to handle each character is application specific. From what I can see, you have setup 64-bytes received over DMA. Do you guarantee that you will always receive 64-bytes in one shot? If you don't your application may wait forever to get data. I see 2
possible solutions (pick one):
Second option (my opinion) is preferred.
Hi Majrele,
I am planning to construct Multi Device Communication over UART (RS485) protocol. I found LwPKT interesting project to use it. But i am unable to figure out the usage with STM32 UART Interrupt based function. Could you able to give some hints regarding it.
/ Start DMA / if(HAL_UART_Receive_DMA(&huart2, (uint8_t*)pkt_tx_rb_data, 64) != HAL_OK) {
Error_Handler(); }
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) { res = lwpkt_write(&pkt,
}