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

nRF52840 SDK16 - Print an array of hex values using NRF_LOG_HEXDUMP_INFO

Hi everyone,

I want to serial print an array of bytes in hex format. The array size is 200bytes. I tried to use the NRF_LOG_HEXDUMP_INFO but it doesn't print all the array, it prints just the first 72bytes

The second approach works fine. How I would like to use the  NRF_LOG_HEXDUMP_INFO since it is an out of the box function.

// First approach
  NRF_LOG_HEXDUMP_INFO(read_raw_data,read_payload);

// Second approach
  char changeline = 20;
  for (int i = 0; i < read_payload; i++) {
    NRF_LOG_RAW_INFO("0x%x ", read_raw_data[i]);
    NRF_LOG_FLUSH();
    if (i == changeline-1) {
      NRF_LOG_RAW_INFO("\r\n");
      changeline += 20;
    }
  }

Thanks in advance

Nick

Parents Reply Children
No Data
Related