Hello,
My project uses the MCU of QN9021 and SDK 1.0.0. I define CFG_9020_B2 at usr_config.h
I modify some defines at this file like following.
At the usrconfig.h
/// ADV watchdog timer
#if (defined(CFG_9020_B0))
#define CFG_ADV_WDT
#endif
/// Test mode controll pin
#define CFG_TEST_CTRL_PIN GPIO_P03
At app_main.c
int main(void)
{
....
#if (defined(QN_ADV_WDT))
wdt_init(163840, WDT_RESET_MOD); // 5s
usr_env.adv_wdt_enable = true;
#endif
#if (defined(QN_TEST_CTRL_PIN))
if(gpio_read_pin(QN_TEST_CTRL_PIN) == GPIO_HIGH)
{
#endif
button_init();
// Work mode defined in the usr_config.h
ble_init((enum WORK_MODE)QN_WORK_MODE, QN_HCI_UART, QN_HCI_UART_RD, QN_HCI_UART_WR, ble_heap, BLE_HEAP_SIZE, QN_BLE_SLEEP);
#if (defined(QN_TEST_CTRL_PIN))
}
else
{
// Test mode (controller mode)
ble_init((enum WORK_MODE)WORK_MODE_HCI, QN_HCI_UART, QN_HCI_UART_RD, QN_HCI_UART_WR, ble_heap, BLE_HEAP_SIZE, false);
// In the test mode, the program moniter test control pin. If the input of test control ping changes to low level,
// it means work mode should be switched to the mode defined in the user configuration file.
gpio_set_interrupt(QN_TEST_CTRL_PIN, GPIO_INT_HIGH_LEVEL);
gpio_enable_interrupt(QN_TEST_CTRL_PIN);
}
#endif
Now the DTM will be interrupted by the watchdog. Unable to test DUT properly. How to make watchdog work properly in DTM?
Thank you in advance.
Ted Wu