OTA flashing locally compiled firmware

Hello,

I locally compiled firmware for the Photon, and now I have a couple of files in the build/target directory. I wonder how I should OTA flash them. I guess the way is to use this command line:
https://docs.particle.io/reference/api/#flash-a-device-with-a-pre-compiled-binary

But I don’t know which binary/hex/elf/other files I should flash and if there is any order to do this. Additionally, is there a way to get one giant file to flash, which includes all these things somehow?

Thanks,
Mohammed

If you have dfu-util installed you can flash them locally by putting the device in DFU mode and adding program-dfu to your make command line. Please see the build docs in the firmware repo which discusses this.

Thanks @mdma, but I want to flahs over-the-air. This is a requirement for me.

Install Particle-cli and do particle flash deviceName xxxxx.bin

Thanks @kennethlimcp, but I only got O and D files. Which one I should flash? Or there is another way to get the .bin files?

The .o and .d files are intermediate files. The bin file is produced - the location of the binary is printed near the end of the build output, along with memory sizes.

2 Likes

Thank you very much @mdma and @kennethlimcp. That works and I appreciate it.

Here is a trick that @mtwomey showed me so you don’t have to do the button trick to put it in dfu mode

Put these lines in your make file:

PARTICLE_USB := $(shell compgen -f -- "/dev/tty.usbmodem")

flash:	dfu
	-stty -f $(PARTICLE_USB) 14400
	particle flash --usb out/$(APPNAME).bin	

dfu:
	-stty -f $(PARTICLE_USB) 14400

once you have done a make build you can then do make dfu and see the blinking yellow, followed by make flash. Apparently 14400 baud rate puts the photon in dfu mode.

1 Like

Thank you @kbowerma