7 years, 11 months ago.

mbed serial rx irq dont work

Hello

Im trying to get rx irq working. Other vice serial work well it sends all lines ect, running rtos and emwin on lpc4088.

pp.attach(&rxfunctio,Serial::RxIrq);

Irq is generated but it does not enter to this function: void rxfunctio (){ Temp_Char = pp.getc(); }

it just stays here, serial_api.c : void uart0_irq() {uart_irq((LPC_UART0->IIR >> 1) & 0x7, 0);}

Any ideas what is wrong???

Which port pins are you using for your UART0 TX & RX pins ? Baud rate for this UART0 ?

Could you try to test the IRQ driven UART0 routine without the RTOS and EMWIN ? Just a basic IRQ driven RX routine to test the same idea.

posted by Sanjiv Bhatia 25 May 2016

1 Answer

7 years, 11 months ago.

Is Temp_Char declared as volatile? If it isn't then code optimization can mean that the variable doesn't get read.

Problem is that it never enters this rxfunctio.

its like attach function does nothing...

No optimization is used. using rawserial.

posted by Jussi Kangas 24 May 2016