I am porting the Microsoft Sphere example (https://github.com/Azure/azure-sphere-samples/tree/master/Samples/ExternalMcuUpdate) that updates a Nordic nRF52 Development Kit over UART using the MT3620 Sphere Development Kit. The port involves moving this example from the Nordic nRF52 kit to an Avnet PMOD using the 52840 rather than the nRF52 Development Kit.
The Nordic nRF52 DK uses the S132 softdevice in conjunction with the PCA10040 hardware platform and utilizes LED2 and LED4 to indicate which application software (BlinkV1 or Blinkv2) is running. The changes necessary for the PMOD involve mostly changing the LED operation to account for a single tri-color LED rather than seperate LED's. So the changes involved in the port are:
1) the bootloader was changed to handle the LED changes.
2) The Application files were changes to handle LED changes.
3) The Sphere Applications were changes to indicate different LED colors to represent the different Apps
4) The softdevice was changes changed to use the S140 bootloader rather than the S132.
All these changes are have been captured in the https://github.com/jflynn129/FlashPMOD github repository.
├── AzureSphere_HighLevelApp
│ ├── External NRF52 Firmware
│ │THIS FOLDER CONTAINS ALL APPLICATIOIN AND SOFTDEVICES USED DURING DFU
│ ├── ExternalMcuUpdateNrf52
│ │CONTAINS THE APPLICATION CODE USED IN SPHERE APPLICATION
│ └── ExternalMcuUpdateNrf52.sln
├── Binaries
│ CONTAINS THE SOFTDEVICE USING BY THE PMOD
├── Hardware
│ CONTAINS THE HARDEWARE FOLDER FOR THE AVNET ME3620
├── PMODApps
│ CONTAINS THE CODE FOR THE PMOD APPLICATION
├── PMODBootloader
│ CONTAINS THE BOOTLOADER CODE FOR THE PMOD
└── docs
DOCUMENTATION RELATED TO THE PMOD AND AES-MS-MT3620
I used the Nordic ‘nrfutil’ CLI to convert the hex files into the corresponding files used in Sphere Application to perform the DFU. Specifically, I use the command:
‘nrfutil pkg generate –sd-req “0xA9”,”0xAE” –hw-version 52 –application-version 1 –application blinky_pca10056_mbr.hex BLUEv1.zip’
(when creating the data for the BLUE LED application). After this command complete, I extracted the *.dat and *.bin files from the zip and add it to the Azure Sphere application.
All this appears to work correctly, but when the bootloader and Azure Sphere application begins the update process configuration and security information exchange fails as shown below:
<info> app: Initialization complete, Inside main
<debug> app: In nrf_bootloader_init
<debug> app: DFU pin is active...
<debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
<debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
<debug> nrf_dfu_settings: Settings OK
<debug> app: Enter nrf_bootloader_fw_activate
<info> app: No firmware to activate.
<debug> app: Enter nrf_dfu_app_is_valid
<debug> app: No valid app to boot.
<debug> app: DFU mode because app is not valid.
<info> nrf_bootloader_wdt: WDT is not enabled
<debug> app: in weak nrf_dfu_init_user
<debug> app: timer_stop (0x20000060)
<debug> app: timer_activate (0x20000060)
<info> app: Entering DFU mode.
<debug> app: Initializing transports (found: 1)
<debug> nrf_dfu_serial_uart: serial_dfu_transport_init()
<debug> nrf_dfu_serial_uart: serial_dfu_transport_init() completed
<debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
<debug> app: Enter main loop
<debug> app: Shutting down transports (found: 1)
<debug> nrf_dfu_serial: Received ping 2
<info> nrf_dfu_serial_uart: Allocated buffer 20002948
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_PING
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_serial: Sending Response: [0x9, 0x1]
<debug> app: Shutting down transports (found: 1)
<debug> nrf_dfu_serial: Set receipt notif target: 0
<info> nrf_dfu_serial_uart: Allocated buffer 20002948
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_RECEIPT_NOTIF_SET
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_serial: Sending Response: [0x2, 0x1]
<debug> app: Shutting down transports (found: 1)
<debug> nrf_dfu_serial: Received serial mtu
<info> nrf_dfu_serial_uart: Allocated buffer 20002948
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_MTU_GET
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_serial: Sending Response: [0x7, 0x1]
<debug> app: Shutting down transports (found: 1)
<info> nrf_dfu_serial_uart: Allocated buffer 20002948
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_FIRMWARE_VERSION
<debug> nrf_dfu_req_handler: Firmware image requested: 0
<debug> nrf_dfu_req_handler: Bootloader type 2
<debug> nrf_dfu_req_handler: Bootloader version 0
<debug> nrf_dfu_req_handler: Bootloader addr u
<debug> nrf_dfu_req_handler: Bootloader len u
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_serial: Sending Response: [0xB, 0x1]
<debug> app: Shutting down transports (found: 1)
<info> nrf_dfu_serial_uart: Allocated buffer 20002948
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_FIRMWARE_VERSION
<debug> nrf_dfu_req_handler: Firmware image requested: 1
<debug> nrf_dfu_req_handler: No such firmware image
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_serial: Sending Response: [0xB, 0x1]
<debug> app: Shutting down transports (found: 1)
<info> nrf_dfu_serial_uart: Allocated buffer 20002948
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_SELECT (command)
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_serial: Sending Response: [0x6, 0x1]
<debug> app: Shutting down transports (found: 1)
<info> nrf_dfu_serial_uart: Allocated buffer 20002948
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_CREATE (command)
<debug> app: timer_stop (0x20000060)
<debug> app: timer_activate (0x20000060)
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_serial: Sending Response: [0x1, 0x1]
<debug> app: Shutting down transports (found: 1)
<info> nrf_dfu_serial_uart: Allocated buffer 200029CC
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (command)
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> app: Shutting down transports (found: 1)
<info> nrf_dfu_serial_uart: Allocated buffer 20002948
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (command)
<debug> app: Shutting down transports (found: 1)
<info> nrf_dfu_serial_uart: Allocated buffer 20002948
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_CRC_GET (command)
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_serial: Sending Response: [0x3, 0x1]
<debug> app: Shutting down transports (found: 1)
<info> nrf_dfu_serial_uart: Allocated buffer 20002948
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_EXECUTE (command)
<debug> nrf_dfu_validation: PB: Init packet data len: 70
<error> nrf_dfu_ver_validation: The application requires soft device.
<warning> nrf_dfu_ver_validation: SD req not met.
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0xB
<warning> nrf_dfu_serial: DFU request completed with result: 0xB
<debug> nrf_dfu_serial: Sending Response: [0x4, 0xB]
I suspect I have a configuration issue. I've tried reading through your documentation but there isn't any explaination of what the various codes are and what "SD req not met" is actually telling me. It says "The application requires soft device" but I am providing one in the download. Can you point me to some documentation that better describes the errors and interactions needed to resolve this issue?
Additionally, should I switch over and try the open DFU example (from the SDK) rather than the MSFT example?
Thanks for any assistance.