Soft vs Hard Code Load

So, in dealing with an SPI RF transceiver, it requires a power up sequence. I’m finding that I have to power off the board in order for it to work properly. Is there / will there be a way to know whether or not the imp just powered up or if the code was only reloaded?

Hmm, there’s no soft reset command you can send to the transceiver? The preferred solution would usually be to let the imp control the transceiver’s power, as that will result in the cleanest powerup sequence every time.

If Hugo’s suggestion doesn’t work out, you can use the “nv” table http://devwiki.electricimp.com/doku.php?id=electricimpapi#nv_table to distinguish cold boot-ups, from “warm” reboots due to the likes of server.sleepuntil(). Though having said that, I’ve got a nagging feeling that this might do the Wrong Thing with restarts caused by the “reload code” button: they might appear to be cold boots rather than warm boots. If so, that’s a bug, and we ought to fix it.

Peter

It does have a soft reset that I can send, but when I reload code, I can't determine whether the imp just powered up (which also powers up the transceiver), or if it restarted with the "reload code" button. So the code flow 
1) Initialize imp
2) run power up sequence
3) reset chip's values
4) continue to do cool stuff

Since the imp doesn't know if it just powered up, or if it just downloaded new code, it must run through that every time. I do agree - the real world solution would be to have the imp control the transceiver's power, but there's no way to do that on an April board without it controlling an external PS for the transceiver.

I tried the "nv" table, and that did not work. It works if I use imp.sleepfor() just as the example shows, but not if the imp reloads new code, or powers up.

The plot thickens.....