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

nrf52832 ble_uart project - sending all data received on uart over BLE

Hi

I have problem because i dont get all data which are in FIFO uart  on my smartphone via BLE. Nrf as i can see in example sends data where data[index-1] == 0x0d || data[index-1] == 0x0a.

Becase not all message which nrf52832 get via uart ending with 0x0d or 0x0a i dont receive on my smartphone.

I want that every byte nrf52832 get on uart it sends over ble. I have tried with smaller buffer and changing/adding conditions in 

but nothing help with that. When messages are ended with 0x0d 0x0a i dont see on my smartphone 0x0a.

  • After a while i have solve this. Now every byte it receive over UART it pass it over BLE .

  • It all works well when i using baudrate 300 but when change to baud 9600 and send to nrf52s uart same 50+ bytes(which i send when baudrate is 300 and get every byte to smartphone) i receive on my smartphone from 25 to 40 bytes.

    EDIT: max data lenght in both directions is 512 bytes and max baudrate which will be on uart is 19200. When i send from smartphone 140+bytes  everything is ok. Only when i send to nrf52s uart 50+ byte to  send further over ble to smartphone then on bigger baudrate it doenst get all bytes.

  • Hi,

    Can you try turning on flow control? See if that helps.

  • it is even worse. Message from smarphone doesnt appear on uart and from uart doesnt get to smartphone.

  • Can you try debugging your application and see which error code is returned? Set the define "DEBUG" in your preprocessor and set a breakpoint at the function app_error_fault_handler(). Then try to debug the code, this will let you see which function that triggers the error and which error code is returned.

1 2 3