[solved] reset the CF from the firmware

Firmware/software/electronics/mechanics
Post Reply
wydmynd
Member
Posts: 65
Joined: Thu Dec 06, 2018 9:25 am

[solved] reset the CF from the firmware

Post by wydmynd »

hi, -
I want to make an app that in some error conditions will reset the CF (like resetting STM32 using NRF from the cflib)
searched google and found there is a command - NVIC_SystemReset() but in the CF firmware could not find that it is defined.

does anyone know if this is plausible to implement ?
if not, how would you "reset" the firmware, like what happens when there is a watchdog reset - watchdogReset() in watchdog.h
(did not exactly understand the implementation)

Thanks!!
arnaud
Bitcraze
Posts: 2391
Joined: Tue Feb 06, 2007 12:36 pm

Re: reset the CF from the firmware

Post by arnaud »

The function NVIC_SystemReset will reset the STM32 so you can use that.

To use it, you need to include code_cm4.h since it is an inline function declared in this header file:

Code: Select all

#include "core_cm4.h"
A note about the watchdog: the watchdog resets the CPU in hardware and not in software, this is why you cannot see any software that resets the CPU associated with the watchdog.
wydmynd
Member
Posts: 65
Joined: Thu Dec 06, 2018 9:25 am

Re: reset the CF from the firmware

Post by wydmynd »

thanks! will report if it works
wydmynd
Member
Posts: 65
Joined: Thu Dec 06, 2018 9:25 am

Re: reset the CF from the firmware

Post by wydmynd »

tested. works.
wydmynd
Member
Posts: 65
Joined: Thu Dec 06, 2018 9:25 am

Re: [solved] reset the CF from the firmware

Post by wydmynd »

update: after resetting, if using flow sensor, I get the message - "Error while initializing the PMW3901 sensor"

So currently I'm abandoning this method.
kimberly
Bitcraze
Posts: 700
Joined: Fri Jul 06, 2018 11:13 am

Re: [solved] reset the CF from the firmware

Post by kimberly »

ah really? It works with the lighthouse deck, but we haven't tried this with the flowdeck. We will investigate this soon.
wydmynd
Member
Posts: 65
Joined: Thu Dec 06, 2018 9:25 am

Re: [solved] reset the CF from the firmware

Post by wydmynd »

will be happy to hear if there is any update. thx!
kimberly
Bitcraze
Posts: 700
Joined: Fri Jul 06, 2018 11:13 am

Re: [solved] reset the CF from the firmware

Post by kimberly »

We haven't gotten around to it.... Could you provide your app with a minimal example so that we can try it ourselves?
Post Reply