BT NUS logging corruption

In our development using NCS-2.6.1 it is desirable to have logs using BT NUS.

"Serial Bluetooth Terminal" android application is used. Logs are having corruption.

Looks like remains of longer message is spilled out to following shorter messages.

Same behaviour shows sample application ble_backend. To show issue better the ble_backend application while loop part modified to

static int c = 0;
while (1) {

uint32_t uptime_secs = k_uptime_get_32()/1000U;
if ( c == 0)
LOG_INF("hello");
else
LOG_INF("Uptime %d secs", uptime_secs,c);
c = (c+1) % 2;
k_sleep(K_MSEC(1000));
}

in such case output is
[00:00:00.818,939] ble_backend: BLE Logger Backend enabled.
[00:00:01.005,340] ble_backend: Uptime 1 secs
end enabled.
[00:00:02.005,493] ble_backend: hello
1 secs
end enabled.
[00:00:03.005,645] ble_backend: Uptime 3 secs
end enabled.
[00:00:04.005,798] ble_backend: hello
3 secs
end enabled.
[00:00:05.005,950] ble_backend: Uptime 5 secs
end enabled.
[00:00:06.006,103] ble_backend: hello
5 secs
end enabled.

Kind Regards

Parents
  • Hi,

    I am not familiar with the "Serial Bluetooth Terminal" Android application, but I have attempted to reproduce using your change to the ble_backend sample with your changes and official Nordic apps (nRF Connect and nRF Toolbox). With these I always get the full line as a separate notification, and it is displayed as such (with nRF Connect you only see each update, but with nRF Toolbox you see each line in the log). Can you test with one of the Nordic apps as well and see if you see the same? If you do, can you then make a sniffer trace (using for instance nRF Sniffer for BLE) so that we can see more about what is going on on your end that could hopefully explain the difference?

Reply
  • Hi,

    I am not familiar with the "Serial Bluetooth Terminal" Android application, but I have attempted to reproduce using your change to the ble_backend sample with your changes and official Nordic apps (nRF Connect and nRF Toolbox). With these I always get the full line as a separate notification, and it is displayed as such (with nRF Connect you only see each update, but with nRF Toolbox you see each line in the log). Can you test with one of the Nordic apps as well and see if you see the same? If you do, can you then make a sniffer trace (using for instance nRF Sniffer for BLE) so that we can see more about what is going on on your end that could hopefully explain the difference?

Children
No Data
Related