Interrupt Priority

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
1,876件の閲覧回数
Dhaya
Contributor III

Hi, 

    Here we using multiple interrupts including externa, I2C, Timers,.. During run time, some of the interrupts has been disabled and enable as per the application needs. So my doubt is, when the priority of the interrupt has to assigned. During enable of interrupt or during initialization or set all peripheral interrupts in one by one manners

0 件の賞賛
返信
1 解決策
1,867件の閲覧回数
ErichStyger
Specialist I

In principle, you can do it anytime.

Just keep in mind that the architecture might have some delays/caches, so you need to add memory barriers, as explained in https://mcuoneclipse.com/2015/10/16/nvic-disabling-interrupts-on-arm-cortex-m-and-the-need-for-a-mem...

As for myself, I initialize interrupts during the device/peripheral setup, one by one, with the global interrupts disabled. At the end, with starting the application or the RTOS, the global interrupts get enabled.

If disabling/enabling interrupts during the runtime is needed for example for re-entrancy reasons, then you could possibly manage this with proper interrupt grouping and priority mapping. The challenge with disabling certain interrupts at runtime might make it more complex to verify and validate that the system is operating as desired, but that depends of course on the stuff you are doing.

I hope this helps,

Erich

 

PS: You might have a read at a series about ARM Cortex interrupts:

https://mcuoneclipse.com/2016/08/14/arm-cortex-m-interrupts-and-freertos-part-1/

https://mcuoneclipse.com/2016/08/20/arm-cortex-m-interrupts-and-freertos-part-2/

https://mcuoneclipse.com/2016/08/28/arm-cortex-m-interrupts-and-freertos-part-3/

 

元の投稿で解決策を見る

1 返信
1,868件の閲覧回数
ErichStyger
Specialist I

In principle, you can do it anytime.

Just keep in mind that the architecture might have some delays/caches, so you need to add memory barriers, as explained in https://mcuoneclipse.com/2015/10/16/nvic-disabling-interrupts-on-arm-cortex-m-and-the-need-for-a-mem...

As for myself, I initialize interrupts during the device/peripheral setup, one by one, with the global interrupts disabled. At the end, with starting the application or the RTOS, the global interrupts get enabled.

If disabling/enabling interrupts during the runtime is needed for example for re-entrancy reasons, then you could possibly manage this with proper interrupt grouping and priority mapping. The challenge with disabling certain interrupts at runtime might make it more complex to verify and validate that the system is operating as desired, but that depends of course on the stuff you are doing.

I hope this helps,

Erich

 

PS: You might have a read at a series about ARM Cortex interrupts:

https://mcuoneclipse.com/2016/08/14/arm-cortex-m-interrupts-and-freertos-part-1/

https://mcuoneclipse.com/2016/08/20/arm-cortex-m-interrupts-and-freertos-part-2/

https://mcuoneclipse.com/2016/08/28/arm-cortex-m-interrupts-and-freertos-part-3/