Skip to main content

GPIO Interrupt Issue after flashing the program

2 months ago

GPIO Interrupt Issue after flashing the program

Posted byanith50 points 5 replies
0 upvotes

Hi, I've developed a GPIO interrupt function for a GPIO pin which triggers a callback when the input goes low and verified the same on the debugging session with keil. When I flash the compiled bin/hex file on to the SPI flash the callback function is not called after the GPIO pin goes low. The above program was done on DA14531Development Kit – USB.

2 months ago

PM_Dialog

Hi anith,

Thanks for your question online. Could you please share more insights regarding your project?

Is it a BLE or a non-BLE example? Are you using any of the available sleep modes? Which SDK example did you use?

Thanks, PM_Dialog

2 months ago

anith 50 points

Hi,

Is it a BLE or a non-BLE example?:- It's BLE example

Are you using any of the available sleep modes?:- Hibernation, ARCH_EXT_SLEEP_ON

Which SDK example did you use?:- empty_peripheral_template example

Also I undefined DEVELOPMENT_DEBUG macro, and tried ADVERTISE_FOREVER, I've tried GPIO 11 , 6 , 1 as GPIO interrupt on USB development board.

Edit :- If I set sleep_state_t app_default_sleep_mode = ARCH_SLEEP_OFF the callback function works.

2 months ago

PM_Dialog

Hi anith,

Thanks for your inputs. For debugging purposes the DEVELOPMENT_DEBUG macro should be defined.

You mentioned that you are using hibernation mode, so I assume that you stop advertising and put the device into hibernation.

So, the button you are using, is it for waking up the device from hibernation?

While the device is adverting, are you using extended sleep mode?

Thanks, PM_Dialog

2 months ago

anith 50 points

Hi

I use GPIO interrupt to read data from a sensor, the sensor provides a low signal when the data is ready. I've used ARCH_EXT_SLEEP_ON as default sleep mode. If no central is connected for 60 seconds I'll stop the advertisement and put the device into hibernation, if a central is connected I'll initialize the sensor, wait for a data ready signal and then read the sensor's data via I2C. The data ready signal will occur at a time interval of 1 second. I've used GPIO_EnableIRQ() function to enable GPIO interrupt and GPIO_RegisterCallback() to assign a callback for the same. Everything works fine on debugging mode but the interrupt callback doesn't get called if I flash the program. Do I need to use wkupct_enable_irq() and wkupct_register_callback() for my application?

1 month ago

PM_Dialog

Hi anith,

I believe this is related with the extended sleep mode. If you are using extended sleep as default sleep mode, the device will go to sleep in between advertising or connection intervals. So. Keep in mind that in sleep mode all the peripheral domains are powered down. My suggestion would be to use the WKUP controller for this use case. Please refer to ble_app_sleepmode example of the SDK6.0.14 for more details of the WKUP controller.

You can also try to disable the extended sleep mode.

Thanks, PM_Dialog