Unable to flash firmware

Hello,
I’m having problems flashing firmware on my photon. It’s connected to the cloud, I can see it and I can signal it from the console. I tried to do an OTA update, and it failed.
So I installed the cli and dfu-util (on last osX) and tried to update the firmware using both --serial and --usb, both in both case I get an error.
Using serial I get:

$ particle flash --serial firmware.bin
! PROTIP: Hold the SETUP button on your device until it blinks blue!
? Press ENTER when your device is blinking BLUE
sending file: firmware.bin
Error writing firmware: Transfer cancelled

While using usb (flashing yellow), I get:

Antonio$ particle flash --usb firmware.bin
Error writing firmware: dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!

dfu-util: Error during download get_status

I’m actually lost.
Can any of you help me ?

Thanks a lot. Best regards

Antonio

You may have issues with the bootloader.
To test that theory you can post the output of particle serial inspect.

To over come that, the first thing I’d try woult be to update CLI (should be 1.34.0) and then run

particle flash --usb tinker
particle update

After that check particle serial inspect again.

If that doesn’t help, you may need to flash the bootloader manually via

particle flash --serial bootloader-0.7.0-photon.bin
1 Like

Thank you @ScruffR for your answer. Here's the output:

Antonio$ particle serial inspect
Platform: 6 - Photon
Modules
Bootloader module #0 - version 2, main location, 16384 bytes max size
Integrity: FAIL
Address Range: PASS
Platform: PASS
Dependencies: PASS
System module #1 - version 207, main location, 262144 bytes max size
Integrity: PASS
Address Range: PASS
Platform: PASS
Dependencies: PASS
System module #2 - version 207, main location, 262144 bytes max size
Integrity: PASS
Address Range: PASS
Platform: PASS
Dependencies: FAIL
System module #1 - version 207
Bootloader module #0 - version 7
User module #1 - version 2, main location, 131072 bytes max size
UUID: 2BA4E71E840F596B812003882AAE7CA6496F1590CA4A049310AF76EAF11C943A
Integrity: PASS
Address Range: PASS
Platform: PASS
Dependencies: PASS
System module #2 - version 1
User module #1 - version 2, factory location, 131072 bytes max size
UUID: 2BA4E71E840F596B812003882AAE7CA6496F1590CA4A049310AF76EAF11C943A
Integrity: PASS
Address Range: PASS
Platform: PASS
Dependencies: PASS
System module #2 - version 1

I already have the last version of the CLI, I think:

particle --version
1.34.0

But particle flash --usb tinker always gives me the following error:

Antonio$ particle flash --usb tinker
Error writing firmware: dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!

dfu-util: Error during download get_status

In deed you seem to have a bootloader issue
With system modules v207 your bootloader should be somewhere in the region of v100+ but your output shows

These errors can savely be ignored

Error writing firmware: dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!

and the other is caused by the bootloader incompatibility.

particel update

might cure that, but the manual application of the bootloader should work in any case.

1 Like

UPDATE: particle flash --serial bootloader-0.7.0-photon.bin did work!
Upgrading the bootloader solved the problem. Now I’m able to flash the firmware both using the --serial and OTA.
Thanks a lot @ScruffR

Antonio

1 Like

Old thread but I thought I’d add a different solution.

I had this problem but I could not get the bootloader to flash.

david@ash:/mer/spark/devel/core-firmware$ particle flash --serial bootloader-0.7.0-photon.bin
! PROTIP: Hold the SETUP button on your device until it blinks blue!
? Press ENTER when your device is blinking BLUE 
sending file: bootloader-0.7.0-photon.bin

! serial: 
Error writing firmware...Transfer cancelled
undefined

In the end I ran this (cite: build.md docs) from a checkout of 0.7.0 using the 5.4 toolchain (gcc-arm-none-eabi-5_4-2016q3)

david@ash:/mer/spark/devel/core-firmware$ make bootloader PLATFORM=photon
david@ash:/mer/spark/devel/core-firmware$ particle flash --serial ./build/target/bootloader/platform-6-lto/bootloader.bin

And that worked.

I later found out that the bootloader hadn’t downloaded properly so I was trying to flash garbage. Anyway…