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

NRF DFU HARDWARE VERSION reply not working as expected

Hello,

I am using SDK 15.3 for the development. During the upgrade process I wanted to send the hardware version when requested by the host.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//nrf_dfu_req_handler.c LINE: ~126
static void on_hw_version_request(nrf_dfu_request_t const * p_req, nrf_dfu_response_t * p_res)
{
NRF_LOG_DEBUG("Handle NRF_DFU_OP_HARDWARE_VERSION");
p_res->hardware.hw_version = NRF_DFU_HW_VERSION;
p_res->hardware.part = NRF_FICR->INFO.PART;
p_res->hardware.variant = NRF_FICR->INFO.VARIANT;
/* FICR values are in Kilobytes, we report them in bytes. */
p_res->hardware.memory.ram_size = NRF_FICR->INFO.RAM * 1024;
p_res->hardware.memory.rom_size = NRF_FICR->INFO.FLASH * 1024;
p_res->hardware.memory.rom_page_size = NRF_FICR->CODEPAGESIZE;
}
////////////////////////////////////////////////////////
// nrf_dfu_req_handler.h LINE: ~130
typedef struct
{
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I have made the changes as seen in the code snippet. But I receive just the 32 bytes before modification. Any changes to these variables is reflected in the output that is read.

The problem is when I add an extra uint32_t variable, it doesn't reply!

What could be the problem?

In the image below the value for Hw Version is supposed to be 9(Nine).

HW Output

Thank you!

Best regards,

Navin

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Upgrade Type: NRF_SERIAL_DFU

Device: nRF52832

I have also checked this line, which makes sense. 

Fullscreen
1
#define NRF_SERIAL_MAX_RESPONSE_SIZE (sizeof(nrf_dfu_response_t))
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX