Linker definition file clarification

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

Linker definition file clarification

999 Views
biju_nair
Contributor III

Hi,

We are using a platform which has S32K314 controller. The datasheet of this part says that this has 512KB of total RAM. But the following is the linker definition file that i am using. What i see is, i am not able to allocate more than 185 KB of memory in my code (Both BSS and Datasegment combined). Can someone help me on how to utilize the full 512KB of memory in this system ?

 

The following is my linker description contents.

 

MEMORY
{
int_flash : ORIGIN = 0x00400000, LENGTH = 0x003D4000 /* 4096K - 176K (sBAF + HSE)*/
int_itcm : ORIGIN = 0x00000000, LENGTH = 0x00008000 /* 32K */
int_dtcm : ORIGIN = 0x20000000, LENGTH = 0x00010000 /* 64K */
int_sram : ORIGIN = 0x20400000, LENGTH = 0x0002DF00 /* 183.9K */
int_sram_fls_rsv : ORIGIN = 0x2042DF00, LENGTH = 0x00000100 /* 0.1K */
int_sram_stack_c0 : ORIGIN = 0x2042E000, LENGTH = 0x00001000 /* 4KB */
int_sram_stack_c1 : ORIGIN = 0x2042F000, LENGTH = 0x00001000 /* 4KB */
int_sram_no_cacheable : ORIGIN = 0x20430000, LENGTH = 0x0000FF00 /* 64KB, needs to include int_results */
int_sram_results : ORIGIN = 0x2043FF00, LENGTH = 0x00000100
int_sram_shareable : ORIGIN = 0x20440000, LENGTH = 0x00004000 /* 16KB */
ram_rsvd2 : ORIGIN = 0x20444000, LENGTH = 0 /* End of SRAM */
}

 

Regards, Biju

0 Kudos
Reply
2 Replies

840 Views
biju_nair
Contributor III

Hi Daniel,

As S32K314 does not have a second core, can i still access DTCM_1 via backdoor ? What i meant is, even without the second core, will i still be able to utilize the DTCM_1 memory ? If so, what linker script change do i need and how can i allocate variables into that ? For DTCM_0, i use the following attribute to access it.

__attribute__ ((section(".dtcm0_data")))

Regards, Biju

0 Kudos
Reply

984 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Biju,

As you can see in the memory map (attached to the RM), there is

  • direct access to ITCM_0 (32KB) + DTCM_0 (64KB) + SRAM0 (160KB) + SRAM1 (160KB) = 416KB,
  • backdoor access to ITCM_1 (32KB) + DTCM_1 (64KB) = 96KB

You can extend or add regions in the linker file based on the addresses below.

danielmartynek_0-1681464638072.png

 

Regards,

Daniel

 

 

 

0 Kudos
Reply