palEnablePadEvent

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
omcdr
Posts: 89
Joined: Wed Aug 17, 2016 3:25 pm
Has thanked: 7 times
Been thanked: 7 times

palEnablePadEvent

Post by omcdr »

I want to enable IRQ on GPIOA 0, there is my simple code:

Code: Select all

   palSetPadMode(GPIOA, 0,PAL_MODE_INPUT_PULLUP | PAL_STM32_OSPEED_HIGHEST);
   palSetPadCallback(GPIOA, 0, cbIrqA0, NULL);
   palEnablePadEvent(GPIOA, 0, PAL_EVENT_MODE_FALLING_EDGE);


but I got Assert in this line

Code: Select all

  osalDbgAssert(((EXTI->RTSR & padmask) == 0U) &&
                ((EXTI->FTSR & padmask) == 0U), "channel already in use");


Why ?
how to properly activate ext IRQ ?
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: palEnablePadEvent

Post by Giovanni »

Hi,

Do you have other channels enabled? you cannot activate an IRQ on the same bit of different ports.

Giovanni
Post Reply