2 years, 1 month ago.

Problem with Rawserial transmit interrupt on NUCLEO-F446RE

Platform: NUCLEO-F446RE

At MBED rev 147 this code works:

rawserial.cpp MBED 147

#include "mbed.h"

DigitalOut greenLed(PA_5);

void txISR(void) {
    greenLed = 1;
}

int main() {
    RawSerial r(USBTX, USBRX);
    r.attach(txISR, Serial::TxIrq);
    while(1) {
        greenLed = ! greenLed;
        wait_ms(1000);
    }
}

When the txISR routine is attached an interrupt occurs (because the transmitter is empty) and the greenLed is switch on. Then the main while loop then starts and the greenLed switches on and off.

At MBED rev 148 and newer, this has stopped working. The greenLed switches on, but it stays on - the while loop never gets run.

(This is a much simplified version of the actual program which has a class deriving from RawSerial and a member function attached. For this program the greenLed does not switch on and the while loop is not run.)

Comment on this question

1 Answer

11 months, 3 weeks ago.

@pkay - did you ever figure out an answer/solution to this problem? We are experiencing similar problems. There is a lot of discussion in this forum around serial functionality problems arising with rev 148 but seemingly very little resolution.

I have a project that has Rev147 libraries. I make sure my students copy this project at the start of all their assignments. Every year I taught my course something would break half way through it. At one stage a 32 bit timer suddenly got downgraded to be only 16 bits even though the hardware is32 bits, then the serial interrupt problem occurred and I couldn't really manage like that. The early students (the good ones) didn't have any problems, but the late students picked up new libraries and they had all sorts of problems. So now I'm content to stay with an old revision of the library. Thankfully the functionality of rev 147 is good enough for our needs, and I really do like the MBED environment.

I don't know if the serial interrupts ever got fixed. I never got any feed back.

Sorry if this is not the answer you were hoping for.

Peter

posted by PETER KAY 26 Nov 2018

Thanks for the feedback, @pkay. We are not really sure if the problem we are having is exactly the same as yours but were hopeful we found an easy fix. Alas, that does not appear to be the case. We will keep looking and post here with an update if/when we find more info and/or an actual resolution.

posted by John Greene 27 Nov 2018

You need to log in to post a question