Asynch - Serial example fails due to linker issue

Hi All,

I have been trying to build the Asynch-serial communication example provided in

But, the build fails due to linker issues. The linker is unable to find the definitions for the function
undefined reference to mbed::SerialBase::read undefined reference to mbed::SerialBase::write

In Serial.h file the methods are hidden as using the DEVICE_SERIAL_ASYNCH preprocessor

#if DEVICE_SERIAL_ASYNCH
using SerialBase::read;
using SerialBase::write;
#endif

In order to invoke these function in serial_async.cpp, I define as below
#define DEVICE_SERIAL_ASYNCH 1
before adding the includes. But, this is of no help and still the linker is unable to find the two methods.

undefined reference to mbed::SerialBase::read undefined reference to mbed::SerialBase::write

Can someone let me know if I am missing something?

Thank you.

Regards,
Richard

Hi Richard,

Which target are you building for? (You can use the yotta target command to display this, or it’ll also be included at the start of the output that yotta build displays)

Also note that you can put triple back-ticks around code to format it correctly in the forum:

```
(code here)
```

Hi James,

Thank you for your response. I’m using the target nrf51dk-gcc. I have tried building by setting the target as frdm-k64f-gcc and it runs fine.

Thanks
Richard

Hi James,

On going through the post NRF51 does not support mbed OS aysnch-serial, I understand the mbed OS drivers are not yet created to support asynch-serial on NRF51DK boards.

Do you have any information when these drivers would be released? Also do we have any sample code to demo serial communication on NRF51?

Thanks

Best
Richard

Yes unfortunately they’re not supported yet on nrf51, sorry!

I don’t have any more information on when they’ll be available, beyond Rohit’s response here that it’s something being worked on!