Help with EXT driver configuration Topic is solved

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

Moderators: RoccoMarco, barthess

josesimoes
Posts: 91
Joined: Sat Feb 18, 2017 11:50 am
Has thanked: 43 times
Been thanked: 23 times

Help with EXT driver configuration

Postby josesimoes » Thu Aug 17, 2017 3:35 pm

Hi,

I'm trying to use (and understand :) ) how to use the EXT driver and setup the configuration.
I can see a call to the interrupt callback when I use this and hit PA0:

Code: Select all

static EXTConfig extInterruptsConfiguration = {
  {
    {EXT_CH_MODE_BOTH_EDGES | EXT_MODE_GPIOA , extInterruptCallback},
...
  }
};


or this and then I hit PC0:

Code: Select all

static EXTConfig extInterruptsConfiguration = {
  {
    {EXT_CH_MODE_BOTH_EDGES | EXT_MODE_GPIOC , extInterruptCallback},
...
  }
};


but it seems that I can't use this because now it only reacts to PC0:

Code: Select all

static EXTConfig extInterruptsConfiguration = {
  {
    {EXT_CH_MODE_BOTH_EDGES | EXT_MODE_GPIOA | EXT_MODE_GPI0C , extInterruptCallback},
...
  }
};


Could you please help me understand how to properly configure this?

Can't I have channel 0 reacting to all Pn0 pins, channel 3 reacting to all Pn3 pins, etc?

Thanks!

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Help with EXT driver configuration  Topic is solved

Postby Giovanni » Thu Aug 17, 2017 3:37 pm

Hi,

On STM32 you cannot have the same bit used on different ports, you can use bit 0 on GPIOA or GPIOC but not both. See how the EXTI unit is wired in the STM32 Reference Manual.

Giovanni

josesimoes
Posts: 91
Joined: Sat Feb 18, 2017 11:50 am
Has thanked: 43 times
Been thanked: 23 times

Re: Help with EXT driver configuration

Postby josesimoes » Thu Aug 17, 2017 3:43 pm

I was exactly looking at the ETXI diagram there and was under the impression that ETXI0 could be triggered for all Pn0...
Which is wrong according to you explanation. So ETXI0 can only react to one of the existing Pn0s. Is that it?

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Help with EXT driver configuration

Postby Giovanni » Thu Aug 17, 2017 3:46 pm

Correct.

Those EXT_MODE_GPIOx constants are not meant to be ORed, it is selector in the PINx mux.

Giovanni

josesimoes
Posts: 91
Joined: Sat Feb 18, 2017 11:50 am
Has thanked: 43 times
Been thanked: 23 times

Re: Help with EXT driver configuration

Postby josesimoes » Thu Aug 17, 2017 3:52 pm

Got it.
Thank you very much! :)


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 14 guests