Hi,
I am using a MAX32630FTHR board. I want to generate an interrupt when a character has been transmitted to the TX pin of an UART. I am using the Serial library, I can send and receive characters, but interrupts do not work and I have found several people encoutering the same issue on the web. Even the given example here : Serial - Handbook | Mbed does not work :
#include "mbed.h"
DigitalOut led1(LED1);
DigitalOut led2(LED2);
Serial pc(USBTX, USBRX);
void callback() {
// Note: you need to actually read from the serial to clear the RX interrupt
printf("%c\n", pc.getc());
led2 = !led2;
}
int main() {
pc.attach(&callback);
while (1) {
led1 = !led1;
wait(0.5);
}
}
It is supposed to blink the LED, but when I send a character to the board it gets stuck (the LED stops blinking) and nothing more happens.
Is there a solution ?