<?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>topic Incorrect map file generation in S32 Design Studio</title>
    <link>https://community.nxp.com/t5/S32-Design-Studio/Incorrect-map-file-generation/m-p/1287979#M7545</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm using S32 Design Studio&amp;nbsp;Version: 2.1 Build id: 190624. I am trying to use some symbols defined in linker file but i get incorrect results. The is a stack section define as follows:&lt;/P&gt;&lt;P&gt;.stack (NOLOAD) : ALIGN(0x1000)&lt;BR /&gt;{&lt;BR /&gt;__HEAP = . ;&lt;BR /&gt;PROVIDE (_end = . );&lt;BR /&gt;PROVIDE (end = . );&lt;BR /&gt;. += __HEAP_SIZE ;&lt;BR /&gt;__HEAP_END = . ;&lt;BR /&gt;TEST = (SRAM_BASE_ADDR + SRAM_SIZE + 1 - __STACK_SIZE);&lt;BR /&gt;TEST_1 = __HEAP_END;&lt;BR /&gt;TEST_2 = TEST - TEST_1;&lt;BR /&gt;TEST_3 = 1 + 3;&lt;BR /&gt;TEST_4 = TEST_3 - 1;&lt;BR /&gt;_stack_end = . ;&lt;BR /&gt;. += __STACK_SIZE ;&lt;BR /&gt;_stack_addr = . ;&lt;BR /&gt;__SP_INIT = . ;&lt;BR /&gt;. += 4;&lt;BR /&gt;} &amp;gt; m_data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After build the TEST_X values generated are incorrect:&lt;/P&gt;&lt;P&gt;.stack 0x40050000 0x3004 load address 0xa004c000&lt;BR /&gt;0x40050000 __HEAP = .&lt;BR /&gt;[!provide] PROVIDE (_end, .)&lt;BR /&gt;0x40050000 PROVIDE (end, .)&lt;BR /&gt;0x40051000 . = (. + __HEAP_SIZE)&lt;BR /&gt;*fill* 0x40050000 0x1000&lt;BR /&gt;0x40051000 __HEAP_END = .&lt;BR /&gt;0x4005e000 TEST = (((SRAM_BASE_ADDR + SRAM_SIZE) + 0x1) - __STACK_SIZE)&lt;BR /&gt;0x40051000 TEST_1 = __HEAP_END&lt;BR /&gt;0x4005d000 TEST_2 = (TEST - TEST_1)&lt;BR /&gt;0x00000004 TEST_3 = 0x4&lt;BR /&gt;0x40050003 TEST_4 = (TEST_3 - 0x1)&lt;BR /&gt;0x40051000 _stack_end = .&lt;BR /&gt;0x40053000 . = (. + __STACK_SIZE)&lt;BR /&gt;*fill* 0x40051000 0x2000&lt;BR /&gt;0x40053000 _stack_addr = .&lt;BR /&gt;0x40053000 __SP_INIT = .&lt;/P&gt;&lt;P&gt;For TEST_2 and TEST_4 the upper two bytes for some reason have value 0x4005. Can someone explain why is is generated like this? Sorry if i made some stupid mistake, i don't usually work with linker files.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Jun 2021 06:12:45 GMT</pubDate>
    <dc:creator>darq</dc:creator>
    <dc:date>2021-06-07T06:12:45Z</dc:date>
    <item>
      <title>Incorrect map file generation</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/Incorrect-map-file-generation/m-p/1287979#M7545</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm using S32 Design Studio&amp;nbsp;Version: 2.1 Build id: 190624. I am trying to use some symbols defined in linker file but i get incorrect results. The is a stack section define as follows:&lt;/P&gt;&lt;P&gt;.stack (NOLOAD) : ALIGN(0x1000)&lt;BR /&gt;{&lt;BR /&gt;__HEAP = . ;&lt;BR /&gt;PROVIDE (_end = . );&lt;BR /&gt;PROVIDE (end = . );&lt;BR /&gt;. += __HEAP_SIZE ;&lt;BR /&gt;__HEAP_END = . ;&lt;BR /&gt;TEST = (SRAM_BASE_ADDR + SRAM_SIZE + 1 - __STACK_SIZE);&lt;BR /&gt;TEST_1 = __HEAP_END;&lt;BR /&gt;TEST_2 = TEST - TEST_1;&lt;BR /&gt;TEST_3 = 1 + 3;&lt;BR /&gt;TEST_4 = TEST_3 - 1;&lt;BR /&gt;_stack_end = . ;&lt;BR /&gt;. += __STACK_SIZE ;&lt;BR /&gt;_stack_addr = . ;&lt;BR /&gt;__SP_INIT = . ;&lt;BR /&gt;. += 4;&lt;BR /&gt;} &amp;gt; m_data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After build the TEST_X values generated are incorrect:&lt;/P&gt;&lt;P&gt;.stack 0x40050000 0x3004 load address 0xa004c000&lt;BR /&gt;0x40050000 __HEAP = .&lt;BR /&gt;[!provide] PROVIDE (_end, .)&lt;BR /&gt;0x40050000 PROVIDE (end, .)&lt;BR /&gt;0x40051000 . = (. + __HEAP_SIZE)&lt;BR /&gt;*fill* 0x40050000 0x1000&lt;BR /&gt;0x40051000 __HEAP_END = .&lt;BR /&gt;0x4005e000 TEST = (((SRAM_BASE_ADDR + SRAM_SIZE) + 0x1) - __STACK_SIZE)&lt;BR /&gt;0x40051000 TEST_1 = __HEAP_END&lt;BR /&gt;0x4005d000 TEST_2 = (TEST - TEST_1)&lt;BR /&gt;0x00000004 TEST_3 = 0x4&lt;BR /&gt;0x40050003 TEST_4 = (TEST_3 - 0x1)&lt;BR /&gt;0x40051000 _stack_end = .&lt;BR /&gt;0x40053000 . = (. + __STACK_SIZE)&lt;BR /&gt;*fill* 0x40051000 0x2000&lt;BR /&gt;0x40053000 _stack_addr = .&lt;BR /&gt;0x40053000 __SP_INIT = .&lt;/P&gt;&lt;P&gt;For TEST_2 and TEST_4 the upper two bytes for some reason have value 0x4005. Can someone explain why is is generated like this? Sorry if i made some stupid mistake, i don't usually work with linker files.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jun 2021 06:12:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/Incorrect-map-file-generation/m-p/1287979#M7545</guid>
      <dc:creator>darq</dc:creator>
      <dc:date>2021-06-07T06:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect map file generation</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/Incorrect-map-file-generation/m-p/1289912#M7554</link>
      <description>&lt;P&gt;Hi Darq,&lt;/P&gt;
&lt;P&gt;It seems there is a confusion between absolute and relative symbols.&lt;/P&gt;
&lt;P&gt;Symbols within section definition are relative by default.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I'd suggest you to define the "constant" symbols as absolute e.g.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;TEST = ABSOLUTE(SRAM_BASE_ADDR + SRAM_SIZE + 1 - __STACK_SIZE);&lt;BR /&gt;TEST_1 = ABSOLUTE(__HEAP_END);&lt;BR /&gt;TEST_2 = TEST - TEST_1;&lt;BR /&gt;TEST_3 = ABSOLUTE (1 + 3);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;TEST_4 = TEST_3 - 1;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;for more information please check this link:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_chapter/ld_3.html#SEC13" target="_blank" rel="noopener"&gt;https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_chapter/ld_3.html#SEC13&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope it helps.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Stan&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jun 2021 12:52:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/Incorrect-map-file-generation/m-p/1289912#M7554</guid>
      <dc:creator>stanish</dc:creator>
      <dc:date>2021-06-09T12:52:35Z</dc:date>
    </item>
  </channel>
</rss>

