Serial communication not work using mbed and ble nano v2


#1

Hello,
I have a problem with serial communication with mbed platform and ble nano v2.
How to define serial communication pins. The attached code does not work. Code not functioning even the blink does not work if a serial port is defined.
Plain blink without serial communication works!

How to enable communication via P0_29 and P0_30?

#include “mbed.h”

DigitalOut led1(P0_11, 1);
Serial pc(P0_29, P0_30); // tx, rx
//Serial pc(USBTX, USBRX);

// main() runs in its own thread in the OS
int main() {

pc.baud(4800);

while (true) {
pc.printf(“Hello\n\r”);

led1 = !led1;
wait(0.5);
}
}

Resources related to the topic:


https://developer.mbed.org/handbook/USBSerial
https://developer.mbed.org/platforms/Nordic-nRF52-DK/


#2

kindly follow the link “https://os.mbed.com/users/linuxsonu/code/nrf52serial” it will solve your issue.
just need to add the in mbed_app.json
{
“target_overrides”: {
“NRF52_DK”: {
“target.uart_hwfc”: 0
}
}
}