XMC4500 UART only generating interruption for special keystrokes

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hi Everybody,

I'm working on NuttX RTOS port for XMC4500 MCU and I'm facing a strange issue:

The keystrokes typed in the serial console are not generating Standard/Alternative Receive Interruptions.
In fact only some special keys (i.e.: ENTER, SPACE, PGUP, PGDN, HOME, END, F1-F12, etc) are generating interruption.

If I try polling the OUTR register I can see the correct keys arriving, but it doesn't generates the interruption.

Also I'm not using the TBCTR.STBTEN/RBCTR.SRBTEN = 1 as explained in the Errata:

"USIC_AI.015 Wrong generation of FIFO standard transmit/receive buffer
events when TBCTR.STBTEN/RBCTR.SRBTEN = 1"

I'm configuring the receiver FIFO this way (https://gist.github.com/acassis/9d6a68c41d9f9fb5c6185bfa00eeb000) :


/* Configure receive FIFO.
*
* - DPTR = 0
* - LIMIT = 0
* - SIZE = 2
* - LOF = 1, A standard receive buffer event occurs when the filling
* level equals the limit value and gets bigger due to the reception
* of a new data word
*/

regval &= ~(USIC_RBCTR_DPTR_MASK | USIC_RBCTR_LIMIT_MASK | USIC_RBCTR_SRBTEN |
USIC_RBCTR_SIZE_MASK | USIC_RBCTR_LOF);
regval |= (USIC_RBCTR_DPTR(0) | USIC_RBCTR_LIMIT(0) | USIC_RBCTR_SRBTM |
USIC_RBCTR_SRBIEN | USIC_RBCTR_ARBIEN | USIC_RBCTR_SIZE_2 | USIC_RBCTR_LOF);
putreg32(regval, base + XMC4_USIC_RBCTR_OFFSET);

Also all registers are configured as in DAVE4 serial example:

xmc4_uart_configure: -----------------------------------------------------
xmc4_uart_configure: CCFG = 000080cf
xmc4_uart_configure: IOCR0 = 00009010
xmc4_uart_configure: HWSEL = 00014000
xmc4_uart_configure: OMR = 00000000
xmc4_uart_configure: PDR0 = 22222200
xmc4_uart_configure: INPR = 00000000
xmc4_uart_configure: PCR = 00030901
xmc4_uart_configure: SCTR = 07070102
xmc4_uart_configure: TCSR = 15000580
xmc4_uart_configure: DXCR = 00008003
xmc4_uart_configure: +++++++++++++++++++++++++++++++++++++++++++++++++++++

NuttShell (NSH)
nsh>

I'm configuring the INPR to SR0 and waiting the interrupt XMC4_IRQ_USIC1_SR0 /* 90: USIC1 Channel, SR0 */

As I explained, the interruption is generated, but only for special keys.

I know there are some BUGs in the USIC UART, but this issue is different from other issues I had read:

https://www.infineonforums.com/archive/index.php/t-917.html?

https://www.infineonforums.com/threads/5053-USIC-as-UART-using-receive-buffer-leaves-unread-characte...

Please help me to understand why it is not working for ordinary keystrokes and how to fix it?

BR,

Alan
0 Likes
1 Reply
Not applicable
I fixed this issue. It was related to clock setting and I forgot to enable the right SR for Alternative Receive (USIC_INPR_AINP) at INPR register.
0 Likes