After having a problems with a function using vsnprintf, I finally boiled it down to sprintf. Every 128 characters that has been run through sprintf, it truncates the output.
Steps I used to reproduce it:
* I took the simplest example I could find which used the logging functionality (examples/peripheral/temperature)
* Changed the main function to after printing the temperature, do the following:
Fullscreen
1
2
3
4
5
6
7
NRF_LOG_INFO("Actual temperature: %d", (int) temp);
nrf_delay_ms(500);
+ size_t rc = sprintf(buf, "01234567890123456789");
+ NRF_LOG_INFO("Result: %s (%d)", nrf_log_push(buf), rc);
NRF_LOG_FLUSH();
* (buf is a global char array with size 32)
* Added RTT functionlity to get the logs through Segger RTT
* This resulted in the output to be as follows:
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<info> app: Result: 01234567890123456789 (20)
<info> app: Actual temperature: 27
<info> app: Result: 01234567890123456789 (20)
<info> app: Actual temperature: 27
<info> app: Result: 0 (20)
<info> app: Actual temperature: 27
<info> app: Result: 01234567890123456789 (20)
<info> app: Actual temperature: 27
<info> app: Result: 01234567890123456789 (20)
<info> app: Actual temperature: 27
<info> app: Result: 01234567890123456789 (20)
<info> app: Actual temperature: 27
<info> app: Result: 01234567890123456789 (20)
<info> app: Actual temperature: 27
<info> app: Result: 01234567890123456789 (20)
<info> app: Actual temperature: 27
<info> app: Result: 01234567890123456789 (20)
<info> app: Actual temperature: 27
<info> app: Result: 0 (20)
<info> app: Actual temperature: 27
<info> app: Result: 01234567890123456789 (20)
Note that it prints 128 ((20 + \0) * 6 + 1 + \0) characters before truncating, this repeats constantly. It still thinks it printed 20 characters however.
This is on SDK 15.3.0, btw.