I have a STM32F401 Nucleo board and I use the async serial read with a SERIAL_EVENT_RX_CHARACTER_MATCH event. I have some problems withe the behavior of this event. I do not know if I found an error in the HAL or if this the correct behavior.
For me, a SERIAL_EVENT_RX_CHARACTER_MATCH event means, that the callback function will be called and the async serial read will abort (IRQ will be automatically disabled withe the first SERIAL_EVENT_RX_CHARACTER_MATCH event). Is this correct?
But at the moment, the SERIAL_EVENT_RX_CHARACTER_MATCH occurs, the callback function is called ans the serial IRQ is still enabled. So I get more than one function callback. The IRQ will be disabled if the buffer is full. But then I get no SERIAL_EVENT_RX_COMPLETE event. So it means in every case, the IRQ will be only disabled if the receive buffer ist full. Or should I disable the IRQ by myself (e.g. withe serial_rx_abort_asynch() call )? Is this behavior correct?
/** The asynchronous TX and RX handler.
*
* @param obj The serial object
* @return Returns event flags if an RX transfer termination condition was met; otherwise returns 0
*/
int serial_irq_handler_asynch(serial_t *obj);
This means that any event is terminating the receiving.