I’m trying to finish up a production test stand and I’m stumped.
My test firmware runs on initial sample hardware just fine-- this device has been claimed and connected to the cloud before.
New devices that I pull out of the box (not yet claimed, or connected to cloud) will not run my test firmware. Initially I thought it was because the system firmware is 0.5.3 and my test code was compiled against 0.7.0, but after using dfu-util to update the device, I am getting the same result.
I am using ymodem to upload test firmware and that works just fine on my initial sample hardware. It seems to succeed on new PCBs as well, but then the firmware will not run.
Does anyone have any suggestions on things to sanity check? At this point I’m stuck.
Is the bootloader actually a bootloader updater application? I can just flash this using YMODEM, right?
Otherwise, is there a DFU-UTIL command, because I’m not seeing it?
EDIT: It would be exceptionally helpful if someone has a tip on how to use dfu-util to flash the bootloader. This would mean I could do four consecutive dfu-util commands that loads part1, part2, bootloader, and application all in one go!
You’re right, the bootloader being an old version is apparently enough to prevent firmware from running… since I need it to run on the test stand, I MUST update the system firmware and the bootloader before it will run.
I just did an update with
particle flash --serial bootloader-0.7.0-p1.bin
…which after having intractable installation problems with particle-cli/npm, unexpectedly worked!
I can't find this information anywhere. I'm trying to avoid the particle command line tools because I have found them to be very flaky and somewhat unpredictable to install and use, especially since I'm integrating them into a larger script.
$ particle flash --usb -v temp-photon.bin
dfu-util 0.9
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
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 = 0x080a0000, size = 3252
Download [=========================] 100% 3252 bytes
Download done.
File downloaded successfully
Flash success
Note: DFU over USB on Electron/Photon/P1 (sequence not required)
You may update to 0.7.0 directly, but make sure you have installed v1.29.0 of the CLI (check with particle --version) then run particle update.
Note: P1/Photon Bootloader
The cloud will automatically update the bootloader on P1/Photon devices. If your device does not connect to the cloud, you should flash the bootloader to the device using particle flash --serial. This should be done after upgrading system firmware.
Edited:
Somewhat as expected, it wrote to 0x080a0000, so no different than an application.
It ended up continuously fast flashing white. I recovered it by writing my test firmware back over the address at 0x080a0000.
I think that bootloader-0.7.0-p1.bin is a "bootloader updater application" that has a magic component.. or I think the serial handler does something special with it....
Nope, the bootloader is running DFU Mode, so with the device in DFU Mode you can't replace the bootloader, but --serial is using YModem and this way you can replace the bootloader.