CN / EN
CN / EN

Ask a New Question

Design Support

If you need one-on-one support for confidential technical issues with your project, please click on "Contact Us" below.

How to use AON WDT of GR5515 GR551x

Resolved

eag****com

2024-10-30 22:24

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.


0 Favorites

0 Likes

2 Answers
The Best Answer

zhongchengzhi

Goodix Employee
2024-11-01 19:49

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();
    }
}


2 Comments

1 Like

1 Favorite

Your comment

eag****com

2024-11-01 20:36

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.


2 Comments

0 Likes

0 Favorites

Your comment

You can answer questions after logging in, please or register

Your Voice Matters
Contact Sales

Scan to follow

Open WeChat, use "Scan" to follow.