9 years, 8 months ago.

K64FRDM Serial test(PTC17, PTC16) hangs after Rx irq handler call

Hi everyone, trying to get the following running on K64FRDM. the board is connected to Win7 PC. K64FRDM->MAX232->Serial2USB->Win7 PC On PC in PuTTY terminal I see "hello", and "+" symbols coming every seconds. once I type in putty the board makes the blue LED bright and hangs. no "+" and the green led is not blinking.

would you suggest how to fix that?

thanks, below is a project I use for testing

  1. include "mbed.h"

DigitalOut led(LED_GREEN); DigitalOut led1(LED_BLUE);

void irq(){ led.write(!led.read()); }

int main() { Serial test(PTC17, PTC16); test.attach(&irq);

test.putc('h'); test.putc('e'); test.putc('l'); test.putc('l'); test.putc('0');

while (true) { test.putc('+'); led1.write(!led1.read()); wait(1);

} }

Question relating to:

The Freedom-K64F is an ultra-low-cost development platform for Kinetis K64, K63, and K24 MCUs.

Adding <<code>> and <</code>> makes things a bit more readable in these posts. Just FYI

posted by Sam Grove 14 Aug 2014

1 Answer

9 years, 8 months ago.

In the rx handler if the character received isn't read you'll end in a endless irq loop since the data is still in hardware. Can you try to add test.getc() to the rx handler?

Accepted Answer

that works, thanks!

posted by Alexey K 14 Aug 2014