PFE EMAC0 Invalid Buffer Access Post ECU wakeup

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

PFE EMAC0 Invalid Buffer Access Post ECU wakeup

Jump to solution
390 Views
Avinash_7373
Contributor I

Hi,

I have configured EMAC0 at 2500 MBPS with required SERDES channel configuration. The Eth communication is up and running during ECU run state. 

After shutting down the applications accessing Eth communication, I trigger the ECU sleep request from ECUM with sets the MCU mode to SOC standby with HSE_CM7 selected as main core. 

Post wakeup the ECU resumes the normal operation, the layers COM, SOAD, TCPIP, ETHIF are working as expected, In the Eth if layer during the API invocation of "Provide TX buffer" returns an error stating TX buffers are not free, followed by no transmission of Eth frames

List of fixes tried resolve the issue:

1. Tried to Shutdown the PFE driver using "Eth_43_Pfe_Deinit" and starting the PFE driver by calling "Eth_43_Pfe_Init" but the CPU gets locked after the execution if Init API.
2. Tried to turndown the Eth controller using Eth_43_Pfe_SetController mode to down and bring it active by setting back the mode to "Active" which led to bus fault

Please let me know the potential fix for this issue. 

P.S>
Configurator Used: EB tresos
Eth PFE RTD version:  1.3.0 
SDK: GOLDVIP

Tags (1)
0 Kudos
Reply
1 Solution
76 Views
Joey_z
NXP Employee
NXP Employee

Hi,Avinash_7373

Has there been any progress on your issue? If you need continued support, could you please upload your code to the following link so that we can better analyze the problem?

https://support.nxp.com

BR

Joey

View solution in original post

0 Kudos
Reply
8 Replies
342 Views
Joey_z
NXP Employee
NXP Employee

Hi,Avinash_7373

Thank you for contacting us.

1.Are the PFEs only used in the M core? Have you used the A core together?

2.Are you using your customer board or our development board?

BR

Joey

0 Kudos
Reply
339 Views
Avinash_7373
Contributor I

Hi @Joey_z 

1. The PFEs are only being used in M-core
2. I'm using the development board: S32G-VNP-RDB3

Regards,
Avinash V

0 Kudos
Reply
331 Views
Joey_z
NXP Employee
NXP Employee

Hi,Avinash_7373

Thank you for your reply.

1.When the SOC entry the mode of standby, about the PFE clock of partition2 will be disabled, you should check if you have reenabled the partition2 after wakeup. You can try to check the  PRTN2_STAT.PCS state before the PFE Init.

2. Check the SERDES if it is a normal function.

BR

Joey

0 Kudos
Reply
286 Views
Avinash_7373
Contributor I

Hi @Joey_z,

The bitfield in Partition_2 status register remains 1 pre-sleep, it gets updated to 0 during sleep state and it is getting updated back to 1 post wakeup i.e, after the MCU mode is set to normal.

The Serdes is working fine. Additionally I have tried with EMAC2 in RGMII mode where SERDES is not involved in between the ETH Phy connector (RJ45) and the controller (NXPS32G399A) even in this case the issue remained the same.

If there is any restart sequence required for Partition_2 post wakeup, please let me know.

Regards,
Avinash V


0 Kudos
Reply
247 Views
Joey_z
NXP Employee
NXP Employee

Hi,Avinash_7373

Your problem is likely to be a PFE initialization issue after wakeup. Check the clock and the related PFE configuration, and ensure that it has been initialized to an ideal state.

1. Check that the PFE initialization is put into bootloader and properly reinitialized in the application after waking up.
2. Check the relevant configurations according to the Standby process. Refer to RM 32.5.5 "Run mode to Standby mode".

BR

Joey

0 Kudos
Reply
267 Views
Joey_z
NXP Employee
NXP Employee

Hi,Avinash_7373

Thank you for your reply.

Could you tell me about your operation of standby and wakeup sequence? 

