Dfu-util: Error during special command "ERASE_PAGE" get_status [SOLVED]

When building the firmware locally on Linux, I get the following error, which I think is different from the benign “download get_status” failure.

$ cd firmware/modules
$ make PLATFORM=photon clean all program-dfu

arm-none-eabi-objcopy -O ihex …/…/…/build/target/system-part1/platform-6-m-lto/system-part1.elf …/…/…/build/target/system-part1/platform-6-m-lto/system-part1.hex
arm-none-eabi-size --format=berkeley …/…/…/build/target/system-part1/platform-6-m-lto/system-part1.elf
text data bss dec hex filename
246880 168 136 247184 3c590 …/…/…/build/target/system-part1/platform-6-m-lto/system-part1.elf
arm-none-eabi-objdump -h -S …/…/…/build/target/system-part1/platform-6-m-lto/system-part1.elf > …/…/…/build/target/system-part1/platform-6-m-lto/system-part1.lst
dfu-suffix -v 2B04 -p D006 -a …/…/…/build/target/system-part1/platform-6-m-lto/system-part1.dfu
dfu-suffix (dfu-util) 0.8

Copyright 2011-2012 Stefan Schmidt, 2013-2014 Tormod Volden
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Suffix successfully added to file
Serial device PARTICLE_SERIAL_DEV : not available
Flashing using dfu:
dfu-util -d 0x2B04:0xD006 -a 0 -s 0x8020000 -D …/…/…/build/target/system-part1/platform-6-m-lto/system-part1.dfu
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Opening DFU capable USB device…
ID 1d50:607f
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 = 0x08020000, size = 247052
Download [ ] 0% 0 bytesdfu-util: Error during special command “ERASE_PAGE” get_status
make[1]: *** [program-dfu] Error 74
make[1]: Leaving directory `/home/andyw/spark/firmware/modules/photon/system-part1’
make: *** [/home/andyw/spark/firmware/modules/photon/system-part1/makefile] Error 2
$

Am I missing an unlock step or something similar ?

1 Like

the DFU driver in the core/photon automatically unlocks each flash page before writing.

We know dfu to be working well with Photons on Windows/OS X. Could this be a problem with DFU on linux?

Maybe - but if so, it is the first inkling I have of any problems with it - have been happily DFU-ing all sorts of cores, photons and other devices for ages (albeit I’m revisiting the photon after a hiatus building from firmware locally.)

DFU is managed by the bootloader, so unless you recently updated the bootloader, then DFU should still be good. Also an idea to try a different USB cable.

Ah - you mentioned in a PM that “… [make …all program-dfu] will update the system firmware (and the firmware updates the bootloader.)”.

This did not happen the first time through, is it possible that my bootloader is out of sync now ?

Different cables, and different host ports did not change the failure mode.

After further investigation, it is likely that the bootloader is extremely out of date on these parts (which did not flow through the standard production programming & test flow - so this problem should be limited to me & this particular unit.)

Plan is to reflash the bootloader via JTAG asap.

The photon in question has something very badly wrong with it, specifically in flash or flash controller.

Attempts to program it via jtag also failed in ways I had never seen before.

So if you see this error, it is very likely that the photon is toast.