This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Getting lots of noise/errors using Serial library.

Hi,

I am getting lots of transmission errors using the Serial library.   I changed the Serial_Uartes example by removing the serial1 interface and creating a simple loopback at 115,200 bps.

Just by holding a key on the keyboard on a screen serial connection creates lots of lost bits.  What could be the problem?

Below is the modified code for .../examples/peripherial/serial_uartes/main.c

The result from a terminal with the a key pressed, looks:

Hello nrf_serial!
aaa�aa�aaaaaaaaaaaaaaaaaaaaaaaaaaaa�aaa��aa�aaaaaaaa�a�a�aaaaaaaaaaaaa��aaaaaaaaaaa�aaaaaaaaaaaaaaaa�aaa�a�aaaaaaaaaaaa�a��aaa�a�aaaaaaaaaaa�aaa�a��aaaaaaaa�aaaaaaaaaaaaaaaaaaaaaaaaa�aaaaaa�aa�aaaaaa�aaaaaaaaaaaaaaaaa�aaaaaaaaaaaaaaaaaa�aaaaaaaa�aaaaaaaaaaaaaaaaaaaaa�aaa�a��aaa�aaaaaaaa�aaaaaaaaaaaaaaaaa�a�aaaaaa��aaaa

I am using the DK pca_10065 board, this is running on the Release configuration, connected through the USB port to a Mac.

I am using this example as a basis for a software that should transmit data reliably between a PC and a BLE sensor on the other side, but just between the board and the PC the communication seems to be very flaky.

Will appreciate any help!

Thanks,

Juan

  • Thanks a lot, Hakon.

    Just for FYI, the UART connection works acceptably if all logging is disabled.  My guess is that logging may be sharing something with UART that creates the problem.  Just my ignorant guess.

    Cheers,

    Juan

  • jfarjona said:
    Just for FYI, the UART connection works acceptably if all logging is disabled.  My guess is that logging may be sharing something with UART that creates the problem.  Just my ignorant guess.

     I tried to disable the logging (I also suspected this one), and still got corrupted characters "here and there", while if I changed the mode to polling (instead of DMA / interrupt driven) it worked as it should, but you do not want polling in a power optimized application.

     

    Kind regards,

    Håkon

  • I decided to use app_uart, which gives me the same problem if logging is enabled, but without logging it works ok at 115200 bps.  I haven’t tried libuarte without logging yet.

    Cheers,

    Juan

1 2