Page 1 of 1

Interruptions conflict stm32f103RB6T

Posted: Tue Apr 06, 2021 2:12 pm
by AurelGTS
Hello,

I've developped a board based on stm32f103RB6T and maple libraries.
I'm using 15 external interruptions pins. It seems I have a conflict between interruptions, some of them are not detected.
If I change order of attachInterrupt instructions, other pins become unavailable, so the order changes the behavior.
File board.ccp used seems correct (generic_stm32f103r) and the gpio declaration ok.
I've no more idea where to search. Any help will be welcome.
Thanks in advance !

regards,
Aurélien

Re: Interruptions conflict stm32f103RB6T

Posted: Tue Apr 06, 2021 2:23 pm
by stevestrong
Please post an example sketch which shows the problem.
In general, there can be only 16 bits of any port associated with an interrupt.
For example: if you have an interrupt activated on PA8, this will share the same interrupt on PB8 or PC8 or PD8.

Re: Interruptions conflict stm32f103RB6T

Posted: Tue Apr 06, 2021 2:46 pm
by AurelGTS
Hello,

Thanks for your feedback. My project is really big and I can not share it easily.
I do not used interruption in parallel, the conflict happens using pins one by one. Some pins does not react anymore, but depending of order of attachinterrupt instructions.
I've disabled some hardware pins in setup to be able to use them with afio_cfg_debug_ports(AFIO_DEBUG_SW_ONLY);
I don't know if it could be a problem with hardware pins or with other interruptions like USB.

Here are pins using interrupts :
#define PIN_TRACK1 PA0
#define PIN_TRACK2 PA1
#define PIN_TRACK3 PA2
#define PIN_TRACK4 PA3
#define PIN_SCENE_UP PA15
#define PIN_SCENE_DOWN PB5
#define PIN_LEFT PB7
#define PIN_RIGHT PB3
#define PIN_MUTE PB8
#define PIN_GLOBAL_START PB9
#define PIN_ENCODERA_TRACK1 PC8
#define PIN_ENCODERA_TRACK2 PC10
#define PIN_ENCODERA_TRACK3 PC3
#define PIN_ENCODERA_TRACK4 PC4
#define PIN_ENCODERA_MASTER PB0

Thanks

Re: Interruptions conflict stm32f103RB6T

Posted: Tue Apr 06, 2021 3:08 pm
by GonzoG
You can use only one pin with same number (eg. Px15) for interrupts.
And you have:
1. PA3, PB3, PC3
2. PA0, PB0
3. PB8, PC8

Re: Interruptions conflict stm32f103RB6T

Posted: Tue Apr 06, 2021 3:24 pm
by AurelGTS
really ? I was thinking it will only act with priority.

Re: Interruptions conflict stm32f103RB6T

Posted: Tue Apr 06, 2021 3:47 pm
by fpiSTM

Re: Interruptions conflict stm32f103RB6T

Posted: Tue Apr 06, 2021 3:50 pm
by AurelGTS
ok, many thanks for your help ! Fortunately I only have 15 interruptions :)

Re: Interruptions conflict stm32f103RB6T

Posted: Tue Apr 06, 2021 7:34 pm
by ag123
if you do a lot of processing in your interrupt handler, there is chance the next interrupt happens before you can finish all that processing