<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>i.MX Processorsのトピックi.MX8M Nano Memory Map</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8M-Nano-Memory-Map/m-p/1355049#M181491</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I am currently developing a firmware on the Cortex-M7 of the i.MX8M Nano (MIMX8MN4CVTIZ) based on an example using RPmsg-lite, remoteproc, FreeRTOS and CMSIS-DSP.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try to build using the linker file&amp;nbsp;MIMX8MN4xxxxx_cm7_ram.ld provided by the MCUXpresso SDK with the following configuration :&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/* Specify the memory areas */&lt;BR /&gt;MEMORY&lt;BR /&gt;{&lt;BR /&gt;  m_interrupts          (RX)  : ORIGIN = 0x00000000, LENGTH = 0x00000240&lt;BR /&gt;  m_text                (RX)  : ORIGIN = 0x00000240, LENGTH = 0x0001FDC0&lt;BR /&gt;  m_data                (RW)  : ORIGIN = 0x20000000, LENGTH = 0x00020000&lt;BR /&gt;  m_data2               (RW)  : ORIGIN = 0x80000000, LENGTH = 0x01000000&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which would apparently start at the ITCM of the system according to the declared memory map :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ycx_0-1634133066303.png" style="width: 563px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/159006iC064992180804C3D/image-dimensions/563x134?v=v2" width="563" height="134" role="button" title="ycx_0-1634133066303.png" alt="ycx_0-1634133066303.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When I build the text section is quite big (mostly due to CMSIS-DSP) :&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Memory region         Used Size  Region Size  %age Used
    m_interrupts:         576 B        576 B    100.00%
          m_text:      123704 B     130496 B     94.80%
          m_data:       61032 B       128 KB     46.56%
         m_data2:          0 GB        16 MB      0.00%&lt;/LI-CODE&gt;&lt;P&gt;And when I run it I get this error :&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;[ 82.135828] imx-rproc imx8mn-cm7: Translation failed: da = 0x1e578 len = 0xee68&lt;BR /&gt;[ 82.143174] remoteproc remoteproc0: bad phdr da 0x1e578 mem 0xee68&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;In the output.map I see the address in error corresponds to __DATA_ROM, the end of the text section :&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;                0x000000000001e578                __etext = .
                0x000000000001e578                __DATA_ROM = .

.data           0x0000000020000000       0x98 load address 0x000000000001e578
                0x0000000020000000                . = ALIGN (0x4)
                0x0000000020000000                __DATA_RAM = .
                0x0000000020000000                __data_start__ = .
 *(.data)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is regarding the section declaration of the same linker file (complete file attached) :&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;   /* The program code and other data goes into internal RAM */&lt;BR /&gt; .text :&lt;BR /&gt; {&lt;BR /&gt;   . = ALIGN(4);&lt;BR /&gt;   *(.text)                 /* .text sections (code) */&lt;BR /&gt;   *(.text*)                /* .text* sections (code) */&lt;BR /&gt;   *(.rodata)               /* .rodata sections (constants, strings, etc.) */&lt;BR /&gt;   *(.rodata*)              /* .rodata* sections (constants, strings, etc.) */&lt;BR /&gt;   *(.glue_7)               /* glue arm to thumb code */&lt;BR /&gt;   *(.glue_7t)              /* glue thumb to arm code */&lt;BR /&gt;   *(.eh_frame)&lt;BR /&gt;   KEEP (*(.init))&lt;BR /&gt;   KEEP (*(.fini))&lt;BR /&gt;   . = ALIGN(4);&lt;BR /&gt; } &amp;gt; m_text&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt; __etext = .;    /* define a global symbol at end of code */&lt;BR /&gt; __DATA_ROM = .; /* Symbol is used by startup for data initialization */&lt;BR /&gt;&lt;BR /&gt; .data : AT(__DATA_ROM)&lt;BR /&gt; {&lt;BR /&gt;   . = ALIGN(4);&lt;BR /&gt;   __DATA_RAM = .;&lt;BR /&gt;   __data_start__ = .;      /* create a global symbol at data start */&lt;BR /&gt;   *(.data)                 /* .data sections */&lt;BR /&gt;   *(.data*)                /* .data* sections */&lt;BR /&gt;   KEEP(*(.jcr*))&lt;BR /&gt;   . = ALIGN(4);&lt;BR /&gt;   __data_end__ = .;        /* define a global symbol at data end */&lt;BR /&gt; } &amp;gt; m_data&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does ".data : AT(__DATA_ROM)" mean that the .data section starts at the end of the .text section ? Why is that and therefore what is the point declaring the start address of m_data in MEMORY {} ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I understand correctly this would mean that .data section could overflow the ITCM range, especially when .text is close to its maximum size like my fw. What am I or the linker doing wrong ?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks a lot your help!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Oct 2021 14:09:22 GMT</pubDate>
    <dc:creator>ycx</dc:creator>
    <dc:date>2021-10-13T14:09:22Z</dc:date>
    <item>
      <title>i.MX8M Nano Memory Map</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8M-Nano-Memory-Map/m-p/1355049#M181491</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I am currently developing a firmware on the Cortex-M7 of the i.MX8M Nano (MIMX8MN4CVTIZ) based on an example using RPmsg-lite, remoteproc, FreeRTOS and CMSIS-DSP.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try to build using the linker file&amp;nbsp;MIMX8MN4xxxxx_cm7_ram.ld provided by the MCUXpresso SDK with the following configuration :&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/* Specify the memory areas */&lt;BR /&gt;MEMORY&lt;BR /&gt;{&lt;BR /&gt;  m_interrupts          (RX)  : ORIGIN = 0x00000000, LENGTH = 0x00000240&lt;BR /&gt;  m_text                (RX)  : ORIGIN = 0x00000240, LENGTH = 0x0001FDC0&lt;BR /&gt;  m_data                (RW)  : ORIGIN = 0x20000000, LENGTH = 0x00020000&lt;BR /&gt;  m_data2               (RW)  : ORIGIN = 0x80000000, LENGTH = 0x01000000&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which would apparently start at the ITCM of the system according to the declared memory map :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ycx_0-1634133066303.png" style="width: 563px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/159006iC064992180804C3D/image-dimensions/563x134?v=v2" width="563" height="134" role="button" title="ycx_0-1634133066303.png" alt="ycx_0-1634133066303.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When I build the text section is quite big (mostly due to CMSIS-DSP) :&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Memory region         Used Size  Region Size  %age Used
    m_interrupts:         576 B        576 B    100.00%
          m_text:      123704 B     130496 B     94.80%
          m_data:       61032 B       128 KB     46.56%
         m_data2:          0 GB        16 MB      0.00%&lt;/LI-CODE&gt;&lt;P&gt;And when I run it I get this error :&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;[ 82.135828] imx-rproc imx8mn-cm7: Translation failed: da = 0x1e578 len = 0xee68&lt;BR /&gt;[ 82.143174] remoteproc remoteproc0: bad phdr da 0x1e578 mem 0xee68&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;In the output.map I see the address in error corresponds to __DATA_ROM, the end of the text section :&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;                0x000000000001e578                __etext = .
                0x000000000001e578                __DATA_ROM = .