1. How to you set the core and partition?

2.Do you use the bootloader and A core in your application?

BR

Joey

0 Kudos
Reply
261 Views
Avinash_7373
Contributor I

Hi @Joey_z,

Please find the sleep-wakeup sequence below:

1. I'm requesting ECU sleep mode using API "EcuM_SelectShutdownTarget()"  which in turns sets the MCU mode to standby as per the ECUM implementation.

2. Once the ECUM enters sleep mode it polls for a wakeup event, the CAN transceiver detects the bus activity and set the wakeup event using EcuM_SetWakeupEvent() API then the ECU resumes normal operation.

Regarding bootloader, we have the NXP bootloader (blob is flashed at 0x0) location of flash and the M-core application is flashed at location 0x400000.  A-core is not being used anywhere.

Regards,
Avinash V

0 Kudos
Reply
77 Views
Joey_z
NXP Employee
NXP Employee

Hi,Avinash_7373

Has there been any progress on your issue? If you need continued support, could you please upload your code to the following link so that we can better analyze the problem?

https://support.nxp.com

BR

Joey

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2409116%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EPFE%20EMAC0%20Invalid%20Buffer%20Access%20Post%20ECU%20wakeup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2409116%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3CBR%20%2F%3E%3CBR%20%2F%3EI%20have%20configured%20EMAC0%20at%202500%20MBPS%20with%20required%20SERDES%20channel%20configuration.%20The%20Eth%20communication%20is%20up%20and%20running%20during%20ECU%20run%20state.%26nbsp%3B%3C%2FP%3E%3CP%3EAfter%20shutting%20down%20the%20applications%20accessing%20Eth%20communication%2C%20I%20trigger%20the%20ECU%20sleep%20request%20from%20ECUM%20with%20sets%20the%20MCU%20mode%20to%20SOC%20standby%20with%20HSE_CM7%20selected%20as%20main%20core.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EPost%20wakeup%20the%20ECU%20resumes%20the%20normal%20operation%2C%20the%20layers%20COM%2C%20SOAD%2C%20TCPIP%2C%20ETHIF%20are%20working%20as%20expected%2C%20In%20the%20Eth%20if%20layer%20during%20the%20API%20invocation%20of%20%22Provide%20TX%20buffer%22%20returns%20an%20error%20stating%20TX%20buffers%20are%20not%20free%2C%20followed%20by%20no%20transmission%20of%20Eth%20frames%3CBR%20%2F%3E%3CBR%20%2F%3EList%20of%20fixes%20tried%20resolve%20the%20issue%3A%3CBR%20%2F%3E%3CBR%20%2F%3E1.%20Tried%20to%20Shutdown%20the%20PFE%20driver%20using%20%22Eth_43_Pfe_Deinit%22%20and%20starting%20the%20PFE%20driver%20by%20calling%20%22Eth_43_Pfe_Init%22%20but%20the%20CPU%20gets%20locked%20after%20the%20execution%20if%20Init%20API.%3CBR%20%2F%3E2.%20Tried%20to%20turndown%20the%20Eth%20controller%20using%20Eth_43_Pfe_SetController%20mode%20to%20down%20and%20bring%20it%20active%20by%20setting%20back%20the%20mode%20to%20%22Active%22%20which%20led%20to%20bus%20fault%3CBR%20%2F%3E%3CBR%20%2F%3EPlease%20let%20me%20know%20the%20potential%20fix%20for%20this%20issue.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EP.S%26gt%3B%3CBR%20%2F%3EConfigurator%20Used%3A%20EB%20tresos%3CBR%20%2F%3EEth%20PFE%20RTD%20version%3A%26nbsp%3B%201.3.0%26nbsp%3B%3CBR%20%2F%3ESDK%3A%20GOLDVIP%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2409499%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20PFE%20EMAC0%20Invalid%20Buffer%20Access%20Post%20ECU%20wakeup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2409499%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F236188%22%20target%3D%22_blank%22%3E%40Joey_z%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E1.%20The%20PFEs%20are%20only%20being%20used%20in%20M-core%3CBR%20%2F%3E2.%20I'm%20using%20the%20development%20board%3A%26nbsp%3B%3CSTRONG%3ES32G-VNP-RDB3%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3ERegards%2C%3CBR%20%2F%3EAvinash%20V%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2409446%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20PFE%20EMAC0%20Invalid%20Buffer%20Access%20Post%20ECU%20wakeup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2409446%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2CAvinash_7373%3C%2FP%3E%0A%3CP%3EThank%20you%20for%20contacting%20us.%3C%2FP%3E%0A%3CP%3E1.Are%20the%20PFEs%20only%20used%20in%20the%20M%20core%3F%20Have%20you%20used%20the%20A%20core%20together%3F%3C%2FP%3E%0A%3CP%3E2.Are%20you%20using%20your%20customer%20board%20or%20our%20development%20board%3F%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EJoey%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2409520%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20PFE%20EMAC0%20Invalid%20Buffer%20Access%20Post%20ECU%20wakeup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2409520%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2CAvinash_7373%3C%2FP%3E%0A%3CP%3EThank%20you%20for%20your%20reply.%3C%2FP%3E%0A%3CP%3E1.When%20the%20SOC%20entry%20the%20mode%20of%20standby%2C%20about%20the%20PFE%20clock%20of%20partition2%20will%20be%20disabled%2C%20you%20should%20check%20if%20you%20have%20reenabled%20the%20partition2%20after%20wakeup.%20You%20can%20try%20to%20check%20the%26nbsp%3B%20PRTN2_STAT.PCS%20state%20before%20the%26nbsp%3BPFE%20Init.%3C%2FP%3E%0A%3CP%3E2.%20Check%20the%20SERDES%20if%20it%20is%20a%20normal%20function.%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EJoey%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2410647%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20PFE%20EMAC0%20Invalid%20Buffer%20Access%20Post%20ECU%20wakeup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2410647%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F236188%22%20target%3D%22_blank%22%3E%40Joey_z%3C%2FA%3E%2C%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20bitfield%20in%20Partition_2%20status%20register%20remains%20%3CSTRONG%3E1%3C%2FSTRONG%3E%20pre-sleep%2C%20it%20gets%20updated%20to%20%3CSTRONG%3E0%3C%2FSTRONG%3E%20during%20sleep%20state%20and%20it%20is%20getting%20updated%20back%20to%20%3CSTRONG%3E1%3C%2FSTRONG%3E%20post%20wakeup%20i.e%2C%20after%20the%20MCU%20mode%20is%20set%20to%20normal.%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20Serdes%20is%20working%20fine.%20Additionally%20I%20have%20tried%20with%20EMAC2%20in%20RGMII%20mode%20where%20SERDES%20is%20not%20involved%20in%20between%20the%20ETH%20Phy%20connector%20(RJ45)%20and%20the%20controller%20(NXPS32G399A)%20even%20in%20this%20case%20the%20issue%20remained%20the%20same.%3CBR%20%2F%3E%3CBR%20%2F%3EIf%20there%20is%20any%20restart%20sequence%20required%20for%20Partition_2%20post%20wakeup%2C%20please%20let%20me%20know.%3CBR%20%2F%3E%3CBR%20%2F%3ERegards%2C%3CBR%20%2F%3EAvinash%20V%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2410759%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20PFE%20EMAC0%20Invalid%20Buffer%20Access%20Post%20ECU%20wakeup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2410759%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2CAvinash_7373%3C%2FP%3E%0A%3CP%3EThank%20you%20for%20your%20reply.%3C%2FP%3E%0A%3CP%3ECould%20you%20tell%20me%20about%20your%20operation%20of%20standby%20and%20wakeup%26nbsp%3Bsequence%3F%26nbsp%3B%3C%2FP%3E%0A%3CP%3E1.%20How%20to%20you%20set%20the%20core%20and%20partition%3F%3C%2FP%3E%0A%3CP%3E2.Do%20you%20use%20the%20bootloader%20and%20A%20core%20in%20your%20application%3F%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EJoey%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2410822%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20PFE%20EMAC0%20Invalid%20Buffer%20Access%20Post%20ECU%20wakeup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2410822%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F236188%22%20target%3D%22_blank%22%3E%40Joey_z%3C%2FA%3E%2C%3CBR%20%2F%3E%3CBR%20%2F%3EPlease%20find%20the%20sleep-wakeup%20sequence%20below%3A%3C%2FP%3E%3CP%3E1.%20I'm%20requesting%20ECU%20sleep%20mode%20using%20API%20%3CSTRONG%3E%22%3C%2FSTRONG%3E%3CSTRONG%3EEcuM_SelectShutdownTarget()%22%26nbsp%3B%3C%2FSTRONG%3E%20which%20in%20turns%20sets%20the%20MCU%20mode%20to%20standby%20as%20per%20the%20ECUM%20implementation.%3C%2FP%3E%3CP%3E2.%20Once%20the%20ECUM%20enters%20sleep%20mode%20it%20polls%20for%20a%20wakeup%20event%2C%20the%20CAN%20transceiver%20detects%20the%20bus%20activity%20and%20set%20the%20wakeup%20event%20using%26nbsp%3B%3CSTRONG%3EEcuM_SetWakeupEvent()%26nbsp%3B%3C%2FSTRONG%3EAPI%20then%20the%20ECU%20resumes%20normal%20operation.%3CBR%20%2F%3E%3CBR%20%2F%3ERegarding%20bootloader%2C%20we%20have%20the%20NXP%20bootloader%20(blob%20is%20flashed%20at%200x0)%20location%20of%20flash%20and%20the%20M-core%20application%20is%20flashed%20at%20location%200x400000.%26nbsp%3B%20A-core%20is%20not%20being%20used%20anywhere.%3CBR%20%2F%3E%3CBR%20%2F%3ERegards%2C%3CBR%20%2F%3EAvinash%20V%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2411009%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20PFE%20EMAC0%20Invalid%20Buffer%20Access%20Post%20ECU%20wakeup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2411009%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2CAvinash_7373%3C%2FP%3E%0A%3CP%3EYour%20problem%20is%20likely%20to%20be%20a%20PFE%20initialization%20issue%20after%20wakeup.%20Check%20the%20clock%20and%20the%20related%20PFE%20configuration%2C%20and%20ensure%20that%20it%20has%20been%20initialized%20to%20an%20ideal%20state.%3C%2FP%3E%0A%3CP%3E1.%20Check%20that%20the%20PFE%20initialization%20is%20put%20into%20bootloader%20and%20properly%20reinitialized%20in%20the%20application%20after%20waking%20up.%3CBR%20%2F%3E2.%20Check%20the%20relevant%20configurations%20according%20to%20the%20Standby%20process.%20Refer%20to%20RM%2032.5.5%20%22Run%20mode%20to%20Standby%20mode%22.%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EJoey%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2412714%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20PFE%20EMAC0%20Invalid%20Buffer%20Access%20Post%20ECU%20wakeup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2412714%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%EF%BC%8C%3CSPAN%3EAvinash_7373%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EHas%20there%20been%20any%20progress%20on%20your%20issue%3F%20If%20you%20need%20continued%20support%2C%20could%20you%20please%20upload%20your%20code%20to%20the%20following%20link%20so%20that%20we%20can%20better%20analyze%20the%20problem%3F%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fsupport.nxp.com%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsupport.nxp.com%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EJoey%3C%2FP%3E%3C%2FLINGO-BODY%3E