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

Thingy52 upload Sample Project OTA

Hi everyone,

I have moved from the cable connection firmware upgrade to the OTA-DFU using the nRF52 dev kit. I am able to download the firmware from nordic's website and upload the pre-zipped file without any issue. I start seeing issues when trying to upload my own code.

What I have done is changed the device name in the Nordic-Thingy52-FW\project\pca20020_s132\config\thingy_config.h file and compiled using make - j. That seems to be working with little issue.

I have created my own public and private keys and use that while creating the zip file. the code to create the zip file is as follows...

nrfutil pkg generate --application C:\Software\Build\Nordic-Thingy52-FW\project\pca20020_s132\armgcc\_build\nrf52832_xxaa_s132.hex myApp.zip --key-file private.key --hw-version 52 --sd-req 0x8C --application-version 1

This builds the .zip file without complaining. then finally I run the following command to program the firmware.

nrfutil dfu ble -p COM4 -n "ThingyDfu" -ic NRF52 -pkg C:\Software\Build\Nordic-Thingy52-FW\project\pca20020_s132\armgcc\myApp.zip

I get the following response back...

[------------------------------------] 0% Traceback (most recent call last): File "C:\Python27\Scripts\nrfutil-script.py", line 11, in load_entry_point('nrfutil==3.3.0', 'console_scripts', 'nrfutil')() File "c:\python27\lib\site-packages\click-6.7-py2.7.egg\click\core.py", line 722, in call return self.main(*args, **kwargs) File "c:\python27\lib\site-packages\click-6.7-py2.7.egg\click\core.py", line 697, in main rv = self.invoke(ctx) File "c:\python27\lib\site-packages\click-6.7-py2.7.egg\click\core.py", line 1066, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "c:\python27\lib\site-packages\click-6.7-py2.7.egg\click\core.py", line 1066, in invoke return process_result(sub_ctx.command.invoke(sub_ctx)) File "c:\python27\lib\site-packages\click-6.7-py2.7.egg\click\core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params) File "c:\python27\lib\site-packages\click-6.7-py2.7.egg\click\core.py", line 535, in invoke return callback(*args, **kwargs) File "c:\python27\lib\site-packages\nordicsemi_main.py", line 745, in ble dfu.dfu_send_images() File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu.py", line 122, in dfu_send_images self._dfu_send_image(self.manifest.application) File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu.py", line 90, in _dfu_send_image self.dfu_transport.send_init_packet(data) File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 501, in send_init_packet self.__execute() File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 582, in __execute self.__get_response(DfuTransportBle.OP_CODE['Execute']) File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 659, in __get_response raise NordicSemiException('Response Code {}'.format(get_dict_key(DfuTransport.RES_CODE, resp[2]))) pc_ble_driver_py.exceptions.NordicSemiException: Response Code OperationFailed

I'd love to know what I am doing wrong. Please let me know what else I can share.

Thank you

  • Have you flashed a bootloader that has been compiled with your public key to your Thingy:nRF52?

  • I attempted to but ran into similar issues. I generated a public key from my private yet and placed it into the bootloader_secure project folder. I then compiled the bootloader and attempted to flash the bootloader. I was unsuccessful when creating a .zip file and attempting to flash over the air using the development kit. I was also unsuccessful when using the mobile app the pass the zip file. I have not found a good tutorial how to flash the Thingy's bootloader.

  • You do not have the private key which corresponds to the public key in the factory programmed bootloader on the Thingy so you will not be able to update the bootloader via OTA DFU. You need to flash the bootloader with your public key using a programmer and a cable.

  • Ah I missed that. I wonder if others have similar issues, I didn't see that step well documented in the user guide or firmware documentation. Perhaps I just missed it.

  • The Over-the-air device firmware update section in the Thingy User Guide describes how you update the application that is made by Nordic Semiconductor through the Thingy app. It does not cover how to update your own application, which requires you to compile your own bootloader. You should look at the nRF5 SDK documentation on the bootloader, see this page on Infocenter.

1 2