S32K358 Multicore share memory

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

S32K358 Multicore share memory

1,702 Views
nirmal_masilamani
Contributor IV

Hi,

I am currently working with s32k358 multicore, i am trying use shareble memory for IPC.

nirmal_masilamani_0-1771509939378.png

i am trying use core0status and core1status variable for IPC data sharing.

but both variable declared in same memory, so each core overwriting the value.

Address of core0status and core1status, interchanged in each core. 

What i am missing here? Please find the attached code.

0 Kudos
Reply
7 Replies

1,669 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @nirmal_masilamani,

Shared variables are initialized only once by CM7_0 (boot core), not by CM7_1 (secondary core). Core0 will do the data copying from ROM to RAM for shared global variable with init values, while Core1 will ignore data copying and just use them in code.

Linker files between Core0 & Core1 should look something like so:

Julin_AragnM_1-1771523678498.png

I've sent you a private message with some materials for S32K3 Dual Core and Memory Sharing between cores.

Best regards,
Julián

0 Kudos
Reply

1,608 Views
nirmal_masilamani
Contributor IV

Hello @Julián_AragónM ,

Thank you for your reply.

Shared memory issue, resolved by following the document, but i want to configure sema42 driver, how can do i that?

Could you please provide some document for that.? i am using s32ds v3.5 RTD 4.0.0

0 Kudos
Reply

1,584 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @nirmal_masilamani,

There is also a training presentation:  S32K3 RTD XRDC, SEMA42, MPU, XBIC and INTM Training Presentation. However, it is under secure files for the S32K3. If you do not have access, you may need to upload an active NDA and request it. Please refer to Secure Access Rights FAQs | NXP Semiconductors.

Publicly, there are these two application notes: 

While the modules are very similar, there are some differences between S32G and S32K devices, so please read the application note carefully.

Best regards,
Julián

0 Kudos
Reply

1,571 Views
nirmal_masilamani
Contributor IV

Hi @Julián_AragónM ,

Thank you for the reply.

I have NDA signed acc, but still unable to access the secure file.

Another, i have referred share memory program for S32K324 , but in my program 

#define CORE_DOMAIN_ID (IP_XRDC->HWCFG1) always show 0 in both core.

What am i missing here?

0 Kudos
Reply

1,562 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @nirmal_masilamani,

XRDC should be properly initialized to assign DID=0 for CM7_0 and DID=1 for CM7_1. Please check the XRDC Domain Assignment. You can refer to the RTD example: 

 

XRDC_Config.png

As for the secure file, you need to request access to it. Please refer to the FAQ I've previously shared.

Best regards,
Julián

0 Kudos
Reply

1,435 Views
nirmal_masilamani
Contributor IV

Hello @Julián_AragónM ,

I followed same example, still both core return 0 as domain ID.

do i need to init sema in core 2 also?

0 Kudos
Reply

1,360 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @nirmal_masilamani,

No. Most likely XRDC is not set correctly. By default, both CM7_0 and CM7_1 have DID = 0. I've sent you a private message regarding XRDC configuration.

