4 years, 10 months ago.

Nordic nRF52-DK stops its serial communication with a linux pc

I used a windows pc with tera term for the serial communication until now (with online compiler). There everything was working fine. But i wanted to switch to Linux (arch) for the mbed cli. Compiling is working fine, but the connection to the serial port always quits after a first few transmission and the LED stops at its current condition.

I tested multiple Serial terminals in Linux (cat, screen, putty,picocom...) but everywhere the same behaviour. The "port" was always /dev/ttyACM0.

So I first thought the maybe my Linux configuration has some problems but i tested with an arduino under the same conditions and everything worked fine (9600 baud rate, 8 bits, 1 stop bit, no parity).

Now to the question: Is there a bug with the mbed library or the nrf52-DK using the serial port? And is there a workaround?

Greetings, Chris

Here the simple code example i used to test the "bug":

#include "mbed.h"

DigitalOut led1(LED1);

Serial pc(USBTX, USBRX); // tx, rx

int main() {
    int counter = 0;
    while (true) {
        pc.printf("test %d \n", counter);
        counter++;
        led1 = !led1;
        Thread::wait(500);
    }
}

Question relating to:

The nRF52 Development Kit is a single-board development kit for Bluetooth Smart, ANT and 2.4GHz proprietary applications using the nRF52 Series SoC. This kit supports both development for nRF52832 SoCs.

2 Answers

4 years, 10 months ago.

Just found the following resolution via a Google search:

https://devzone.nordicsemi.com/question/91854/mbed-os-serial-port-hang/

https://github.com/ARMmbed/mbed-os-example-ble/issues/25

Accepted Answer

Yeah, adding the following mbed_app.json to the root of your project helps:

{
    "target_overrides": {
        "NRF52_DK": {
            "target.uart_hwfc": 0
        }
    }
}

Thanks for your help :-)

posted by Christoph Groß 20 Jan 2017
4 years, 10 months ago.

By default nRF52-Dk target use hardware flow control on serial port (involved RTS/CTS signals) - so the described behaviour is not a bug. As was answered above: it is possible to turn of flow control on DK firmware or turn it on in PC terminal.