KE04z UART IRQ receive problem.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

KE04z UART IRQ receive problem.

864 Views
grochal7
Contributor III

Hello,

i initialize my UART and send some data from board to putty. It works fine.

I can send data from ke04z to putty.

I try send some character from putty to my board. 
Always the same:

pastedImage_1.png

It is some problem with my receive irq. When RX irq occures - mcu stops on IntDefaultHandler. 

How to set my RX irq correctly?

I tried to use library (sdk) and change it, still the same.

(I cant use SDK examples cause it is to big for my uC)

Regards!

4 Replies

561 Views
mjbcswitzerland
Specialist V

Hi Tomasz

Do you use interrupts for transmission?

The KE04 shares an interrupt vector for Tx and Rx so if you are using Tx interrupts (that are working) the problem  is not with the UART vector but it may be a hard fault (without a handler) due to how the rx data is being handled.

If you don't use Tx interrupts it is presumably due to there being no UART vector installed for it.

Regards

Mark

561 Views
grochal7
Contributor III

Hi Mark!

I use interrupts only for receiving.

My code is similar to the uart_interrupt example from SDK.

I receive characters from putty with interrupt method and send it to putty without interrupts (echo).

I initialize uart, and then set:

/* Enable RX interrupt. */
UART_EnableInterrupts(UART, kUART_RxDataRegFullInterruptEnable | kUART_RxOverrunInterruptEnable);
// EnableIRQ(DEMO_UART_IRQn);
NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)UART_IRQ_ID) & 0x1FUL));

It is ok?

Thanks!

0 Kudos

561 Views
mjbcswitzerland
Specialist V

Tomasz


What is your interrupt handler called and how have you entered it into the vector table?

Regards

Mark

0 Kudos

561 Views
grochal7
Contributor III

Mark,

thank U for help!

I found it.

I used "UART_IRQHandler" , not "UART0_IRQHandler"  -.-

Regards!

0 Kudos