EXT edge triggering.

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

Moderators: RoccoMarco, barthess

rew
Posts: 380
Joined: Sat Jul 19, 2014 12:59 pm
Has thanked: 2 times
Been thanked: 13 times

EXT edge triggering.

Postby rew » Wed Aug 28, 2019 7:25 pm

I have an application where the tim2 interrupt (with the VT callbacks) was blocking other interrupts for too long. I have now set the priorities correctly and things now work fine and dandy. :-)

However I still have the last "things did not work as expected" trace on my screen, and something puzzles me.

exti.png
exti.png (4.98 KiB) Viewed 1324 times

The bottom trace is a signal going into my STM32F072. It comes in on PA8 and is tied to an exti callback.
The trace above that is my "debug signal". The small spikes are one type of interrupt, the big one is the VT callback running. I would've expected the exti interrupt to run and process at the lower level just after the tim2/VT interrupt finishes running.
I've configured the ext_config with:

Code: Select all

static EXTConfig extcfg; // initialize all to zero/disabled.

void add_ext (int chan, int flags, extcallback_t cb)
{
  extcfg.channels[chan].mode = flags;
  extcfg.channels[chan].cb   = cb;
}
and:

Code: Select all

add_ext (8,
      EXT_CH_MODE_RISING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOA,
      bogen_cb);

So I would expect the "rising edge" to trigger the exti interrupt, and then for my callback to be called once the time is ripe. However I don't see that happening. (proof for that is outside the logic analyser grab).

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

Re: EXT edge triggering.

Postby Giovanni » Wed Aug 28, 2019 8:09 pm

Have you called extStart() after changing the configuration structure? without that EXTI edge registers are not reprogrammed.

Just a note, EXT has been obsoleted years ago and removed entirely in latest versions. You could try the new PAL API which is much much easier to use for this kind of things.

Giovanni

rew
Posts: 380
Joined: Sat Jul 19, 2014 12:59 pm
Has thanked: 2 times
Been thanked: 13 times

Re: EXT edge triggering.

Postby rew » Tue Sep 03, 2019 9:53 am

At one point in time I tried tracking the "latest and greatest" and that went well for a while. Then one day you changed an API function and while I had just a small change in my code "expected work to write and test: 0.5h" I suddenly had to spend several hours trying to figure out why things no longer worked. Yeah, I'm using an older version.

Yes, I call extStart after I changed the config structure: My configuration is perfectly static that I could put it in the (const) init structure as intended, but when I changed my hardware and the line moved I had to change it but forgot. So now the define, this function is on that pin can direct the EXT config as well, at the cost of a little RAM and CPU-at-init time.


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 60 guests