How do I issue a reset on my board via the Dialog SDK (DA14680)?

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
2 posts / 0 new
Last post
alarner
Offline
Last seen:3 months 11 hours ago
加入:2017-05-27 02:11
How do I issue a reset on my board via the Dialog SDK (DA14680)?

I"m trying to add a setting to our device such that when a button is pressed it does a hard reset of the board (as if it had just booted up after being flashed). I found SWRESET in the docs but I get an error when trying to use it:

./lib/sdk/bsp/include/sdk_defs.h:725:29: error: 'GPREG_DEBUG_REG_SW_RESET_Pos' was not declared in this scope
REG_SET_BIT(GPREG, DEBUG_REG, SW_RESET); \
^
./lib/sdk/bsp/include/sdk_defs.h:641:37: note: in definition of macro 'REG_SET_BIT'
base->reg |= (1 << (base##_##reg##_##field##_Pos)); \

How would you recommend triggering the reset from the embedded code?

Device:
MT_dialog
Offline
Last seen:2 months 1 week ago
工作人员
加入:2015-06-08 11:34
Hi alarner,

Hi alarner,

What exactly is your use case ? What exactly is that you need ? You cannot issue a hw reset via sw, since you would like to use a button you can use the reset pin of the device, if this is not an option and you would like to issue a hw reset via sw then you can force a watchdog reset and this will force a hw reset. You can have a look at the suota_loader project the following functions trigger_reboot() for forcing a hw reset over sw and the reboot() function for issuing a sw reset. In the hw reset the bootloader will run, that is not the case in the sw reset.

Thanks MT_dialog