[S32R294] My R294 EVB run into the prolog_IVOR1() after I trigger the CAN network packet.

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

[S32R294] My R294 EVB run into the prolog_IVOR1() after I trigger the CAN network packet.

Jump to solution
1,205 Views
Gordon_Yang
Contributor III

Because I revise the CAN_PAL demo driver for my own usage. But I found that it would run into prolog_IVOR1() after I sent the CAN packet at the second time, that is, it would send the packet successfully in the first packet. The debug IDE's screenshot is like below.

While I tried to combine the NXP's can_pal example driver project with my own HAL code, it wouldn't meet this issue. Might it be the project setting issue?

What is the possible problem that I meet? And how could I resolve it? Thanks.

image.png

 
0 Kudos
1 Solution
1,102 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

I do not have the board here right now to test it but I can see that you are calling init function and SendCANData before starting the scheduler. Generally, if a function/driver uses OS services, it's mandatory to call them after starting the scheduler. Maybe this is the reason. If you don't use freeRTOS in the project, is it working?

Regards,

Lukas

View solution in original post

0 Kudos
7 Replies
1,138 Views
Gordon_Yang
Contributor III

Hi,

I have checked the MCSRR0. And let me descript the scenario as below.

Because the main feature for my project is a simple CAN transmission module like the official SDK's can_pal.

Do you know why the CAN_PAL would hang here? Thanks.

1

I use “S32DS from Example Project” to create the S32R294’s SDK FreeRTOS demo project.

Gordon_Yang_0-1620986289958.png

 

2

Use the component to add a new CAN_PAL module and setup the corresponding PINMUX for this CAN module.

Gordon_Yang_1-1620986290021.jpeg

 

Gordon_Yang_2-1620986290051.jpeg

 

3

I revised the main.c to trigger the CAN_Send() repeatedly to send CAN network packet.

Gordon_Yang_3-1620986290117.jpeg

 

Gordon_Yang_4-1620986290168.jpeg

 

 

4

But It stuck inside FLEXCAN_StartSendData() of CAN_Send().

Gordon_Yang_5-1620986290231.jpeg

 

5

The code is dead because the system runs into the exception handling, prolog_IVOR1().

Gordon_Yang_6-1620986290287.jpeg

 

6

And I checked the MCSRR0 which contains an address of instruction which caused the machine check. It showed that “0x0100544E”.

  • “0x0100544E” is the disassembly of “if (state->mbs[mb_idx].state != FLEXCAN_MB_IDLE)” in FLEXCAN_StartSendData(), official SDK’s flexcan_driver.c.

 

 

 

<P.S.> While I create the all new “S32DS Application Project” and also add a new CAN_PAL component. The system ran into the same error, too.       

 

0 Kudos
1,103 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

I do not have the board here right now to test it but I can see that you are calling init function and SendCANData before starting the scheduler. Generally, if a function/driver uses OS services, it's mandatory to call them after starting the scheduler. Maybe this is the reason. If you don't use freeRTOS in the project, is it working?

Regards,

Lukas

0 Kudos
1,077 Views
Gordon_Yang
Contributor III

Hi Lukas @lukaszadrapa,

After I remove the FreeRTOS component from my project, the SendCANData could perform successfully.

If I want that FreeRTOS involves into my project, whether the only solution is to create a FreeRTOS task for SendCANData?

Thanks.

0 Kudos
1,068 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Gordon,

yes, if freeRTOS is added to a project, the functions should be called only from tasks.

I can remember that this example for MPC5746C shows how to implement it in freeRTOS:

c:\NXP\S32DS_Power_v2.1\S32DS\software\S32_SDK_S32PA_RTM_3.0.0\examples\MPC5746C\demo_apps\flexcan\

Regards,

Lukas

 

0 Kudos
1,056 Views
Gordon_Yang
Contributor III

@lukaszadrapa 

Got it. Thanks for your reply.

0 Kudos
1,176 Views
Gordon_Yang
Contributor III

@lukaszadrapa 

When I want to look up the register list, My EmbSys Register View cannot shows anything as below session's description.

Do you know how to resolve it? Thanks.

https://community.nxp.com/t5/Other-NXP-Products/S32R294-Cannot-view-the-EmbSys-Register-View-for-S32...

 

0 Kudos
1,192 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Gordon,

when IVOR1 is triggered, core registers are updated as described here:

lukaszadrapa_0-1620657976778.png

MCSRR0 contains an address of instruction which caused the machine check. So, this can help to find out what was the root cause. Could you check this?

Regards,

Lukas