About the linker script used in the SDK demo

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

About the linker script used in the SDK demo

187 Views
mttcp
Contributor I

SDK:SDK_2_15_000_MIMX8ML8xxxKZ

\boards\evkmimx8mp\demo_apps\hello_world\armgcc\MIMX8ML8xxxxx_cm7_ram.ld

Why is .data : AT(__DATA_ROM) done?
Do I need to put it in the m_data and m_text area?

Because of this, the .bss, .heap, and .stack sections are also placed in m_data and m_text, but they are not subject to the m_text overflowed check.

0 Kudos
Reply
4 Replies

154 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi
You do need to place the .data segment in the m_data area, because this represents the area of storage in RAM where the program needs to read and write data when it runs. The .text segment is usually placed in the m_text area because the .text segment contains code and read-only data, which usually doesn't change while the program is running.

Best Regards
Zhiming

0 Kudos
Reply

145 Views
mttcp
Contributor I

Hi

I understand that the .data segment needs to be placed in the m_data area.
I don't understand the need to place the .data segment in the m_text area.

When I check the area, I see that in M7, m_text is ITCM and m_data is DTCM, both are recognized as RAM.

MEMORY
{
m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000400
m_text (RX) : ORIGIN = 0x00000400, LENGTH = 0x0001FC00
m_data (RW) : ORIGIN = 0x20000000, LENGTH = 0x00020000
m_data2 (RW) : ORIGIN = 0x80000000, LENGTH = 0x01000000
}

Best Regards

0 Kudos
Reply

137 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @mttcp 

The .data segment is placed in the m_data area because it needs to be read and written to frequently at runtime and DTCM is designed for this need. The m_text (ITCM) is mainly used to store read-only instructions and data to take full advantage of its fast access. This allocation of memory maximizes the efficiency and performance of the program.

Best Regards
Zhiming

0 Kudos
Reply

128 Views
mttcp
Contributor I

Hi

I understand about the .data segment area.

Is the same idea used for the .bss, .heap, and .stack segments to be placed in the m_text and m_data areas?

Best Regards

0 Kudos
Reply