Have you looked at the UART examples that comes along with FX3 SDK.
Please have a look at the "UartLpDmaMode" example. This example gets 32 bytes of data from the HyperTerminal and prints back on HyperTerminal once FX3 gets 32 bytes of data.
One of my problems is that I want to be able to make commands of different size. I can setup the DMA size as low as 16 byte, byt I wan to be able to make commands down to 4 chars.
I was looking at register mode, but I can't get the "Call-back" for the UART to work in register mode.
Right. We can setup the DMA size as low as 16bytes. I don't see a way to make it to 4 bytes. You may need to enter remaining bytes in the command as empty spaces to generate a event in the firmware. :)
I experienced the same issue! You need to use the UART register-mode to receive a variable number of bytes which is less than 16! For this you don't need any callback since the only events which you can catch in register-mode are RX_DONE, TX_DONE and ERROR.
Just use the API CyU3PUartReceiveBytes() to receive byte by byte and check for <CRLF> which usually is used to finish the input at the console.
That is one way to do it. One of the problems is that you need a timer interrupt to check the status, and you will use a lot of CPU time, because you can't get an interrupt at the right time.
Why will not there be a function to understand the reception status of Uart? In FX2, I can get that by check SCON!