How to enable watchdog with DTM?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to enable watchdog with DTM?

406 Views
tedwu1
Contributor III

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

0 Kudos
1 Reply

394 Views
EduardoZamora
NXP TechSupport
NXP TechSupport

Hi, Ted Wu,

Hope you are doing well.

QN9021 SDK version 1.0.0 is out of date, would it be possible for your application to migrate to the SDK version 1.4.0?

Also, could you please provide more details about your application? Why is it required to add the Watchdog?

Which example project is your application based on? Please, take a look at the prj_controller_mode example project, inside the QN9021 SDK, it could be used for DTM test directly by connecting UART0 to the tester.

Regards,
Eduardo.

0 Kudos