Debug multicore S32K358 with TRACE32

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

Debug multicore S32K358 with TRACE32

618 Views
TinNxp
Contributor I

Hi there,

Currently, I am trying to debug the S32K358 multicore system using Trace32. I have already launched both cores (CM7‑0 and CM7‑2) , but when core 2 start_Os, then change from unprivileged mode privileged mode by call svc #0, the program cannot run and not raise any fault as well (Current use GCC compiler)

Could you please help explain the reason for this behavior?

Thank you.

Tags (1)
0 Kudos
Reply
1 Reply

546 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @TinNxp,

There was a similar issue discussed in this thread: Re: FreeRTOS stuck at "svc 0" in function of prvPortStartFirstTask in debug mode - NXP Community.

Here is the solution:

"The root cause of the issue is that RTD and FreeRTOS are both using SVC for different needs.

FreeRTOS uses SVC 0 only to start the first task, and does not use it after

RTD use SVC to switch between privileged and user modes.

The first issue is they both implement an SVC Isr handler, and both use SVC 0.

The cleanest way to solve the issue is to merge the two SVC Isr handler into one that serves all SVC interrupts, and to change the FreeRTOS to use an SVC Id not used by RTD (RTD use SVC number 0 to 3).

The easiest work around can be to undefine MCAL_ENABLE_USER_MODE_SUPPORT. In this case, RTD do not use SVC anymore, but the whole software is run in privileged mode."

Maybe try this solution. 

If this still does not work, try doing a single-core project to rule out any multicore issues. 

Best regards,
Julián

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2328499%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EDebug%20multicore%20S32K358%20with%20TRACE32%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2328499%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20there%2C%3C%2FP%3E%3CDIV%3E%3CP%3ECurrently%2C%20I%20am%20trying%20to%20debug%20the%20S32K358%20multicore%20system%20using%20Trace32.%20I%20have%20already%20launched%20both%20cores%20(CM7%E2%80%910%20and%20CM7%E2%80%912)%20%2C%20but%20when%20core%202%20start_Os%2C%20then%20change%20from%20unprivileged%20mode%20privileged%20mode%20by%20call%20svc%20%230%2C%20the%20program%20cannot%20run%20and%20not%20raise%20any%20fault%20as%20well%20(Current%20use%20GCC%20compiler)%3C%2FP%3E%3CP%3ECould%20you%20please%20help%20explain%20the%20reason%20for%20this%20behavior%3F%3C%2FP%3E%3CP%3EThank%20you.%3C%2FP%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2329263%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Debug%20multicore%20S32K358%20with%20TRACE32%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2329263%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%2F256732%22%20target%3D%22_blank%22%3E%40TinNxp%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EThere%20was%20a%20similar%20issue%20discussed%20in%20this%20thread%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K%2FFreeRTOS-stuck-at-quot-svc-0-quot-in-function-of%2Fm-p%2F1641853%22%20target%3D%22_blank%22%3ERe%3A%20FreeRTOS%20stuck%20at%20%22svc%200%22%20in%20function%20of%20prvPortStartFirstTask%20in%20debug%20mode%20-%20NXP%20Community%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3EHere%20is%20the%20solution%3A%3C%2FP%3E%0A%3CP%3E%22The%20root%20cause%20of%20the%20issue%20is%20that%20RTD%20and%20FreeRTOS%20are%20both%20using%20SVC%20for%20different%20needs.%3C%2FP%3E%0A%3CP%3EFreeRTOS%20uses%20SVC%200%20only%20to%20start%20the%20first%20task%2C%20and%20does%20not%20use%20it%20after%3C%2FP%3E%0A%3CP%3ERTD%20use%20SVC%20to%20switch%20between%20privileged%20and%20user%20modes.%3C%2FP%3E%0A%3CP%3EThe%20first%20issue%20is%20they%20both%20implement%20an%20SVC%20Isr%20handler%2C%20and%20both%20use%20SVC%200.%3C%2FP%3E%0A%3CP%3EThe%20cleanest%20way%20to%20solve%20the%20issue%20is%20to%20merge%20the%20two%20SVC%20Isr%20handler%20into%20one%20that%20serves%20all%20SVC%20interrupts%2C%20and%20to%20change%20the%20FreeRTOS%20to%20use%20an%20SVC%20Id%20not%20used%20by%20RTD%20(RTD%20use%20SVC%20number%200%20to%203).%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3EThe%20easiest%20work%20around%20can%20be%20to%20undefine%26nbsp%3B%3CSPAN%3EMCAL_ENABLE_USER_MODE_SUPPORT.%20In%20this%20case%2C%20RTD%20do%20not%20use%20SVC%20anymore%2C%20but%20the%20whole%20software%20is%20run%20in%20privileged%20mode.%3C%2FSPAN%3E%22%3C%2FP%3E%0A%3CP%3EMaybe%20try%20this%20solution.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20this%20still%20does%20not%20work%2C%20try%20doing%20a%20single-core%20project%20to%20rule%20out%20any%20multicore%20issues.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3CBR%20%2F%3EJuli%C3%A1n%3C%2FP%3E%3C%2FLINGO-BODY%3E