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

How can I determine the softdevice ID from data in the dfu package?

I have implemented a bootloader without BLE that simply transfers softdevice/application/bootloader from external flash to the internal flash, performs usual validation and copy. 

To avoid the possible incompatibility between the stored softdevice+bootloader  and the stored application, I want to precheck that the stored softdevice+bootloader is compatible with the sd-requirements of the application.  

I discussed this plan in a previous thread about 1 month ago.  https://devzone.nordicsemi.com/f/nordic-q-a/59706/any-way-for-nrfconnect-for-desktop-to-dfu-sd_bl-app-without-reset-or-disconnect

I am just now trying to implement this check but I have hit a snag...  I don't see any indication of the sd-id in the init_cmd.  Since  I am installing a softdevice+bootloader, the fw_version is reporting the bootloader version.  I considered using the value stored in the sd-req field,  however its possible this field would contain multiple values. 

Is it possible to get the sd-id value that was provided to nrfutil pkg generate from the init command?

Is there anyway to look into the softdevice data and extract the softdevice ID, for example is it stored in a fixed location?

Or is it the case that the only way to get the softdevice ID is to activate it and then check the SDID in the MBR?  

Parents
  • Hi Anthony, 

    I am just now trying to implement this check but I have hit a snag...  I don't see any indication of the sd-id in the init_cmd.  Since  I am installing a softdevice+bootloader, the fw_version is reporting the bootloader version.  I considered using the value stored in the sd-req field,  however its possible this field would contain multiple values. 

    Is it possible to get the sd-id value that was provided to nrfutil pkg generate from the init command?

    the init packet does not have any sd-id field, see Init packet on the Infocenter

    When performing SD+BL+APP update, then as we discussed in the previous ticket nrfutil will split this into two updates, first a SD+BL update and then APP update.  So when generating a SD+BL+APP firmware package the zip will contain two init packets(.dat files) one for the SD+BL and one for the Application. 

    The value passed as --sd-id is he new SoftDevice ID to be used as --sd-req for the Application update. So if want to check the sd-id  then you need to check the sd_req field of the application init packet. 

    Is there anyway to look into the softdevice data and extract the softdevice ID, for example is it stored in a fixed location?

     Yes, the ID of the SoftDevice is stored at a fixed location, 0x300C

    /** @brief Defines the SoftDevice Information Structure location (address) as an offset from
    the start of the SoftDevice (without MBR)*/
    #define SOFTDEVICE_INFO_STRUCT_OFFSET (0x2000)
    
    /** @brief Defines the offset for FWID value relative to the SoftDevice base address. The FWID value
     *         is of type uint16_t.  */
    #define SD_FWID_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET + 0x0C)
    The 

Reply
  • Hi Anthony, 

    I am just now trying to implement this check but I have hit a snag...  I don't see any indication of the sd-id in the init_cmd.  Since  I am installing a softdevice+bootloader, the fw_version is reporting the bootloader version.  I considered using the value stored in the sd-req field,  however its possible this field would contain multiple values. 

    Is it possible to get the sd-id value that was provided to nrfutil pkg generate from the init command?

    the init packet does not have any sd-id field, see Init packet on the Infocenter

    When performing SD+BL+APP update, then as we discussed in the previous ticket nrfutil will split this into two updates, first a SD+BL update and then APP update.  So when generating a SD+BL+APP firmware package the zip will contain two init packets(.dat files) one for the SD+BL and one for the Application. 

    The value passed as --sd-id is he new SoftDevice ID to be used as --sd-req for the Application update. So if want to check the sd-id  then you need to check the sd_req field of the application init packet. 

    Is there anyway to look into the softdevice data and extract the softdevice ID, for example is it stored in a fixed location?

     Yes, the ID of the SoftDevice is stored at a fixed location, 0x300C

    /** @brief Defines the SoftDevice Information Structure location (address) as an offset from
    the start of the SoftDevice (without MBR)*/
    #define SOFTDEVICE_INFO_STRUCT_OFFSET (0x2000)
    
    /** @brief Defines the offset for FWID value relative to the SoftDevice base address. The FWID value
     *         is of type uint16_t.  */
    #define SD_FWID_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET + 0x0C)
    The 

Children
No Data
Related