This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Multi-NUS-Master forwards gibberish from Peripherals

After several months of attempts, I was finally able to load, build, and flash the code from multi-NUS-master.zip using the VS version of nRF Connect, onto the nRF52840 DevKit. The code appears to run, and it connects to multiple Peripherals via the NUS service. When a peripheral sends data via NUS, the master tries to forward it via the Interface MCU to the USB serial port. However, the data is gibberish. I have looked at the data being received, on the serial TxD line (P0.06) between the nRF52840 and the Interface MCU. It should be pure printable ASCII text, but the first few bytes are 0x00, 0x1D, 0x00, 0x20, 0x03. The over-the-air BLE data is fine, because I can view that with a single-connection version of the uart-c example running on another board. So I am suspecting that somewhere in the multi-NUS-master code a buffer is not being allocated correctly, a pointer is corrupted, etc. I furhter suspect the underlying problem is that I missed configuring something important in the nRF Connect or VS installation. Can anybody give me some pointers? (pun intended)

Parents
  • Hi Steve, 

    Could you please clarify that you can receive UART data normally on PC if you test with the single link central_uart and peripheral_uart ? 
    As far I can see there isn't any modification with regard the way UART data is printed out. 
    It's first printed by using uart_tx() in ble_data_received() function. If that failed the data will be buffered into fifo_uart_tx_data fifo data using k_fifo_put()

    And then after that when UART_TX_DONE event occurred  in uart_cb() the data is pulled out from fifo and sent out again via UART. 

    I would suggest to test if you can print out something in UART using uart_tx() maybe in main() ? 

Reply
  • Hi Steve, 

    Could you please clarify that you can receive UART data normally on PC if you test with the single link central_uart and peripheral_uart ? 
    As far I can see there isn't any modification with regard the way UART data is printed out. 
    It's first printed by using uart_tx() in ble_data_received() function. If that failed the data will be buffered into fifo_uart_tx_data fifo data using k_fifo_put()

    And then after that when UART_TX_DONE event occurred  in uart_cb() the data is pulled out from fifo and sent out again via UART. 

    I would suggest to test if you can print out something in UART using uart_tx() maybe in main() ? 

Children
No Data
Related