Flashing Code - Unresponsive core after flashing


I am new to using a spark core, but do have experience with embedded systems. I was not able to flash the simple led-blink code successfully.

First and foremost:

  • I am working out of an university, so I am using my phone as an AP for the core. The AP is called HBS4 and is using WPA2 security.

Initial Setup/Trial:

  • I installed CLI and ran setup spark and followed all the prompts. My core was able to connect properly and was “breathing cyan”.
  • (On my laptop, connected to a different network initially) I was able to see my core under my account and was showing up as online.
  • I tried flashing the led blink code, and the main LED did flash magenta.
  • The online IDE said it was done flashing and was back to “ready” state
  • There was no response from the core - it was still flashing magenta, so I naturally reset it.
  • It was back to breathing cyan, and no signs of the blinking LED

Next Attempts/Trials:

  • I tried to wait for the magenta LED to stop blinking when upon next flash… I waited for 5 mins, went for a break, came back and it was still flashing.
  • I tried to connect my laptop to my phone’s AP and re-flashing it. Same issue… magenta kept flashing, and breathing cyan after reset.
  • I tried to download the firmware.bin file generated using the online IDE using CLI when I put the core in “listening” mode, but still no luck/couldn’t get it to work. If I want to download a bin through USB it has to be in DFU mode - but I thought that was only reserved for updating some of the crucial components.
  • I have tried to use SYSTEM_MODE(SEMI_AUTOMATIC) as well as SYSTEM_MODE(MANUAL) - still no luck.

I don’t have a router at university where I can try through a “normal” network. But I don’t think the issue lies in the connection as it is able to “breathe cyan”. I have been trying things for a while now, but nothing has worked. Let me know if i’m doing something wrong/any pointers will be much appreciated.

I have 3 cores, 2 bought straight from spark.io last month and the last core from seedstudio, also within the last month. So I don’t think it requires a “deep-update”. Just to clarify here - I have tried with the other two cores too, making sure the right one is selected to flash to. Neither worked so I have only been fiddling around with one for now.

Once again any help is much appreciated. If I’ve managed to overlook something, please do point it out.

Thanks in advance everyone!

Listening mode is for you to enter new Wifi credentials into the core.

You will need DFU mode which is useful for tons of stuff! flashing firmware via USB is one of them.

Use the command spark flash --usb firmware.bin

It’s weird that the download worked fine but did not run. After blinking magenta and rapid flashing magenta, did the core reach breathing cyan? :wink:

Thanks for the prompt response. No the core never reached breathing cyan on its own after flashing magenta - only after I restarted it. It didn’t rapidly flash magenta either, only slowly like 1 Hz or slower. Will give DFU mode a shot. Thanks!

The network speed is probably a little slow

I tried installing via DFU mode. Followed these instructions. And tried running the command you told me. Here is the error I got:

The spark is listed under devices:

Try dfu-util -l and see what it outputs

1 Like

Same thing you described in your tutorial.

I think thats because the dfu-util is not in the PATH for windows.

is the dfu-util file in the folder win32-mingw32? Try copying the firmware into this folder and execute spark flash --usb firmware.bin again

1 Like

Worked like a charm! Thanks!

Any advice on where to put the dfu-util so I don’t have to put the .bins in that folder?
Also will there be some deeper digging as to why the online programming wasn’t working?

Thanks a lot for your prompt help! Appreciate it. I can begin my work now :smile:

The description of the behavior during OTA (blinking magenta) seems to suggest that OTA download isn’t going on smooth and the firmware is unable to download successfully.

You might need test out on another stable wifi network instead.

For the dfu-util, you can place it anywhere you want and edit the PATH for windows for the command prompt to search for it. Trying googling and see how to achieve that :wink:


Sounds good, will try on a stable network later on.
Will set the windows path variable and give it a go!
Thanks so much for your help!

1 Like

Just another update - I was curious so I tried over the air programming again. And the magenta light ended blinking after 10 minutes. And the blue LED started to blink. 5 hours wasted on a slow network through my phone’s AP. Thanks for your help, at least now I know a fail safe way of programming the core. :smile: