Z2_2 core is sleeping when receiving data from UART USB composite

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

Z2_2 core is sleeping when receiving data from UART USB composite

1,015 Views
developer_newbie
Contributor III

Hello,

I have developed a USB UART composite in order to receive data from Linux PC using USB connection.

The link is up and I can receive data in Linux PC from Z2_2 using uart (/dev/ttyACM0 is detected)

but when I sent data from PC to Z2_2 core (MPC5748G), I received for a moment but after that Z2_2 is blocked seems it slept.

When I have made a pause of execution using PE Micro debugger I have seen this  handler  that it blocks "WKPU_31_24_IRQHandler() at 0x1402bc8"

developer_newbie_0-1682433908290.png

My startup_MPC5748G.s contains this config:

developer_newbie_1-1682433964428.png

NOTE: There are no C implementation for the function WKPU_31_24_IRQHandler()

Why I had this kind of issue and how can I fix it ?

 

0 Kudos
8 Replies

993 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @developer_newbie 

as a first step, I would check WKPU registers if an interrupt or wake up event is enabled in WKPU (accidentally or intentionally). If not, it's some kind of runaway and more debugging will be necessary.

Regards,

Lukas

0 Kudos

960 Views
developer_newbie
Contributor III

Hi @lukaszadrapa,

I have tried to disable WKPU IRQ but I still have a block of Core Z2_2 but in another WKPU handler "WKPU_23_16_IRQHandler() at 0x1402bc8"

developer_newbie_1-1682945237937.png

 

developer_newbie_3-1682945517142.png

Here the status of WKPU registers before disabling IRQ:

developer_newbie_0-1682951780769.png

Here the status of WKPU registers after disabling IRQ:

developer_newbie_0-1682945169948.png

 

Regards

0 Kudos

946 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

I missed that IVOR1 was triggered before that according to call stack. Core register MCSRR0 should contain address of instruction which caused the error / IVOR1 and MCSR should contain the reason of this error. Could you check these two registers?

Regards,

Lukas

0 Kudos

940 Views
developer_newbie
Contributor III

Hello @lukaszadrapa,

Here the result :

developer_newbie_0-1683030845053.png

 

startup_MPC5748G.S:

developer_newbie_1-1683030991186.png

 

How to interept this result ?

 

0 Kudos

932 Views
developer_newbie
Contributor III

Hello @lukaszadrapa,

I have added this function:

 

 

 

void IVOR1_Exception_Handler(void)
{
	while(1);
}

 

 

 

 

developer_newbie_0-1683034027219.png

 

developer_newbie_0-1683052448718.png

developer_newbie_0-1683056517222.png

 

How can I know the root cause of this kind of errors / exceptions ?

Can I fix IVOR even with a workarround in the exception Handler function ?

0 Kudos

915 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Ok, if SPR registers are not already visible, you can enabled them in:

Window -> Show View -> Other

Here select:

lukaszadrapa_0-1683093112195.png

 And then you will see:

lukaszadrapa_1-1683093122940.png

 

Once you reach the IVOR1 handler, you need to check the content of MCSRR0 here. It will contain address of instruction which caused the error. Then you need to find this instruction in your code. An option is to go to Diassembly window and put address there like:

lukaszadrapa_2-1683093655172.png

Based on the content, next investigation will be needed. 

Regards,

Lukas

 

 

0 Kudos

899 Views
developer_newbie
Contributor III

Hello @lukaszadrapa,

Thanks for your support.

I have tried to read registers when I have IVOR1 but no addresses are displayed.

You can see below:

registers.PNG

code.PNG

ivor.PNG

How should I proceed in this case.

Thanks in advance of your support.

0 Kudos

893 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

This is copied from the user manual:

lukaszadrapa_0-1683184200908.png

And:

lukaszadrapa_1-1683184206594.png

Regards,

Lukas

0 Kudos