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

Generate package to migrate SD+BL+APP from SDK15 to SDK17

Hi all,

First I would like to notice that I did look into the forum and found this similar question which did not solve my problem:
https://devzone.nordicsemi.com/f/nordic-q-a/27862/update-sd-bl-app-from-sdk-v13-to-v14-via-dfu-fails

My problem:

  1. I have custom boards that have APP+SD+BL running based on nRF5_SDK_15.2.0 (sd_id 0xAF).
  2. I have an application project and a bootloader project that work with nRF5_SDK_17.0.2. If I merge the SD+BL+APP .hex files and program the custom board with the resulting .hex with a JLINK programmer the code runs as expected
  3. If I generate a DFU .zip with the same content the DFU fails (I am performing DFU over BLE with nRFConnect android APP).
    1. The DFU starts and does the first part (BL+SD?)
    2. Then the app disconnects and tries to connect again as expected for the second part of the DFU (right?)
    3. It stays like this for a while without being able to connect. Then it stops trying and the DFU is not completed. 

This is what I have regarding the nrfutil package generation:

dfu_bootloader_sd_app:
	@nrfutil pkg generate --hw-version 52 --sd-req 0xAF,0x101 --application-version 5 --bootloader $(BOOTLOADER) --bootloader-version 0 --softdevice $(SOFTDEVICE) --sd-id 0x101 --application $(APPLICATION) --key-file $(KEY_FILE) $(OUTPUT_ZIP)


Can you please provide some insight?

Thanks,
Pedro

Parents
  • Hi Pedro, 


    Please use nRF Connect and check if the device after updating the BL+SD if it runs as a Bootloader and advertises anything?

    Any reason why your bootloader version in your script to generate the DFU package was "--bootloader-version 0 " ? 
    Usually the bootloader doesn't allow update to lower or the same bootloader version. 
    Please try to do SD+BL and APP DFU update separately (2 zip files) before testing with one single .zip. 

  • Hi Hung,

    More info:

    When I first created the post I was only trying with nRFConnect on my Android phone. When trying with nRF connect on linux I get this error:

    17:22:31.417	Performing DFU with file: /home/prodrig/Documents/git/ble5_firmware/Output/5.0.0/bl_sd.zip
    17:22:32.458	Attribute value changed, handle: 0x10, value (0x): 01-00
    17:22:32.492	Attribute value changed, handle: 0x0F, value (0x): 02-00-00
    17:22:32.494	Attribute value changed, handle: 0x0F, value (0x): 60-02-01
    17:22:32.546	Attribute value changed, handle: 0x0F, value (0x): 06-01
    17:22:32.562	Attribute value changed, handle: 0x0F, value (0x): 60-06-01-00-01-00-00-00-00-00-00-00-00-00-00
    17:22:32.592	Attribute value changed, handle: 0x0F, value (0x): 01-01-97-00-00-00
    17:22:32.607	Attribute value changed, handle: 0x0F, value (0x): 60-01-01
    17:22:34.150	Received status with code 4 Unknown value, message: 'Error sending packet to target. Code: 0x802a'
    17:22:35.653	Received status with code 4 Unknown value, message: 'Error sending packet to target. Code: 0x802a'
    17:22:37.155	DFU failed with error: When writing 'CREATE' command to Control Point Characteristic of DFU Target: Could not write CREATE command: Failed to write to attribute with handle: 15: Error occured when writing. Errorcode: Unknown value (0x8005) .
    17:22:37.159	Received status with code 4 Unknown value, message: 'Error sending packet to target. Code: 0x802a'
    17:22:38.660	Received status with code 4 Unknown value, message: 'Error sending packet to target. Code: 0x802a'

    Please use nRF Connect and check if the device after updating the BL+SD if it runs as a Bootloader and advertises anything?

    No it does not advertise.

    Any reason why your bootloader version in your script to generate the DFU package was "--bootloader-version 0 " ? 

    That was wrong at the time of the post creation. After reading my old settings.hex I realized bootloader-version was 1. So I changed and I am now generating the packages with --bootloader-version 2.

    Please try to do SD+BL and APP DFU update separately (2 zip files) before testing with one single .zip. 

    Tried this. On nRF Connect from linux I had the same issue reported above. On my phone, It sent and in the end a popup appeared saying "Application has been sent successfully". But after that the device does not advertise as expected...


    Thanks,
    Pedro
  • Hi Pedro, 
    Regarding the issue with Linux, what you reported (error 0x802a) similar to one of the case here. You may need to disable MSD to use nrfConnect on Linux. 

    I would suggest to try the following: 

    1. Flash the stock BL+SD of SDK v15.2. Verify that it's advertising.

    2. Flash the stock BL+SD of SDK v17 to the same chip (do nrfjprog --program with --sectorerase) . Verify that the new bootloader is advertising. 

    3. Read flash out using nrfjprog --readcode 

    4. Erase the chip and Redo Step 1.

    5. Do DFU update of BL+SD of SDK v17 . 

    6. If it's not advertising try read flash out using nrfjprog --readcode

    7. Compare the 2 hex dump at step 3 and step 6. I usually use Notepad++ to compare. 

    Please send us your files (including the private keys and public keys, the .zip file, your bootloader and softdevice in SDK v15.2 ) so that we can test here.

Reply
  • Hi Pedro, 
    Regarding the issue with Linux, what you reported (error 0x802a) similar to one of the case here. You may need to disable MSD to use nrfConnect on Linux. 

    I would suggest to try the following: 

    1. Flash the stock BL+SD of SDK v15.2. Verify that it's advertising.

    2. Flash the stock BL+SD of SDK v17 to the same chip (do nrfjprog --program with --sectorerase) . Verify that the new bootloader is advertising. 

    3. Read flash out using nrfjprog --readcode 

    4. Erase the chip and Redo Step 1.

    5. Do DFU update of BL+SD of SDK v17 . 

    6. If it's not advertising try read flash out using nrfjprog --readcode

    7. Compare the 2 hex dump at step 3 and step 6. I usually use Notepad++ to compare. 

    Please send us your files (including the private keys and public keys, the .zip file, your bootloader and softdevice in SDK v15.2 ) so that we can test here.

Children
Related