Flash system FW from 0.7.0-rc.3 to 0.6.2 problem / Safemode


#1

I flashed my Photon with user code targeting 0.7.0-rc.3, and due to issues with the app-hash not working properly in some cases (Weird flash compile Issues, not seeing app-hash event?), I am trying to roll the Photon back to 0.6.2

I used the following commands (i read somewhere to do it in reverse order, but I also tried it part1 then part2):
dfu-util -d 2b04:d006 -a 0 -s 0x8060000 -D system-part2-0.6.2-photon.bin
dfu-util -d 2b04:d006 -a 0 -s 0x8020000:leave -D system-part1-0.6.2-photon.bin

The update took and it reboots… but it just boots up in to safe-mode.

I can verify the current version is now 0.6.2, but all it does is boot to safe-mode. I tried flashing my user code to it again targeting 0.6.2 now, and it doesn’t take… It just reboots back into safe-mode again.

I am stuck- any suggestions?

(ps): I asssumed the dfu-util 0x8020000 is for part1 and 0x8060000 is for part2 - I couldn’t find any good documentation explaining these parameters. So maybe those are backwards? Not sure. Bottom line, I need to revert back to 0.6.2 and its stuck in safemode.


#2

Have you read this

You can use

particle flash --usb <binary>

for the system parts and for the bootloader

particle flash --serial <bootloader.bin>

#3

I have not read that. This needs to be better documented somewhere. The only articles I read said nothing about the bootloader.

So I need to do 3 parts (system-part2 -> bootloader (v0.6.2) -> system-part1), and reboot it after each part before proceeding to flash the next part?

What is the difference between “particle flash” and dfu-util?


#4

particle flash --usb checks the compatibility of the binary and chooses the right location from the binary itself.
So less risk of using wrong binaries or wrong addresses.


#5

Can you confirm my question above?


#6

Also. I tried your suggestion, and got an error:

particle flash --serial system-part2-0.6.2-photon.bin
! PROTIP: Hold the SETUP button on your device until it blinks blue!
? Press ENTER when your device is blinking BLUE
sending file: system-part2-0.6.2-photon.bin

! serial:
Error writing firmware…Transfer cancelled
undefined


#7

If I try it in USB/Dfu mode, system part 2 takes, but bootloader doesn’t:

particle flash --usb system-part2-0.6.2-photon.bin
Found DFU device 2b04:d006
spawning dfu-util -d 2b04:d006 -a 0 -i 0 -s 0x08060000 -D system-part2-0.6.2-photon.bin
dfu-util 0.8
Opening DFU capable USB device…
ID 2b04:d006
Run-time device DFU version 011a
Claiming USB DFU Interface…
Setting Alternate Setting #0
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "Internal Flash "
Downloading to address = 0x08060000, size = 213760
Download [=========================] 100% 213760 bytes
Download done.
File downloaded successfully
Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release!!!

Flash success!

particle flash --usb bootloader-0.6.2-photon.bin
Found DFU device 2b04:d006

Error writing firmware…unknown module function 2, use --force to override


#8

Try to do the flash --serial when it’s in safe mode or flash tinker to it. I found that the user application may affect the --serial transfer.


#9

I said --usb for the system parts and --serial for the bootloader.
--usb requires DFU Mode (blinking yellow)
--serial requires Listening Mode (blinking blue)


#10

Thanks, I will try that the bootloeader with --serial. However, that is NOT what you said. (Quote above). So are you still saying I need to do system part 2 with --usb (reset), then bootloader with --serial (reset), then system part 1 with --usb (reset)? You never confirmed the order.


#11

Hmm, I thought I said this:

If you read the quote as one sentence, you may find the bit before the “and” refers to the top command and after the “and” to the bottom command.


#12

You’re right, I misread it because of where the “and” was. I can see how one can read that two different ways.

What about the order? Is this right?

Flash system part 2 with --usb (reset)
then bootloader with --serial (reset),
then system part 1 with --usb (reset)


#13

Yes, this is how I’d do it with enterint the respective mode for each step: DFU -> Listening -> DFU

And finally I’d run

particle flash --usb tinker

in DFU Mode to get everything wrapped up.