How to perform software reboot? [solved]

Urgent: Is there a firmware command to reboot? Or re-initialize the setup?

Need to reset after a certain amount of time has passed (specifically, need to wipe it of all logged data)

Hi @the_root_of_matt,

The core can be reset in software, like this,

USB_Cable_Config(DISABLE);
NVIC_SystemReset();

but I’m not sure that’s what you are asking.

Could you provide more details, such as where is your logged data stored? What are the details of your setup that need reinitializing?

If you want to do a factory reset from software, see this thread:

1 Like

I think Spark.reset() should work fine :slight_smile:

1 Like

Good catch - I forgot that had made it into the latest release!

1 Like

@ kennethlimcp - Thank you!

2 Likes

If you just need to reinitialize some parameters and empty a log, you could just manually call the setup() method from somewhere inside your loop. In the same place, reset any parameters that need to be fresh that setup() does NOT change, and empty the log buffer if you don’t handle that in setup() either. No need to let the entire spark reboot and have to reconnect.

In newer version (ex. spark_9) is System.reset()

1 Like

Spark.reset() hasn’t made it into the IDE yet (22 Aug 14) but it calls NVIC_SystemReset(); which is available in the IDE. Aha - System.reset() is in the IDE. I can’t keep up.

1 Like