hi, I'am working in a project. I start a watch dog in that project,but I need to stop the watch dog something.And I don't know how to stop, can anybody help me.
hi, I'am working in a project. I start a watch dog in that project,but I need to stop the watch dog something.And I don't know how to stop, can anybody help me.
how should I feed the watch dog in bootloarder. I had try to feed the dog like that,but it couldn't work fine after dfu.
/**@brief Function for initialization of time handle.
*/
//timer calender
static void timer_index_feed_wd( void *p_context )
{
//fed the dog
NRF_WDT->RR[0] = WDT_RR_RR_Reload;
}
/**@brief Function for initializing the timer handler module (app_timer).
*/
static void timers_init(void)
{
// Initialize timer module, making it use the scheduler.
APP_TIMER_APPSH_INIT(APP_TIMER_PRESCALER, APP_TIMER_MAX_TIMERS, APP_TIMER_OP_QUEUE_SIZE, true);
uint32_t err_code;
err_code = app_timer_create( &FEED_WD_TIMER, APP_TIMER_MODE_REPEATED, timer_index_feed_wd );
APP_ERROR_CHECK(err_code);
}
main()
{
.....
if (dfu_start || (!bootloader_app_is_valid(DFU_BANK_0_REGION_START)))
{
DisplayDFU( );
//stop timer
err_code = app_timer_start(FEED_WD_TIMER, FEED_WATCH_DOG_PERIOD, NULL);
APP_ERROR_CHECK(err_code);
// Initiate an update of the firmware.
err_code = bootloader_dfu_start();
APP_ERROR_CHECK(err_code);
}
if (bootloader_app_is_valid(DFU_BANK_0_REGION_START) && !bootloader_dfu_sd_in_progress())
{
// Select a bank region to use as application region.
// @note: Only applications running from DFU_BANK_0_REGION_START is supported.
err_code = app_timer_stop( FEED_WD_TIMER );
APP_ERROR_CHECK(err_code);
bootloader_app_start(DFU_BANK_0_REGION_START);
}
....
}
how should I feed the watch dog in bootloarder. I had try to feed the dog like that,but it couldn't work fine after dfu.
/**@brief Function for initialization of time handle.
*/
//timer calender
static void timer_index_feed_wd( void *p_context )
{
//fed the dog
NRF_WDT->RR[0] = WDT_RR_RR_Reload;
}
/**@brief Function for initializing the timer handler module (app_timer).
*/
static void timers_init(void)
{
// Initialize timer module, making it use the scheduler.
APP_TIMER_APPSH_INIT(APP_TIMER_PRESCALER, APP_TIMER_MAX_TIMERS, APP_TIMER_OP_QUEUE_SIZE, true);
uint32_t err_code;
err_code = app_timer_create( &FEED_WD_TIMER, APP_TIMER_MODE_REPEATED, timer_index_feed_wd );
APP_ERROR_CHECK(err_code);
}
main()
{
.....
if (dfu_start || (!bootloader_app_is_valid(DFU_BANK_0_REGION_START)))
{
DisplayDFU( );
//stop timer
err_code = app_timer_start(FEED_WD_TIMER, FEED_WATCH_DOG_PERIOD, NULL);
APP_ERROR_CHECK(err_code);
// Initiate an update of the firmware.
err_code = bootloader_dfu_start();
APP_ERROR_CHECK(err_code);
}
if (bootloader_app_is_valid(DFU_BANK_0_REGION_START) && !bootloader_dfu_sd_in_progress())
{
// Select a bank region to use as application region.
// @note: Only applications running from DFU_BANK_0_REGION_START is supported.
err_code = app_timer_stop( FEED_WD_TIMER );
APP_ERROR_CHECK(err_code);
bootloader_app_start(DFU_BANK_0_REGION_START);
}
....
}