Dear Dialog,
我使用自己的自定义板、销its interrupt configuration are as follows:
// pin 0.3
GPIO_ConfigurePin( PET_INT_PORT, PET_INT_PIN, INPUT_PULLDOWN, PID_GPIO, false );
NVIC_SetPriority(GPIO0_IRQn,0);
GPIO_RegisterCallback(GPIO0_IRQn,user_gpio0_handler);
NVIC_EnableIRQ(GPIO0_IRQn);
// pin 2.9
GPIO_ConfigurePin( PET_MOD_PORT, PET_MOD_PIN, INPUT_PULLUP, PID_GPIO, true );
NVIC_SetPriority(GPIO2_IRQn,0);
GPIO_RegisterCallback(GPIO2_IRQn,user_gpio2_handler);
NVIC_EnableIRQ(GPIO2_IRQn);
SetWord16(GPIO_IRQ0_IN_SEL_REG,0x000a); //interrupt source is P0.3
SetWord16(GPIO_IRQ2_IN_SEL_REG,0x0018); //interrupt source is P2.9
SetWord16(GPIO_DEBOUNCE_REG,0x050a); //enable GPIO_IRQ0、GPIO_IRQ1 delay,delay time 10 ms
SetWord16(GPIO_INT_LEVEL_CTRL_REG,0x0504);// Interrupt level
The Pin of 2.9 is pull up in our own costom board by hardware.There is an issue,each time the system wakes up from sleep, it will generate a PIN2.9 interrupt,Why is this so?
Thanks for you reading.
Jerry
Hi Jerry,
I am sorry, i dont quite get your issue, you are setting two GPIO_IRQs one for pin 0_3 and another for pin 2_9 and as soon as the 580 wakes up you see that there is always an execution of the user_gpio2_handler()? How the 580 wakes up ? Are you setting up the wake up controller ? Can you give some more details in order for me to be able to understand what is the use case ?
Thanks MT_dialog
Hi,MT_dialog,
Yes, I also enabled two external interrupt pins, the tower doors are P0.3 and P2.9, but I think they should not be in conflict.
I set up a software timer, wake up once every DA14580, every time after the wakeup, my chip will execute the function user_gpio2_handler().
About the wake of the controller, I'm not very clear that I mean I might not have set it up, Can you give me some hints?
Hi Jerry,
So, you ve set up a kernel timer in order to wake up and two GPIO interrupts and every time the device wakes up from the timer the IRQ from the pin 2.9 is triggered ? The device can wake up either via a timer which is considered a BLE event and via the wake up controller (or WakeUp Timer), the device cannot wake up via the standard GPIO IRQs. If when the timer elapses and the device wakes up and at that moment you get the IRQ from port 2.9 i can assume that this means that youhave an interrupt. If you configure your device in no sleep mode, are you seeing the interrupt triggered continuously? Also in order to use the peripherals, the GPIO interrupts and the wake up controller please use the drivers, have a look at the UM-B-051 da1458x Software Platform Reference.pdf in paragraph 10, section 10.3 explains the GPIO drivers and 10.7 the Wake Up Timer. Also setting the GPIOs in prio 0 not a good idea, BLE interrupts should be in the top priority and that is set to 1.
Thanks MT_dialog
Hi,MT_dialog,
I adjusted the interrupt initialization code in the order, to solve the problem of abnormal interrupt. Above you mentioned the device can not wake up through the standard GPIO IRQ, how to set up the device in order to make the general GPIO_IRQ wake up?
Thanks Jerry
Hi 2455321262,
There are documents and examples that indicate that, please check the document that i ve mentioned above in order to check the wake up timer API and also the ble_app_sleep mode in the SDK has an example on how the wake up from an external interrupt, please check in the ble_app_sleepmode project the user_app_adv_undirect_complete() function, this is where the device is configured in order to go to sleep and wait for an external wake up.
Thanks MT_dialog