Everytime I flash new firmware to my Spark Core, it flashes magenta and goes to the usual routine, but then when it resets it goes into DFU mode!. This happens of course without touching anything.
I download the bin and flash it directly using dfu-util and everything works fine. Except if I try to flash it again from the cloud! It goes again into DFU mode.
I tried factory reset, new firmware install using dfu-util, etc, etc, etc… Any ideas? Is this a boot loader problem?
UPDATE: It does this no matter what code I flash to it. I tried several proven firmwares I wrote that run smooth on other devices.
I’ve seen that issue when the external flash on a core is damaged. Can you try writing something to that area of flash and reading it back to see if it works as expected?
dfu-util -d 1d50:607f -a 1 -s 0x00060000 -v -D core-firmware.bin
dfu-util -d 1d50:607f -a 1 -s 0x00060000:sizecount -v -U temp.bin
I was about to do the test. .But now my spark core only list with the internal small blue led and does nothing more!!! Not even the reset or power cycle, or long reset works!!
Ahh, sorry, in this case sizecount was meant to be replaced with the size of the blob you read off the flash chip initially. So if you run ls -l, or dir depending on your system, and update that command to match that number of bytes:
dfu-util -d 1d50:607f -a 1 -s 0x00060000:78860 -v -U temp.bin
Then you’d want to compare those files with something like:
@dave In that case.. The first command returned the same..
The second command returned:
bytes_per_hash=1024
Starting upload: [#############################################################################] finished!
And : temp.bin is 78860
And the diff command, returnes:
Binary files core-firmware.bin and temp.bin differ
Hmm, any chance you could open those files in a hex editor, or send them my way? I’m curious to see how badly they’re different.
This result would indicate that there is a problem with the external flash on that core. If you email us at hello@spark.io, and mention this thread, we can get you setup with a replacement core.
I don’t think it’s bootloader related, but you can certainly always erase and re-load that if you want. A feature we don’t have in the bootloader, but one that might be nice would be bad sector detection / workarounds for situations like this. So future bootloader improvements might be able to workaround failures like that, but that’s not the case yet.
Alternatively, if you wanted to just keep using that core, you could fish around in your flash chip and find a good sector, and bump up your OTA / backup firmware addresses to that sector instead, but that’s a bit fancy.