We are using nrfutil v4.0.0 to update the nRF52 module. So far we've been using SDK_15.3.0 with SoftDevice s140_nrf52_6.1.1 and the updates work fine for zip files containing APP + SD, where the APP is new but the SD is the same. Now, I want to upgrade to SDK nRF5_SDK_17.0.2 which includes SoftDevice s140_nrf52_7.2.0 but I am having a hard time understanding what is happening. I've tried the following sequence.
- First updating BL only, generated with --sd-req containing both old and new SD_IDs: 0xB6,0x0100. This works fine.
- Trying to update SD and APP (same zip file) also generated with --sd-req 0xB6,0x0100. The SD update seems to work fine but the APP update fails. See log below.
nrfutil -v -v dfu serial -p /dev/ttymxc1 -pkg ./nrf52-bl.zip -cd 5 2020-12-01 08:17:06,958 Using board at serial port: /dev/ttymxc1 2020-12-01 08:17:07,058 Sending Bootloader image. 2020-12-01 08:17:13,135 Sending init packet... 2020-12-01 08:17:13,414 Sending firmware file... 2020-12-01 08:17:16,284 Image sent in 3.14915800095s Device programmed. nrfutil -v -v dfu serial -p /dev/ttymxc1 -pkg ./nrf52-sd-app.zip -cd 5 2020-12-01 10:57:38,645 Using board at serial port: /dev/ttymxc1 2020-12-01 10:57:38,711 Sending SoftDevice image... 2020-12-01 10:57:44,754 Sending init packet... 2020-12-01 10:57:45,031 Sending firmware file... 2020-12-01 10:58:03,414 Image sent in 18.6601550579s 2020-12-01 10:58:03,438 Sending Application image. Traceback (most recent call last): File "/usr/bin/nrfutil", line 11, in <module> load_entry_point('nrfutil==4.0.0', 'console_scripts', 'nrfutil')() File "/usr/lib/python2.7/site-packages/click/core.py", line 722, in __call__ return self.main(*args, **kwargs) File "/usr/lib/python2.7/site-packages/click/core.py", line 697, in main rv = self.invoke(ctx) File "/usr/lib/python2.7/site-packages/click/core.py", line 1066, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/lib/python2.7/site-packages/click/core.py", line 1066, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/lib/python2.7/site-packages/click/core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/lib/python2.7/site-packages/click/core.py", line 535, in invoke return callback(*args, **kwargs) File "/usr/lib/python2.7/site-packages/nordicsemi/__main__.py", line 858, in serial do_serial(package, port, connect_delay, flow_control, packet_receipt_notification, baud_rate, True) File "/usr/lib/python2.7/site-packages/nordicsemi/__main__.py", line 795, in do_serial dfu.dfu_send_images() File "/usr/lib/python2.7/site-packages/nordicsemi/dfu/dfu.py", line 129, in dfu_send_images self._dfu_send_image(self.manifest.application) File "/usr/lib/python2.7/site-packages/nordicsemi/dfu/dfu.py", line 90, in _dfu_send_image self.dfu_transport.open() File "/usr/lib/python2.7/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 211, in open raise NordicSemiException("No ping response after opening COM port") pc_ble_driver_py.exceptions.NordicSemiException: No ping response after opening COM port
Then I've tried two other approaches. Option 1, creating a single zip file containing BL+SD+APP which also doesn't work and fails with another error: pc_ble_driver_py.exceptions.NordicSemiException: Response Code InvalidObject. Log below.
2020-12-01 11:14:16,252 Using board at serial port: /dev/ttymxc1 2020-12-01 11:14:16,314 Sending SoftDevice+Bootloader image. 2020-12-01 11:14:22,348 Sending init packet... 2020-12-01 11:14:22,632 Sending firmware file... Traceback (most recent call last): File "/usr/bin/nrfutil", line 11, in <module> load_entry_point('nrfutil==4.0.0', 'console_scripts', 'nrfutil')() File "/usr/lib/python2.7/site-packages/click/core.py", line 722, in __call__ return self.main(*args, **kwargs) File "/usr/lib/python2.7/site-packages/click/core.py", line 697, in main rv = self.invoke(ctx) File "/usr/lib/python2.7/site-packages/click/core.py", line 1066, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/lib/python2.7/site-packages/click/core.py", line 1066, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/lib/python2.7/site-packages/click/core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/lib/python2.7/site-packages/click/core.py", line 535, in invoke return callback(*args, **kwargs) File "/usr/lib/python2.7/site-packages/nordicsemi/__main__.py", line 858, in serial do_serial(package, port, connect_delay, flow_control, packet_receipt_notification, baud_rate, True) File "/usr/lib/python2.7/site-packages/nordicsemi/__main__.py", line 795, in do_serial dfu.dfu_send_images() File "/usr/lib/python2.7/site-packages/nordicsemi/dfu/dfu.py", line 117, in dfu_send_images self._dfu_send_image(self.manifest.softdevice_bootloader) File "/usr/lib/python2.7/site-packages/nordicsemi/dfu/dfu.py", line 102, in _dfu_send_image self.dfu_transport.send_firmware(data) File "/usr/lib/python2.7/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 299, in send_firmware self.__execute() File "/usr/lib/python2.7/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 370, in __execute self.__get_response(DfuTransportSerial.OP_CODE['Execute']) File "/usr/lib/python2.7/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 454, in __get_response get_dict_key(DfuTransport.RES_CODE, resp[2]))) pc_ble_driver_py.exceptions.NordicSemiException: Response Code InvalidObject
Option 2, creating 2 zip files one with BL+SD and another one with the APP only. This option works for both updates. However, I noticed that I am not able to update the device again using the zip file SD+APP, where the SD and APP are the same versions currently running. It fails with "No ping response after opening COM port" the same as the first log above. I'd like to understand what is happening and why I'm not able to update SD+APP together as it should be possible to do so.
Notes:
* I'm using such an old version of nrfutil because that is the version deployed in production
* I can adapt the update script to use the approach BL+SD and then APP as this is a solution that works. However, I'd like to understand what is happening to have control of the situation.