Example S32K312 placing variables in DCTM & code in ICTM DS3.5 RTD300

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

Example S32K312 placing variables in DCTM & code in ICTM DS3.5 RTD300

Example S32K312 placing variables in DCTM & code in ICTM DS3.5 RTD300

*******************************************************************************

The purpose of this demo application is to place variables in DTCM memory for the S32K3xx MCU.

 ------------------------------------------------------------------------------
* Test HW: S32K3X4EVB-Q172
* MCU: S32K312
* Compiler: S32DS3.5
* SDK release: RTD 3.0.0
* Debugger: PE Micro
* Target: internal_FLASH
********************************************************************************

ZERO table : is for bss segment variables :  contains RAM start & end address of BSS section which need to be initialized with ZER).

Init_table : is for DATA segment variables : contains RAM start address of DATA section & START & end address of ROM address where the initialization values of the variables are stored.

 

Startup file startup_cm7.s call function init_data_bss() . Inside this function uses these section :--

Dinesh_Guleria_0-1705479264979.png


Variables declared :--

Dinesh_Guleria_1-1705479293837.png


Linker file changes :--

Dinesh_Guleria_3-1705486935533.png

 

Dinesh_Guleria_2-1705479316994.png


startup_cm7.s file changes :--

Dinesh_Guleria_3-1705479347509.png
Dinesh_Guleria_4-1705487006718.png

 



MAP file :--

Dinesh_Guleria_4-1705479364855.png

 

Dinesh_Guleria_0-1705486825279.png

 



Debug window results :--

Dinesh_Guleria_5-1705479384543.png

 

Dinesh_Guleria_6-1705479395572.png

 

Dinesh_Guleria_1-1705486885096.pngDinesh_Guleria_2-1705486897441.png

 

 

https://www.kernel.org/doc/html/v5.9/arm/tcm.html

 

Due to being embedded inside the CPU, the TCM has a Harvard-architecture, so there is an ITCM (instruction TCM) and a DTCM (data TCM). 

The DTCM can not contain any instructions, but the ITCM can actually contain data.

 

TCM is used for a few things:

  • FIQ and other interrupt handlers that need deterministic timing and cannot wait for cache misses.
  • Idle loops where all external RAM is set to self-refresh retention mode, so only on-chip RAM is accessible by the CPU and then we hang inside ITCM waiting for an interrupt.
  • Other operations which implies shutting off or reconfiguring the external RAM controller.

 