.data           0x0000000020000000       0x98 load address 0x000000000001e578
                0x0000000020000000                . = ALIGN (0x4)
                0x0000000020000000                __DATA_RAM = .
                0x0000000020000000                __data_start__ = .
 *(.data)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is regarding the section declaration of the same linker file (complete file attached) :&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;   /* The program code and other data goes into internal RAM */&lt;BR /&gt; .text :&lt;BR /&gt; {&lt;BR /&gt;   . = ALIGN(4);&lt;BR /&gt;   *(.text)                 /* .text sections (code) */&lt;BR /&gt;   *(.text*)                /* .text* sections (code) */&lt;BR /&gt;   *(.rodata)               /* .rodata sections (constants, strings, etc.) */&lt;BR /&gt;   *(.rodata*)              /* .rodata* sections (constants, strings, etc.) */&lt;BR /&gt;   *(.glue_7)               /* glue arm to thumb code */&lt;BR /&gt;   *(.glue_7t)              /* glue thumb to arm code */&lt;BR /&gt;   *(.eh_frame)&lt;BR /&gt;   KEEP (*(.init))&lt;BR /&gt;   KEEP (*(.fini))&lt;BR /&gt;   . = ALIGN(4);&lt;BR /&gt; } &amp;gt; m_text&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt; __etext = .;    /* define a global symbol at end of code */&lt;BR /&gt; __DATA_ROM = .; /* Symbol is used by startup for data initialization */&lt;BR /&gt;&lt;BR /&gt; .data : AT(__DATA_ROM)&lt;BR /&gt; {&lt;BR /&gt;   . = ALIGN(4);&lt;BR /&gt;   __DATA_RAM = .;&lt;BR /&gt;   __data_start__ = .;      /* create a global symbol at data start */&lt;BR /&gt;   *(.data)                 /* .data sections */&lt;BR /&gt;   *(.data*)                /* .data* sections */&lt;BR /&gt;   KEEP(*(.jcr*))&lt;BR /&gt;   . = ALIGN(4);&lt;BR /&gt;   __data_end__ = .;        /* define a global symbol at data end */&lt;BR /&gt; } &amp;gt; m_data&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does ".data : AT(__DATA_ROM)" mean that the .data section starts at the end of the .text section ? Why is that and therefore what is the point declaring the start address of m_data in MEMORY {} ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I understand correctly this would mean that .data section could overflow the ITCM range, especially when .text is close to its maximum size like my fw. What am I or the linker doing wrong ?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks a lot your help!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 14:09:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8M-Nano-Memory-Map/m-p/1355049#M181491</guid>
      <dc:creator>ycx</dc:creator>
      <dc:date>2021-10-13T14:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8M Nano Memory Map</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8M-Nano-Memory-Map/m-p/1355787#M181554</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/192397"&gt;@ycx&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;Generally the linker file lines below are intended for code / data relocation.&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;__DATA_ROM = .; /* Symbol is used by startup for data initialization */&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;.data : AT(__DATA_ROM)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; Please use the linked below file with explanation how to do it.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.nxp.com/t5/Kinetis-Design-Studio-Knowledge/Relocating-Code-and-Data-Using-the-KDS-GCC-Linker-File-for/ta-p/1121931" target="_blank"&gt;https://community.nxp.com/t5/Kinetis-Design-Studio-Knowledge/Relocating-Code-and-Data-Using-the-KDS-GCC-Linker-File-for/ta-p/1121931&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;In Your case - perhaps - it would be better to try using DRAM configuration; *_cm7_ddr_ram.ld&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Yuri.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 10:36:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8M-Nano-Memory-Map/m-p/1355787#M181554</guid>
      <dc:creator>Yuri</dc:creator>
      <dc:date>2021-10-14T10:36:56Z</dc:date>
    </item>
  </channel>
</rss>

