UARTE: uart_fifo_read() - 4th byte always 0x00

Hi,

I am not sure where to go next, so looking for some debug help.

Setup:
I am using the 9160DK - the 52840 is being used as an ANT+ receiver, where it forwards on UARTE to 9160.

I have taken the code back to the basics, where I send 8 bytes containing 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 from the 52840 to the 9160, of which I receive the following on the 9160:

01 02 00 00 05 06 07 08
01 02 00 00 05 06 07 08
01 02 03 00 05 06 07 08
01 02 03 00 05 06 07 08
01 02 03 00 05 06 07 08
01 02 00 00 05 06 07 08
01 02 03 00 05 06 07 08
01 02 03 00 05 06 07 08
01 02 03 00 05 06 07 08
01 02 03 00 05 06 07 08
01 02 03 00 05 06 07 08

As can be seen from above, the 4th byte is always 0x00 and the 3rd byte is occasionally 0x00 - and I cant work out why. 

52840:

I am using nrf_libuarte_async_tx to send the 8 bytes - which appears to be working - as I can see most bytes correctly on the 9160.

9160:

in uart_cb():

while (true)
{
  data_length = uart_fifo_read(x, &uart_buf, 1);
  if (data_length != 1) { 
    printk("\n");
    break;
  }
  printk("%02X ", uart_buf);
}
Other:
* Both devices are set for, 115200 and HW-FC Off (or not set).

Before attaching my entire project here, is there anything obvious that could cause this to happen ?  And, any ideas on the best way to debug this ?
regards
-brett
  • Hi Kenneth,

    I can open a new issue if required, but I am still working on the same problem - maybe.

    Do you have a link or video that I can review which shows how to connect a logic analyser onto the nrf9160dk, so that I can monitor between the 52840 and 9160 chips.

    All runs fine for about 10 minutes and then I get all 0x00's on the 9160 and I am not sure if its the 52840 or the 9160.  For some reason debug on the 52840 is not working the way I need it to, and its hard to see where the problem is.

    regards
    -brett

  • Brett said:
    Do you have a link or video that I can review which shows how to connect a logic analyser onto the nrf9160dk, so that I can monitor between the 52840 and 9160 chips.

    You should only need to connect GND to common ground between DK's. Then connect the RXD and TXD pins to two input pins of the logic analyzer, then start tracing from the logic analyzer, if you set the baudrate in the logic analyzer you should be able to observe the data on byte level.

    Kenneth

Related