I'm following Hung Bui DFU bootloader guide (https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/getting-started-with-nordics-secure-dfu-bootloader).
Nrfutil fails when I try to generate the zip package using this command:
C:\Users\732444\Desktop\nRF5_SDK_15.3.0_59ac345\examples\peripheral\blinky\pca10040\blank\arm5_no_packs\_build>nrfutil pkg generate --hw-version 52 --application-version 1 --application nrf52832_xxaa.hex --sd-req 0xB7 --key-file newKey dfu_package.zip
The error is the following:
Traceback (most recent call last): File "C:\Python27\Scripts\nrfutil-script.py", line 11, in <module> load_entry_point('nrfutil==5.1.0', 'console_scripts', 'nrfutil')() File "C:\Python27\lib\site-packages\click\core.py", line 764, in __call__ return self.main(*args, **kwargs) File "C:\Python27\lib\site-packages\click\core.py", line 717, in main rv = self.invoke(ctx) File "C:\Python27\lib\site-packages\click\core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "C:\Python27\lib\site-packages\click\core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "C:\Python27\lib\site-packages\click\core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "C:\Python27\lib\site-packages\click\core.py", line 555, in invoke return callback(*args, **kwargs) File "C:\Python27\lib\site-packages\nrfutil-5.1.0-py2.7.egg\nordicsemi\__main__.py", line 867, in generate package.generate_package(zipfile_path) File "C:\Python27\lib\site-packages\nrfutil-5.1.0-py2.7.egg\nordicsemi\dfu\package.py", line 407, in generate_package Package.normalize_firmware_to_bin(self.work_dir, firmware_data[FirmwareKeys.FIRMWARE_FILENAME]) File "C:\Python27\lib\site-packages\nrfutil-5.1.0-py2.7.egg\nordicsemi\dfu\package.py", line 606, in normalize_firmware_to_bin temp.tobinfile(new_filepath) File "C:\Python27\lib\site-packages\nrfutil-5.1.0-py2.7.egg\nordicsemi\dfu\nrfhex.py", line 187, in tobinfile size = self.size() File "C:\Python27\lib\site-packages\nrfutil-5.1.0-py2.7.egg\nordicsemi\dfu\nrfhex.py", line 152, in size size = max_address - min_address + 1 TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'
If I omit the --application option the zip file is created correctly, so the problem seems to be related to the nrf52832_xxaa.hex file.
The application is the blinky example with no modifications.
I tried with the spi application example and all went fine.
What's wrong with the blinky example?
The SDK version used is the 15.3.0.