Sorry, I was once again travelling abroad for business... Now I have some time for my project again.
I spent some time investigating about the interrupts. I added some debug prints in my chSysHalt handler, so I can get exactly all NVIC settings when the assertion fails.
As I see all settings are the intended ones, so no nasty code doing stuff behind my back.
All priorities are set only once, during initialization, before Chibios starts. No runtime changes. I think this simplifies things a lot.
The output of my prints is the following:
Code: Select all
Priority grouping: 2
Interrupt -14, priority: 0 // Non maskable interrupt.
Interrupt -13, priority: 0 // Unused.
Interrupt -12, priority: 0 // Memory management interrupt.
Interrupt -11, priority: 0 // Bus fault interrupt.
Interrupt -10, priority: 0 // Usage fault interrupt.
Interrupt -9, priority: 0 // Unused.
Interrupt -8, priority: 0 // Unused.
Interrupt -7, priority: 0 // Unused.
Interrupt -6, priority: 0 // Unused.
Interrupt -5, priority: 1 // SVCall interrupt.
Interrupt -4, priority: 0 // Debug monitor interrupt.
Interrupt -3, priority: 0 // Unused.
Interrupt -2, priority: 2 // PendSV interrupt.
Interrupt -1, priority: 3 // Systick interrupt.
Interrupt 0, priority: 5
Interrupt 1, priority: 5
Interrupt 2, priority: 5
Interrupt 3, priority: 5
Interrupt 4, priority: 5
Interrupt 5, priority: 5
Interrupt 6, priority: 5
Interrupt 7, priority: 5
Interrupt 8, priority: 5
Interrupt 9, priority: 5
Interrupt 10, priority: 5
Interrupt 11, priority: 5
Interrupt 12, priority: 5
Interrupt 13, priority: 5
Interrupt 14, priority: 5
Interrupt 15, priority: 5
Interrupt 16, priority: 5
Interrupt 17, priority: 5
Interrupt 18, priority: 5
Interrupt 19, priority: 5
Interrupt 20, priority: 5
Interrupt 21, priority: 5
Interrupt 22, priority: 5
Interrupt 23, priority: 5
Interrupt 24, priority: 5
Interrupt 25, priority: 5
Interrupt 26, priority: 5
Interrupt 27, priority: 5
Interrupt 28, priority: 5
Interrupt 29, priority: 5
Interrupt 30, priority: 5
Interrupt 31, priority: 5
Interrupt 32, priority: 5
Interrupt 33, priority: 5
Interrupt 34, priority: 5
It seems OK, to me.
The only unclear thing for me is the priority grouping. It is set to Chibios default, which the documentation states that disables all grouping (which is what I want).