eag****com
I am going to use AON WDT when system fails.
I have integrated WDT to my code. It works but I couldn't control wdt callback(event handler, alarm callback). It seems not working.
SDK: GR551x_SDK_V2.0.2, My test code is as follows.
zhongchengzhi
Hi ,
1. Could you replace the ble_app_template example main.c with below code and do som tests?
#include "user_app.h"
#include "user_periph_setup.h"
#include "gr_includes.h"
#include "scatter_common.h"
#include "flash_scatter_config.h"
#include "custom_config.h"
#include "patch.h"
#include "app_log.h"
#include "app_aon_wdt.h"
/*
* LOCAL VARIABLE DEFINITIONS
*****************************************************************************************
*/
/**@brief Stack global variables for Bluetooth protocol stack. */
STACK_HEAP_INIT(heaps_table);
app_aon_wdt_params_t s_aon_wdt_params = {
.init = {
.counter = 0x00FF,
.alarm_counter = 0x1a,
},
.aon_aon_wdt_env = NULL,
};
void app_aon_wdt_evt_handler(void)
{
printf("A\r\n");
}
int main(void)
{
// Initialize user peripherals.
app_periph_init();
// Initialize ble stack.
ble_stack_init(ble_evt_handler, &heaps_table);
// Initialize won wdt.
app_aon_wdt_init(&s_aon_wdt_params , app_aon_wdt_evt_handler);
// loop
while (1)
{
app_log_flush();
pwr_mgmt_schedule();
sys_delay_ms(500);
app_aon_wdt_refresh();
}
}
eag****com
Thanks for your help!
It works well. I noticed that wdt_event_handler is timed out in short time.
I printed text "event handler called\r\n" but before print finished, system reset so some of print text is displayed in app logo.
If I should call NVDS_PUT in event handler, I wonder if this function is exactly run.
Open WeChat, use "Scan" to follow.