Loading the IMP004m Operating System

Just doing some research on the IMP004m and found some ambiguous information: the description of the IMP004m on the Mouser website states "The fully maintained, secure OS that is part of the Electric Imp cloud service comes pre-loaded.", yet according to the IMP004m hardware design guide the OS must be loaded to an external SPI flash prior to use. I assume the latter is correct (though I'd personally prefer it to be loaded ready to go out of the box).

I have a bunch of IMP001 and IMP003s lying around, which I imagine could be used in some way to load the OS image to the IMP004m SPI flash but I'm not much of a coder so I'm struggling to work out how to do it. How does one load the OS image to the SPI flash?

Would it be possible for the Electric IMP crew to create Agent and Device code for surrogate IMPs to facilitate loading the OS image from an Electric Imp server to the IMP004m SPI flash? That would be sweet! ;-)


  • FWIW both statements are sort-of correct. The main imp004 application, including all of the security-critical bits, is supplied pre-loaded inside the imp004's on-board flash. However, there wasn't room in the on-board flash for the binary firmware blob used for the imp004's Wifi chip -- so that needs to be supplied on an external SPI-flash chip by each customer. The Wifi chip's firmware blob isn't all that security-critical, because the imp runs its own encryption/authentication on top of anything that the Wifi itself provides.

    Populating the imp004 external SPI would indeed be a good use for a bunch of imp001s and imp003s knocking around. Much of the hard work could be taken care of using our SPI flash storage library: https://electricimp.com/docs/libraries/hardware/spiflash/

  • edited March 16
    Thanks Peter. I had a look at the library and I'm no closer to coding a solution. How do I make the OS image available to the Agent to transfer it to the Device to load into the SPI flash?

    How does the IMP team load their IMP004m SPI flash?
  • edited March 17
    I agree that this topic is going to be a really important thing once all of us "older" developers start using the 004 and 005 development boards from Mouser and Digikey. The USB port is still just used for power? Or maybe it can be used to download firmware to the SPI-flash ... like @FnGas, I'm not sure how we do it. Hoping for a tutorial or explanation in terms that we might be able to understand.

    Let's say I buy one of these for example:
  • The devboards already have the SPI flash loaded, and yes mini USB is only power. We'll also very shortly be selling the imp004m samples & pre-programmed SPI flash to make it easier.

    Programming the flash is only something you need to do if you make your own boards. In mass production, preprogramming devices before SMT is very common and not an issue for factories - you just give them the image.

    When we're prototyping, we either use a linux box and flashrom to program (with an FTDI cable & the programming header on the boards), or an imp003 board with a SPI socket attached plus the spiflash library to program bare chips.

    Looks like maybe we should actually make a programmer board for those who want to do this themselves...
  • When might the programmer board be available?
  • Not in the short term.

    There are plenty of ways to program SPI flash, though - look on eBay etc for "SPI flash programmer". These attach to a PC via USB and allow you to program devices.

    Doing it with an imp is just a little more elegant.
  • Hi Hugo. In the interim, is it possible for you lovely folk to create some Imp Agent code to download the OS image from an Electric Imp server and Device code that we could adapt for use on spare IMPs to load IMP004m SPI flash?
  • How does the "SPI flash programmer" physically attach to the SPI Flash that is surface mounted to the board? Or are there some breakout pins for this?
  • The "SPI flash programmer" is for bare chips, before SMT.

    You can also hold the imp in reset and program the device in circuit if you have the correct connections available. See the imp004m/imp005 devboard schematics for examples of this.
Sign In or Register to comment.