The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

Issue: RawSerial::attach doesn't work in Rev.148 or later

I updated mbed OS 2 library, then my serial library (with FIFO) didn't work.

My mbed (F303RE) stopped at this code

AsyncSerial::AsyncSerial(PinName txpin, PinName rxpin, uint32_t baudrate, uint32_t buffer_size){
	
	led = new DigitalOut(LED1);
	
	// RawSerial port init
	serial = new RawSerial(txpin, rxpin, baudrate);
	
	// FIFO init
	fifo_tx = new FIFO<uint8_t>(buffer_size);
	fifo_rx = new FIFO<uint8_t>(buffer_size);
	
	// Debug
        led->write(1);
        //led->write(0); // Went off
	
	//Initialize ISR (MY MBED STOPPED AT THIS CODE)
	serial->attach(callback(this, &AsyncSerial::ISR_TX), SerialBase::TxIrq);
	serial->attach(callback(this, &AsyncSerial::ISR_RX), SerialBase::RxIrq);
	
	// Debug
	led->write(0);   // Didn't go off
	
	fifo_tx->clear();
	fifo_rx->clear();
	
	Is_Serial_Sending = false;
	
	return;
}

If I revert back to Rev.147, it works fine. My mbed is Nucleo F303RE.

1 comment:

01 Sep 2017