Attachments
%3CLINGO-SUB%20id%3D%22lingo-sub-1790101%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EExample%20S32K312%20placing%20variables%20in%20%20DCTM%20%26amp%3B%20code%20in%20ICTM%20DS3.5%20RTD300%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1790101%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%0A%3CDIV%20class%3D%22lia-message-template-content-zone%22%3E%0A%3CP%3E%3CSPAN%3E*******************************************************************************%3CBR%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3EThe%20purpose%20of%20this%20demo%20application%20is%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Eto%20place%20variables%20in%20DTCM%20memory%20for%20the%20S32K3xx%20MCU.%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%26nbsp%3B------------------------------------------------------------------------------%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E*%20Test%20HW%3A%20S32K3X4EVB-Q172%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E*%20MCU%3A%20S32K312%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E*%20Compiler%3A%20S32DS3.5%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E*%20SDK%20release%3A%20RTD%203.0.0%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E*%20Debugger%3A%20PE%20Micro%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E*%20Target%3A%20internal_FLASH%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E********************************************************************************%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EZERO%20table%3C%2FSTRONG%3E%20%3A%20is%20for%20bss%20segment%20variables%20%3A%20%26nbsp%3Bcontains%20RAM%20start%20%26amp%3B%20end%20address%20of%20BSS%20section%20which%20need%20to%20be%20initialized%20with%20ZER).%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EInit_table%3C%2FSTRONG%3E%20%3A%20is%20for%20DATA%20segment%20variables%20%3A%20contains%20RAM%20start%20address%20of%20DATA%20section%20%26amp%3B%20START%20%26amp%3B%20end%20address%20of%20ROM%20address%20where%20the%20initialization%20values%20of%20the%20variables%20are%20stored.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EStartup%20file%20startup_cm7.s%20call%20function%20init_data_bss()%20.%20Inside%20this%20function%20uses%20these%20section%20%3A--%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Dinesh_Guleria_0-1705479264979.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Dinesh_Guleria_0-1705479264979.png%22%20style%3D%22width%3A%20240px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F258544i0DA8C7118000A9E1%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_0-1705479264979.png%22%20alt%3D%22Dinesh_Guleria_0-1705479264979.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CP%3E%3CBR%20%2F%3EVariables%20declared%20%3A--%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Dinesh_Guleria_1-1705479293837.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Dinesh_Guleria_1-1705479293837.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F258545iEDE1E6AD3D44F9EB%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_1-1705479293837.png%22%20alt%3D%22Dinesh_Guleria_1-1705479293837.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CP%3E%3CBR%20%2F%3ELinker%20file%20changes%20%3A--%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Dinesh_Guleria_3-1705486935533.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Dinesh_Guleria_3-1705486935533.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F258581iB30CB96E50B812AF%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_3-1705486935533.png%22%20alt%3D%22Dinesh_Guleria_3-1705486935533.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Dinesh_Guleria_2-1705479316994.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Dinesh_Guleria_2-1705479316994.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F258546i2B7BC48F6FE119EC%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_2-1705479316994.png%22%20alt%3D%22Dinesh_Guleria_2-1705479316994.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CP%3E%3CBR%20%2F%3Estartup_cm7.s%20file%20changes%20%3A--%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Dinesh_Guleria_3-1705479347509.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Dinesh_Guleria_3-1705479347509.png%22%20style%3D%22width%3A%20386px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F258547iCCFEE610007F9CBB%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_3-1705479347509.png%22%20alt%3D%22Dinesh_Guleria_3-1705479347509.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Dinesh_Guleria_4-1705487006718.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Dinesh_Guleria_4-1705487006718.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F258582i1F21CC9224A00F10%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_4-1705487006718.png%22%20alt%3D%22Dinesh_Guleria_4-1705487006718.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3EMAP%20file%20%3A--%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Dinesh_Guleria_4-1705479364855.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Dinesh_Guleria_4-1705479364855.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F258548i67F73EDFF7061202%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_4-1705479364855.png%22%20alt%3D%22Dinesh_Guleria_4-1705479364855.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Dinesh_Guleria_0-1705486825279.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Dinesh_Guleria_0-1705486825279.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F258578iE069679B11916F90%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_0-1705486825279.png%22%20alt%3D%22Dinesh_Guleria_0-1705486825279.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3EDebug%20window%20results%20%3A--%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Dinesh_Guleria_5-1705479384543.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Dinesh_Guleria_5-1705479384543.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F258549i55BDEC71E5E9063D%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_5-1705479384543.png%22%20alt%3D%22Dinesh_Guleria_5-1705479384543.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Dinesh_Guleria_6-1705479395572.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Dinesh_Guleria_6-1705479395572.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F258550i218A9B0690F90A4D%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_6-1705479395572.png%22%20alt%3D%22Dinesh_Guleria_6-1705479395572.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Dinesh_Guleria_1-1705486885096.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Dinesh_Guleria_1-1705486885096.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F258579iC9F61519C311A596%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_1-1705486885096.png%22%20alt%3D%22Dinesh_Guleria_1-1705486885096.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Dinesh_Guleria_2-1705486897441.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Dinesh_Guleria_2-1705486897441.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F258580iB55EE6D78471E623%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_2-1705486897441.png%22%20alt%3D%22Dinesh_Guleria_2-1705486897441.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CA%20class%3D%22fui-Link%20___1rxvrpe%20f2hkw1w%20f3rmtva%20f1ewtqcl%20fyind8e%20f1k6fduh%20f1w7gpdv%20fk6fouc%20fjoy568%20figsok6%20f1hu3pq6%20f11qmguv%20f19f4twv%20f1tyq0we%20f1g0x7ka%20fhxju0i%20f1qch9an%20f1cnd47f%20fqv5qza%20f1vmzxwi%20f1o700av%20f13mvf36%20f1cmlufx%20f9n3di6%20f1ids18y%20f1tx3yz7%20f1deo86v%20f1eh06m1%20f1iescvh%20fhgqx19%20f1olyrje%20f1p93eir%20f1nev41a%20f1h8hb77%20f1lqvz6u%20f10aw75t%20fsle3fq%20f17ae5zn%22%20title%3D%22https%3A%2F%2Fwww.kernel.org%2Fdoc%2Fhtml%2Fv5.9%2Farm%2Ftcm.html%22%20href%3D%22https%3A%2F%2Fwww.kernel.org%2Fdoc%2Fhtml%2Fv5.9%2Farm%2Ftcm.html%22%20target%3D%22_blank%22%20rel%3D%22noreferrer%20noopener%20nofollow%22%20aria-label%3D%22Link%20https%3A%2F%2Fwww.kernel.org%2Fdoc%2Fhtml%2Fv5.9%2Farm%2Ftcm.html%22%3Ehttps%3A%2F%2Fwww.kernel.org%2Fdoc%2Fhtml%2Fv5.9%2Farm%2Ftcm.html%3C%2FA%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSPAN%3EDue%20to%20being%20embedded%20inside%20the%20CPU%2C%20the%20TCM%20has%20a%20Harvard-architecture%2C%20so%20there%20is%20an%20ITCM%20(instruction%20TCM)%20and%20a%20DTCM%20(data%20TCM).%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThe%20DTCM%20can%20not%20contain%20any%20instructions%2C%20but%20the%20ITCM%20can%20actually%20contain%20data.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ETCM%20is%20used%20for%20a%20few%20things%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EFIQ%20and%20other%20interrupt%20handlers%20that%20need%20deterministic%20timing%20and%20cannot%20wait%20for%20cache%20misses.%3C%2FLI%3E%0A%3CLI%3EIdle%20loops%20where%20all%20external%20RAM%20is%20set%20to%20self-refresh%20retention%20mode%2C%20so%20only%20on-chip%20RAM%20is%20accessible%20by%20the%20CPU%20and%20then%20we%20hang%20inside%20ITCM%20waiting%20for%20an%20interrupt.%3C%2FLI%3E%0A%3CLI%3EOther%20operations%20which%20implies%20shutting%20off%20or%20reconfiguring%20the%20external%20RAM%20controller.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CLI-WRAPPER%3E%3C%2FLI-WRAPPER%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FDIV%3E%0A%3C%2FLINGO-BODY%3E
100% helpful (1/1)
Version history
Last update:
‎01-17-2024 03:46 AM
Updated by: