Interruptions conflict stm32f103RB6T

If you made your own board, post here, unless you built a Maple or Maple mini clone etc
Post Reply
AurelGTS
Posts: 7
Joined: Sat Jan 02, 2021 2:10 pm

Interruptions conflict stm32f103RB6T

Post 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
by GonzoG » Tue Apr 06, 2021 3:08 pm
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
Go to full post
stevestrong
Posts: 459
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Interruptions conflict stm32f103RB6T

Post 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.
AurelGTS
Posts: 7
Joined: Sat Jan 02, 2021 2:10 pm

Re: Interruptions conflict stm32f103RB6T

Post 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
GonzoG
Posts: 107
Joined: Wed Jan 15, 2020 11:30 am
Answers: 7

Re: Interruptions conflict stm32f103RB6T

Post 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
AurelGTS
Posts: 7
Joined: Sat Jan 02, 2021 2:10 pm

Re: Interruptions conflict stm32f103RB6T

Post by AurelGTS »

really ? I was thinking it will only act with priority.
User avatar
fpiSTM
Posts: 1022
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 47
Location: Le Mans
Contact:

Re: Interruptions conflict stm32f103RB6T

Post by fpiSTM »

AurelGTS
Posts: 7
Joined: Sat Jan 02, 2021 2:10 pm

Re: Interruptions conflict stm32f103RB6T

Post by AurelGTS »

ok, many thanks for your help ! Fortunately I only have 15 interruptions :)
ag123
Posts: 732
Joined: Thu Dec 19, 2019 5:30 am
Answers: 3

Re: Interruptions conflict stm32f103RB6T

Post 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
Post Reply

Return to “Custom design boards”