Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SDK 12.3 solution how to extend hexdump limit >1kB

Hello,

Library seems to have limitation to 1kB. I'am talking about deffered mode.

You can increase NRF_LOG_DEFERRED_BUFSIZE >1kB, but it will crash if you try to print (NRF_LOG_INTERNAL_HEXDUMP_DEBUG(p_data,1025) f.e.)

This is due that NRF log uses length field is bitmasked to 10 bits meaning that max allowed size is 1024Bytes.

I want to share solution, extend bitmask from 10->16bits giving enough "length" range to print over 1kB sizes.

Also i increased  NRF_LOG_BACKEND_MAX_STRING_LENGTH from default 512 to my 2kB, not sure yet if that was necessary.

This is practical observed crash and just found a cause today, and solving took ~5hours. 

Parents Reply Children
No Data
Related