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

NRF_LOG_HEXDUMP_INFO Extra Characters

I'm trying to print a 20 byte array over uart before sending it on BLE. My array contains:

{0x34, 0x12, 0x00, 0xFF, 0x00, 0xFF, ..., 0x00, 0xFF}

However when I try to use the NRF_LOG_HEXDUMP_INFO function to print this it only prints 8 bytes per line and I get a bunch of garbage characters at the end of each line:

<info> app:  34 12 00 FF 00 FF 00 FF|4..▒.▒.▒
<info> app:  00 FF 00 FF 00 FF 00 FF|.▒.▒.▒.▒
<info> app:  00 FF 00 FF            |.▒.▒
<info> app:  34 12 00 FF 00 FF 00 FF|4..▒.▒.▒
<info> app:  00 FF 00 FF 00 FF 00 FF|.▒.▒.▒.▒
<info> app:  00 FF 00 FF            |.▒.▒

Does anyone know what's causing this or how to fix it so that it prints all 20 bytes on 1 line without the garbage at the end? I've tried adding a CR and newline at the end of the array but that made no difference.

Related