Best regards,
Julián

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2320276%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K358%20Multicore%20share%20memory%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2320276%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI%20am%20currently%20working%20with%20s32k358%20multicore%2C%20i%20am%20trying%20use%20shareble%20memory%20for%20IPC.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22nirmal_masilamani_0-1771509939378.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22nirmal_masilamani_0-1771509939378.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22nirmal_masilamani_0-1771509939378.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22nirmal_masilamani_0-1771509939378.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F377283iC0927D6FBBD0A142%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22nirmal_masilamani_0-1771509939378.png%22%20alt%3D%22nirmal_masilamani_0-1771509939378.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3Ei%20am%20trying%20use%20core0status%20and%20core1status%20variable%20for%20IPC%20data%20sharing.%3C%2FP%3E%3CP%3Ebut%20both%20variable%20declared%20in%20same%20memory%2C%20so%20each%20core%20overwriting%20the%20value.%3C%2FP%3E%3CP%3EAddress%20of%26nbsp%3Bcore0status%20and%20core1status%2C%20interchanged%20in%20each%20core.%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20i%20am%20missing%20here%3F%20Please%20find%20the%20attached%20code.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2322615%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K358%20Multicore%20share%20memory%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2322615%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%2F233316%22%20target%3D%22_blank%22%3E%40nirmal_masilamani%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EXRDC%20should%20be%20properly%20initialized%20to%20assign%20DID%3D0%20for%20CM7_0%20and%20DID%3D1%20for%20CM7_1.%20Please%20check%20the%20XRDC%20Domain%20Assignment.%20You%20can%20refer%20to%20the%20RTD%20example%3A%26nbsp%3B%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorJulin_AragnM_1%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22XRDC_Config.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22XRDC_Config.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22XRDC_Config.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22XRDC_Config.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F377792i5B90377797781C9D%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22XRDC_Config.png%22%20alt%3D%22XRDC_Config.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EAs%20for%20the%20secure%20file%2C%20you%20need%20to%20request%20access%20to%20it.%20Please%20refer%20to%20the%20FAQ%20I've%20previously%20shared.%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3CBR%20%2F%3EJuli%C3%A1n%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2322260%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K358%20Multicore%20share%20memory%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2322260%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%2F200831%22%20target%3D%22_blank%22%3E%40Juli%C3%A1n_Arag%C3%B3nM%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3EThank%20you%20for%20the%20reply.%3C%2FP%3E%3CP%3EI%20have%20NDA%20signed%20acc%2C%20but%20still%20unable%20to%20access%20the%20secure%20file.%3C%2FP%3E%3CP%3EAnother%2C%20i%20have%20referred%20share%20memory%20program%20for%20S32K324%20%2C%20but%20in%20my%20program%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3E%23define%20CORE_DOMAIN_ID%20(IP_XRDC-%26gt%3BHWCFG1)%3C%2FSTRONG%3E%20always%20show%20%3CSTRONG%3E0%3C%2FSTRONG%3E%20in%20both%20core.%3C%2FP%3E%3CP%3EWhat%20am%20i%20missing%20here%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2322052%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K358%20Multicore%20share%20memory%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2322052%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F233316%22%20target%3D%22_blank%22%3E%40nirmal_masilamani%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EThere%20is%20also%20a%20training%20presentation%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fwebapp%2FDownload%3FcolCode%3DS32K3_RTD_TRAINING_XRDC_SEMA42_MPU_XBIC_INTM%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%20target%3D%22_blank%22%3E%20S32K3%20RTD%20XRDC%2C%20SEMA42%2C%20MPU%2C%20XBIC%20and%20INTM%20Training%20Presentation.%3C%2FA%3E%26nbsp%3BHowever%2C%20it%20is%20under%20secure%20files%20for%20the%20S32K3.%20If%20you%20do%20not%20have%20access%2C%20you%20may%20need%20to%20upload%20an%20active%20NDA%20and%20request%20it.%20Please%20refer%20to%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fsupport%2Fsupport%2Fsecure-access-rights%2Fsecure-access-rights-faqs%3ASEC-ACCESS-FAQS%3F_gl%3D1*7sg57q*_ga*MTk2NTc1MDEzOS4xNzcxODYwMDk4*_ga_WM5LE0KMSH*czE3NzE4NjAwOTgkbzEkZzEkdDE3NzE4NjE3MDAkajIxJGwwJGgxMTc3NDYwMA..%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%20target%3D%22_blank%22%3ESecure%20Access%20Rights%20FAQs%20%7C%20NXP%20Semiconductors%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3EPublicly%2C%20there%20are%20these%20two%20application%20notes%3A%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fwebapp%2FDownload%3FcolCode%3DAN13024%26amp%3B_gl%3D1*1yrwl3*_ga*MTM5NzgzMTc3My4xNzcxODYyMjY5*_ga_WM5LE0KMSH*czE3NzE5NDYzMDAkbzQkZzEkdDE3NzE5NDg4MjEkajM1JGwwJGg2NTI1NTk4Mjg.%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EAN13024%3A%20S32G2%20Extended%20Resource%20Domain%20Controller%20(XRDC)%20Application%20Note.%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.nxp.com%2Fbundle%2FAN14715%2Fpage%2Ftopics%2Foverview.html%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EAN14715%3A%20S32K3XX%20Hardware%20Resource%20Isolation%20and%20Protection%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EWhile%20the%20modules%20are%20very%20similar%2C%20there%20are%20some%20differences%20between%20S32G%20and%20S32K%20devices%2C%20so%20please%20read%20the%20application%20note%20carefully.%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3CBR%20%2F%3EJuli%C3%A1n%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2321669%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K358%20Multicore%20share%20memory%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2321669%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F200831%22%20target%3D%22_blank%22%3E%40Juli%C3%A1n_Arag%C3%B3nM%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3EThank%20you%20for%20your%20reply.%3C%2FP%3E%3CP%3EShared%20memory%20issue%2C%20resolved%20by%20following%20the%20document%2C%20but%20i%20want%20to%20configure%20sema42%20driver%2C%20how%20can%20do%20i%20that%3F%3C%2FP%3E%3CP%3ECould%20you%20please%20provide%20some%20document%20for%20that.%3F%20i%20am%20using%20s32ds%20v3.5%20RTD%204.0.0%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2320377%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K358%20Multicore%20share%20memory%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2320377%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%2F233316%22%20target%3D%22_blank%22%3E%40nirmal_masilamani%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EShared%20variables%20are%20initialized%20only%20once%20by%20CM7_0%20(boot%20core)%2C%20not%20by%20CM7_1%20(secondary%20core).%20Core0%20will%20do%20the%20data%20copying%20from%20ROM%20to%20RAM%20for%20shared%20global%20variable%20with%20init%20values%2C%20while%20Core1%20will%20ignore%20data%20copying%20and%20just%20use%20them%20in%20code.%3C%2FP%3E%0A%3CP%3ELinker%20files%20between%20Core0%20%26amp%3B%20Core1%20should%20look%20something%20like%20so%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Julin_AragnM_1-1771523678498.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Julin_AragnM_1-1771523678498.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Julin_AragnM_1-1771523678498.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Julin_AragnM_1-1771523678498.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F377295iE79022A06D23E9C4%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Julin_AragnM_1-1771523678498.png%22%20alt%3D%22Julin_AragnM_1-1771523678498.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EI've%20sent%20you%20a%20private%20message%20with%20some%20materials%20for%20S32K3%20Dual%20Core%20and%20Memory%20Sharing%20between%20cores.%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3CBR%20%2F%3EJuli%C3%A1n%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2324856%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K358%20Multicore%20share%20memory%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2324856%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F200831%22%20target%3D%22_blank%22%3E%40Juli%C3%A1n_Arag%C3%B3nM%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3EI%20followed%20same%20example%2C%20still%20both%20core%20return%200%20as%20domain%20ID.%3C%2FP%3E%3CP%3Edo%20i%20need%20to%20init%20sema%20in%20core%202%20also%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2325794%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K358%20Multicore%20share%20memory%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2325794%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%2F233316%22%20target%3D%22_blank%22%3E%40nirmal_masilamani%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3ENo.%20Most%20likely%20XRDC%20is%20not%20set%20correctly.%20By%20default%2C%20both%20CM7_0%20and%20CM7_1%20have%20DID%20%3D%200.%20I've%20sent%20you%20a%20private%20message%20regarding%20XRDC%20configuration.%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3CBR%20%2F%3EJuli%C3%A1n%3C%2FP%3E%3C%2FLINGO-BODY%3E