MPC5744 FCAN Receive ISR Interrupt Priority

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

MPC5744 FCAN Receive ISR Interrupt Priority

Jump to solution
1,893 Views
j_wale_3
Contributor II

Hello Everyone,

Can anyone tell me what interrupt priority level is assigned to the FCAN receive interrupt? There seems to be no way to view or set it in, either the FCAN configuration or FCAN ISR (Rx Complete) function blocks.

Thanks,

John.

1 Solution
1,866 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @j_wale_3,

MBDT Toolbox generates code on top of the S32 SDK for ARM. The FCAN interrupt block from MBDT only installs a callback function in the S32 Driver. This driver is responsible for enabling and implementing the interrupt vector function triggered when an event happened.

You are right: There is no option for setting such interrupt priority. But the Driver does not specify the interrupt priority also.

However, you can set the interrupt priority that you need, by identifying the interrupt vector related to your Message Buffer and you can install some custom code that will set that priority.

Let me give you an example.

Let's assume that you need the CAN0_ORed_12_15_MB_IRQHandler to have priority 10. This interrupt is triggered when a successful transmission or reception occurs on Message Buffers 12-15 dor CAN0. We need to get the interrupt number for this handler the SDK defines if like CAN0_ORed_12_15_MB_IRQn. (In the generated code folder you can find a header file called MPC5744P.h).

SO the line of code you need is the following:

INT_SYS_SetPriority(CAN0_ORed_12_15_MB_IRQn, 10);

To insert it as a custom code You can use the System initialize block from the Simulink Coder library.

 

Hope this helps,

Marius

View solution in original post

0 Kudos
4 Replies
1,572 Views
p_a_u_darshana
Contributor III

Hi,

I currently use S32K146 EVB, and I want to use both LIN and CAN in our project.

I know that ADC blocks have the priority select option with them. But I can not find the interrupt priority  setting option in other blocks(CAN, LIN, Timer)

Does NXP have a plan to add them to future updates of the S32KMBD toolbox?

Do we have any other option to solve this? If yes, then I would like to know it steps by step.

Thank you

0 Kudos
1,867 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @j_wale_3,

MBDT Toolbox generates code on top of the S32 SDK for ARM. The FCAN interrupt block from MBDT only installs a callback function in the S32 Driver. This driver is responsible for enabling and implementing the interrupt vector function triggered when an event happened.

You are right: There is no option for setting such interrupt priority. But the Driver does not specify the interrupt priority also.

However, you can set the interrupt priority that you need, by identifying the interrupt vector related to your Message Buffer and you can install some custom code that will set that priority.

Let me give you an example.

Let's assume that you need the CAN0_ORed_12_15_MB_IRQHandler to have priority 10. This interrupt is triggered when a successful transmission or reception occurs on Message Buffers 12-15 dor CAN0. We need to get the interrupt number for this handler the SDK defines if like CAN0_ORed_12_15_MB_IRQn. (In the generated code folder you can find a header file called MPC5744P.h).

SO the line of code you need is the following:

INT_SYS_SetPriority(CAN0_ORed_12_15_MB_IRQn, 10);

To insert it as a custom code You can use the System initialize block from the Simulink Coder library.

 

Hope this helps,

Marius

0 Kudos
1,837 Views
j_wale_3
Contributor II

Hi Marius,

Thanks for your suggestion, which I confirm has been shown to work. This is a useful piece of knowledge.

Regards,

John.

1,828 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @j_wale_3 ,

I am glad it worked!

Best Regards,

Marius

0 Kudos