This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Use app_gpiote with softdevice

Hi,

I would like to use the app_gpiote files from Nordic in combination with the softdevice enabled. In the app_gpiote.c file interrupts are enabled using the standard CMSIS functions (NVIC_EnableIRQ etc)

Do I need to replace the CMSIS interrupt functions in the app_gpiote file by the sd_nvic_*** functions from Nordic? The ble_app_alert_notification project uses the softdevice with the app_gpiote module but the sd_nvic functions are not used in that example. Is that correct? Or could it cause problems to use CMSIS interrupt functions with the softdevice enabled?

Parents
  • It is not needed to modify app_gpiote to use it with the softdevice.

    Using the sd_nvic_* functions isn't a strict requirement, but it is something that the softdevice provides to make it easier to write correct applications. When you use the sd_nvic_* functions, the softdevice will ensure that you don't do anything that would ruin the link integrity, for example enabling an interrupt with an illegal priority

    If you know what you're doing, you can infact use the NVIC_* functions directly even if the softdevice is enabled. However, if you do that, and do stupid things, you get to keep both pieces when it breaks. ;-)

    app_gpiote have been written with the softdevice in mind, so it only does things that are known to be safe, no matter if the softdevice is enabled or not.

Reply
  • It is not needed to modify app_gpiote to use it with the softdevice.

    Using the sd_nvic_* functions isn't a strict requirement, but it is something that the softdevice provides to make it easier to write correct applications. When you use the sd_nvic_* functions, the softdevice will ensure that you don't do anything that would ruin the link integrity, for example enabling an interrupt with an illegal priority

    If you know what you're doing, you can infact use the NVIC_* functions directly even if the softdevice is enabled. However, if you do that, and do stupid things, you get to keep both pieces when it breaks. ;-)

    app_gpiote have been written with the softdevice in mind, so it only does things that are known to be safe, no matter if the softdevice is enabled or not.

Children
No Data
Related