<?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 Re: force structure to address in IAR in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/force-structure-to-address-in-IAR/m-p/766371#M46616</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As far as I can tell, that's what I'm doing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Mar 2018 14:47:49 GMT</pubDate>
    <dc:creator>ryanlush</dc:creator>
    <dc:date>2018-03-16T14:47:49Z</dc:date>
    <item>
      <title>force structure to address in IAR</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/force-structure-to-address-in-IAR/m-p/766369#M46614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a C structure I am trying to force to a specific address like so&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#pragma location = ".app_info"&lt;BR /&gt;__root struct&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;uint32_t major;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;uint32_t minor;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;uint32_t eeprom_init;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;uint32_t reserved;&lt;BR /&gt;}const version = {MAJOR_REVISION, MINOR_REVISION, (uint32_t)EEPROM_Init, 0x00000000};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And here is my linker script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*###ICF### Section handled by ICF editor, don't touch! ****/&lt;BR /&gt;/*-Editor annotation file-*/&lt;BR /&gt;/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */&lt;BR /&gt;/*-Specials-*/&lt;BR /&gt;define symbol __ICFEDIT_intvec_start__ = 0x00006000;&lt;BR /&gt;/*-Memory Regions-*/&lt;BR /&gt;define symbol __ICFEDIT_region_ROM_start__ = 0x00006000 ;&lt;BR /&gt;define symbol __ICFEDIT_region_ROM_end__&amp;nbsp;&amp;nbsp; = 0x000FFFFF;&lt;BR /&gt;define symbol __ICFEDIT_region_RAM_start__ = 0x1FFF0000;&lt;BR /&gt;define symbol __ICFEDIT_region_RAM_end__&amp;nbsp;&amp;nbsp; = 0x2002FFF0;&lt;BR /&gt;/*-Sizes-*/&lt;BR /&gt;define symbol __ICFEDIT_size_cstack__ = 0;&lt;BR /&gt;define symbol __ICFEDIT_size_heap__&amp;nbsp;&amp;nbsp; = 0;&lt;BR /&gt;/**** End of ICF editor section. ###ICF###*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;define symbol app_info_start&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x00006020;&lt;BR /&gt;define symbol app_info_end&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x0000602F;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;define exported symbol __INTERNAL_FLASH_BASE&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x00000000;&lt;BR /&gt;define exported symbol __INTERNAL_FLASH_SIZE&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x00100000;&lt;BR /&gt;define exported symbol __INTERNAL_SRAM_BASE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x1FFF0000;&lt;BR /&gt;define exported symbol __INTERNAL_SRAM_SIZE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x00040000;&lt;BR /&gt;define exported symbol __SRAM_POOL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x1FFF0000;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;define exported symbol __INTERNAL_FLEXNVM_BASE = 0;&lt;BR /&gt;define exported symbol __INTERNAL_FLEXNVM_SIZE = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;define exported symbol __VECTOR_TABLE_ROM_START = 0x00000000;&lt;BR /&gt;define exported symbol __VECTOR_TABLE_RAM_START = __ICFEDIT_region_RAM_start__;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;define exported symbol __DEFAULT_PROCESSOR_NUMBER = 1;&lt;BR /&gt;define exported symbol __DEFAULT_INTERRUPT_STACK_SIZE = 1024;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* mem_init writes a storeblock_struct at the end of kernel data, max size 32 bytes, so use 0x100 offset */&lt;BR /&gt;define exported symbol __BOOT_STACK_ADDRESS = __ICFEDIT_region_RAM_end__ - 0x100;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;define exported symbol __KERNEL_DATA_END = __ICFEDIT_region_RAM_end__;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;define memory mem with size = 4G;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;define region ROM_region&amp;nbsp;&amp;nbsp; = mem:[from __ICFEDIT_region_ROM_start__&amp;nbsp;&amp;nbsp; to __ICFEDIT_region_ROM_end__];&lt;BR /&gt;define region RAM_region&amp;nbsp;&amp;nbsp; = mem:[from __ICFEDIT_region_RAM_start__&amp;nbsp;&amp;nbsp; to __ICFEDIT_region_RAM_end__];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;define block KERNEL_DATA with alignment = 8 { section .kernel_data };&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;define exported symbol __FLASHX_SECT_SIZE = 0x1000;&lt;BR /&gt;define exported symbol __FLASHX_END_ADDR = __INTERNAL_FLASH_BASE + __INTERNAL_FLASH_SIZE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;define block CFMPROTROM with size = 20 { section .cfmconfig };&lt;BR /&gt;define block FLASHX_POOL with alignment = __FLASHX_SECT_SIZE { section .flashx };&lt;BR /&gt;define block TEXTSECTION with alignment = 4 { section .text };&lt;BR /&gt;keep { section .cfmconfig };&lt;BR /&gt;keep { section .flashx };&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;initialize by copy { readwrite };&lt;BR /&gt;do not initialize&amp;nbsp; { section .noinit };&lt;BR /&gt;do not initialize&amp;nbsp; { section .kernel_data };&lt;BR /&gt;do not initialize&amp;nbsp; { section .flashx };&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec, block CFMPROTROM };&lt;BR /&gt;place in ROM_region { first block TEXTSECTION, readonly,&amp;nbsp; last block FLASHX_POOL };&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;place at address mem:__ICFEDIT_region_RAM_start__ { readwrite section .vectors_ram };&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* each block/segment must be in one line (association to region) because I need kernel data start after other datas */&lt;BR /&gt;place in RAM_region&amp;nbsp;&amp;nbsp; { readwrite, last block KERNEL_DATA };&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;place at address mem: app_info_start &amp;nbsp;&amp;nbsp; &amp;nbsp;{ section .app_info };&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but when I compile I get an error from the linker&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error[Lp011]: section placement failed &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; unable to complete "place at" directives with a total estimated minimum size of 0x424 bytes in &amp;nbsp;&lt;BR /&gt;&amp;lt;[0x00006000-0x0000601f], [0x00006020-0x000fffff]&amp;gt; (total space 0xfa000). &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Needed: &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [0x00006000-0x0000601f]: 0x414 min, align 0x4 (size:&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x20) &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [0x00006020-0x000fffff]:&amp;nbsp; 0x10 min, align 0x4 (size: 0xf9fe0) &lt;BR /&gt;Error[Lp015]: section placement failure: overcommitted content in [0x00006000-0x0000601f] &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone tell me what I'm doing wrong? This has worked for me in the past.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2018 14:23:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/force-structure-to-address-in-IAR/m-p/766369#M46614</guid>
      <dc:creator>ryanlush</dc:creator>
      <dc:date>2018-03-16T14:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: force structure to address in IAR</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/force-structure-to-address-in-IAR/m-p/766370#M46615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I haven't looked through the details you've shared.&amp;nbsp; But when I want to put data at a specific location in flash, I use the interrupt vector table as an example.&amp;nbsp; Every project has a vector table, and you can use it as a reference to see how to setup the linker file, and syntax needed in the source code to force your data where you want it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2018 14:45:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/force-structure-to-address-in-IAR/m-p/766370#M46615</guid>
      <dc:creator>dereksnell</dc:creator>
      <dc:date>2018-03-16T14:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: force structure to address in IAR</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/force-structure-to-address-in-IAR/m-p/766371#M46616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As far as I can tell, that's what I'm doing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2018 14:47:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/force-structure-to-address-in-IAR/m-p/766371#M46616</guid>
      <dc:creator>ryanlush</dc:creator>
      <dc:date>2018-03-16T14:47:49Z</dc:date>
    </item>
  </channel>
</rss>

