Based on the project “DA1458x_DSPS_v_5.150.2”, I just modify some config, look at the following :
1. “user_config.h”
const static sleep_state_t app_default_sleep_mode = ARCH_SLEEP_OFF;
static const struct default_handlers_configuration user_default_hnd_conf = {
//Configure the advertise operation used by the default handlers
//Possible values:
// - DEF_ADV_FOREVER
// - DEF_ADV_WITH_TIMEOUT
.adv_scenario = DEF_ADV_WITH_TIMEOUT,
//Configure the advertise period in case of DEF_ADV_WITH_TIMEOUT.
//It is measured in timer units (10ms). Use MS_TO_TIMERUNITS macro to convert
//from milliseconds (ms) to timer units.
.advertise_period = MS_TO_TIMERUNITS(10000),
//Configure the security start operation of the default handlers
//if the security is enabled (CFG_APP_SECURITY)
.security_request_scenario = DEF_SEC_REQ_NEVER
};
2. “da1458x_config_basic.h”
#define CFG_WDOG
#undef CFG_MEM_MAP_EXT_SLEEP
#undef CFG_MEM_MAP_DEEP_SLEEP
#定义CFG_DEVELOPMENT_DEBUG
Then I begin to debug, after 10s , the program will go into the function that is NMI_HandlerC().
Why it it go into NMI_HandlerC() ?
Please help me, thanks!
Hi z0806020433,
Thats because you have defined the watchdog and you ve set the .adv_scenario = DEF_ADV_WITH_TIMEOUT and you have disabled the sleep mode, that means that at some point the device is going to stop advertising (DEF_ADV_WITH_TIMEOUT ), so since the device will have nothing to do, it will wait in the WFI() for an interrupt while the watchdog will be still counting (since you have enabled it and you removed the sleep, in sleep mode the watchdog gets disabled when the device is in sleep mode). So since the watchdog is counting eventually you will get an NMI interrupt which means that watchdog elapsed.
Also you dont have to disable the CFG_MEM_MAP_EXT_SLEEP, its just the memory configuration, if you would like to disable sleep just the ARCH_SLEEP_OFF definition will do.
Thanks MT_dialog
Thanks very much!