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

PCA10040 UART problem

Hi,

I'm using a PCA10040 board with the UART example provided with the v12 SDK, and the data seems to get corrupted somewhere along the way between my Ubuntu machine and the nrf52.

When I do:

 pr@pr:~/nRF5/SDK_12/examples/peripheral/uart/pca10040/blank/armgcc$ for i in {1..64}; do echo -n "1" >>/tmp/data; done; cat /tmp/data > /dev/ttyACM0

I get what I expect:

pr@pr:~/nRF5/SDK_12/examples/peripheral/uart/pca10040/blank/armgcc$ cat /dev/ttyACM0| hexdump -C
00000000  31 31 31 31 31 31 31 31  31 31 31 31 31 31 31 31  |1111111111111111|
*

But when I do:

pr@pr:~/nRF5/SDK_12/examples/peripheral/uart/pca10040/blank/armgcc$ for i in {1..65}; do echo -n "1" >>/tmp/data; done; cat /tmp/data > /dev/ttyACM0

I start to get strange things:

pr@pr:~/nRF5/SDK_12/examples/peripheral/uart/pca10040/blank/armgcc$ cat /dev/ttyACM0| hexdump -C
00000000  55 31 31 31 31 31 31 31  31 31 31 31 31 31 31 31  |U111111111111111|
00000010  31 31 31 31 31 31 31 31  31 31 31 31 31 31 31 31  |1111111111111111|
*

and

pr@pr:~/nRF5/SDK_12/examples/peripheral/uart/pca10040/blank/armgcc$ rm /tmp/data; for i in {1..80}; do echo -n "1" >>/tmp/data; done; cat /tmp/data > /dev/ttyACM0

even gives me:

pr@pr:~/nRF5/SDK_12/examples/peripheral/uart/pca10040/blank/armgcc$ cat /dev/ttyACM0| hexdump -C
00000000  55 53 42 53 fa 01 00 00  00 00 00 00 00 00 00 00  |USBS............|
00000010  31 31 31 31 31 31 31 31  31 31 31 31 31 31 31 31  |1111111111111111|
*
00000040  55 53 42 53 fa 01 00 00  00 00 00 00 00 00 00 00  |USBS............|

Any ideas what I'm doing wrong ?

Thanks.

Patrick

Parents
  • Hi Patrick

    I have not used Ubuntu that much, so I don't have much input there.

    To find out if this is a nRF52 problem or PC/Ubuntu problem, you could connect logical analyzer to the UART communication pins on the nRF52-DK (PCA10040) board and read the bytes directly from RX and TX pins.

    You should find the pin mapping in pca10040.h file, which are

    #define RX_PIN_NUMBER  8
    #define TX_PIN_NUMBER  6
    #define CTS_PIN_NUMBER 7
    #define RTS_PIN_NUMBER 5
    

    Which maps to pins P0.08, P0.06, P0.07, P0.05 on the PCA10040 board.

Reply
  • Hi Patrick

    I have not used Ubuntu that much, so I don't have much input there.

    To find out if this is a nRF52 problem or PC/Ubuntu problem, you could connect logical analyzer to the UART communication pins on the nRF52-DK (PCA10040) board and read the bytes directly from RX and TX pins.

    You should find the pin mapping in pca10040.h file, which are

    #define RX_PIN_NUMBER  8
    #define TX_PIN_NUMBER  6
    #define CTS_PIN_NUMBER 7
    #define RTS_PIN_NUMBER 5
    

    Which maps to pins P0.08, P0.06, P0.07, P0.05 on the PCA10040 board.

Children
No Data
Related