Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12590 Discussions

Nios II automatic ISR pre-emption

Thierry29
Beginner
490 Views

The Nios II Software Developer Handbook indicates in chapter "9. Exception Handling", section "9.2.3.3. Managing Pre-Emption", that "Automatic pre-emption is only available if you enable it in the BSP settings".

I did not find how to do this in the BSP editor. Does someone could indicate me where this option is in the BSP editor (or how to enable it in another way)? Many thanks in advance.

0 Kudos
2 Replies
BoonBengT_Intel
Moderator
480 Views

Hi @Thierry29,

 

Thank you for posting in Intel community forum and hope all is well.
Per my understanding it will be auto enable when drivers supports it, hence is there any custom driver in your case?


If yes, this post here might give you some insight on enabling it.
Else check if drivers in design are updated with enhanced interrupt API.
Hope that clarify.

 

Best Wishes
BB

0 Kudos
Thierry29
Beginner
455 Views

Hi, thank you for your reply.

I do not use custom drivers in my project, only devices from the standard library (mainly pio and timer). I have verified that each of them declare both "isr_preemption_supported" property TRUE and "supported_interrupt_apis" property "enhanced_interrupt_api". If I correctly understand the documentation, the ISR preemption should be automatically enabled. Incidentally if it is true I do not understand why the documentation, section "9.2.3.3. Managing Pre-Emption", indicates that "Automatic pre-emption is only available if you enable it in the BSP settings". Does it mean an action in BSP settings is necessary?

In order to verify if isr preemption is enabled I have launched a simple program:
- a periodic interruption is generated thanks to the HAL facility (alt_alarm_start()) with priority 0 and makes leds blinking each second.
- another interruption source is a push-button, with priority 1 (lower than the periodic one).
The push-button ISR is only an infinite loop: if isr preemption is enabled the leds must continue to blink even if the push-button is pressed because the periodic isr has higher priority.

I my case the leds stop to blink after the push-button is pressed. The infinite loop in the push-button isr deadlocks the system: an isr with low priority masks another one with a higher priority.

So, my problem is to understand why isr preemption is not automatically enabled, or how to enable it.

Thank you for your suggestions and help.

Best regards

0 Kudos
Reply