Bug in generated UART code | Cypress Semiconductor
Bug in generated UART code
I've spent some time today tracking down a bug in the provided UART code.
I have a large (4k) software RX fifo configured in PSoC BLE UART (for RS-232 data).
When that RX buffer gets overfull, the ISR code generated by the PSoC Creator gets stuck: It has set the related irq mask to 0x5 (NOT_EMPTY and TRIGGER), but the ISR code, at least when the fifo is full, does not have an action to clear TRIGGER as a source and only explicitly clears NOT_EMPTY. As a result it gets stuck in the ISR, with irq source of 0x01 (TRIGGER, but not NOT_EMPTY).
My quick solution is to clear TRIGGER as a irq source. Better would be clear TRIGGER in the ISR, but I'm not sure of the implications of that.
On a related note, I find the API for UART to be weird. I need to send blocks of data, but only the most basic "put string" functions are provided for UART. I've been using the SPI functions (PutArray, UART_SpiUartGetRxBufferSize) functions to acheive the same results. I can't find any "block read" function, and UART_UartGetByte() doesn't return a byte, etc...