adafruit / Adafruit_BluefruitLE_OSX

Native CoreBluetooth-based Bluefruit LE utility for OS X
MIT License
9 stars 5 forks source link

Add `--zip``-z` option to `bluefruit dfu` #3

Open microbuilder opened 7 years ago

microbuilder commented 7 years ago

The dfu command should be updated to accept a .zip file, which is the format required for use with the nRF52 bootloader, and some nRF51 setups. The .zip can be generated externally or downloaded from the firmware repo.

The .zip will contain a .bin file, and an .init file with specific filenames. This will be managed by the .zip generation utility, but some basic debugging should take place to make sure the right files are present in the .zip before starting the DFU process, and an appropriate error should be thrown when a problem is found.

Reference: https://devzone.nordicsemi.com/blogs/715/creating-zip-package-for-dfu/

hathach commented 7 years ago

I attach an zip file of blinky app for feather52 compiled by Arduino IDE. blink.ino.zip

To generate an package zip file, we need nrfutil from Noridc, better to stick with 0.5.2 since we are still using the 'legacy' bootloader.

to install

pip install -r requirements.txt
python setup.py install

command to generate zip file (binary + init + meta)

nrfutil dfu genpkg --application blinky.hex blinky.zip

PS: the zip file is preferred since it can also be used to upgrade not only Application but also SoftDevice and/or Bootloader in the upcoming feather.