Interrupt in freertos_i2c

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Interrupt in freertos_i2c

Jump to solution
814 Views
davidzhu
Contributor III

Hello,

I am testing freertos_i2c_frdmk66f demo project.

I found master task has a higher priority than slave task

/*******************************************************************************
* Definitions
******************************************************************************/


/* Task priorities. */
#define slave_task_PRIORITY (configMAX_PRIORITIES - 1)
#define master_task_PRIORITY (configMAX_PRIORITIES - 2)

But slave IRQ has a higher priority than master irq.

I don't understand this, could someone please can explain it?

0 Kudos
1 Solution
677 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi

Please be noted that ISR has higher priority over the tasks.

A task is a software feature that is unrelated to the hardware on which FreeRTOS is running. The priority of a task is assigned in software by the application writer, and scheduler decides which task will be in the running state.

An interrupt service is a hardware feature because hardware controls which interrupt routine will run. Tasks will only run when there are no ISRs running. So the lowest priority interrupt will interrupt the highest priority task.

For FreeRTOS task priority, the bigger the number, the lower is the priority.

Regards

Daniel

View solution in original post

0 Kudos
1 Reply
678 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi

Please be noted that ISR has higher priority over the tasks.

A task is a software feature that is unrelated to the hardware on which FreeRTOS is running. The priority of a task is assigned in software by the application writer, and scheduler decides which task will be in the running state.

An interrupt service is a hardware feature because hardware controls which interrupt routine will run. Tasks will only run when there are no ISRs running. So the lowest priority interrupt will interrupt the highest priority task.

For FreeRTOS task priority, the bigger the number, the lower is the priority.

Regards

Daniel

0 Kudos