<?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>ColdFire/68K Microcontrollers and ProcessorsのトピックPlace variables at absolute address</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Place-variables-at-absolute-address/m-p/249008#M11546</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello to all of you!&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working with CW v6.1 and MCF51QE128. I've got a special section where I put constant data (user config). Till now, I didn't mind where the compiler puts those variables, as long as they were inside this section. Rigth now, the order matters to me.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, I assume that the compiler will place the variables in the same order I declare them. If VAR1 is declared before VAR2, then VAR1 is in a smaller address than VAR2. But I found out that the compiler place them wherever it wants. I also try adding the &lt;STRONG&gt;@&lt;/STRONG&gt; but if I do, then the variable dissapears from xMAP.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's how I declare them and how they appear in the xMAP:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#pragma define_section _myDATA ".myDATA" far_absolute R&lt;/P&gt;&lt;P&gt;#pragma explicit_zero_data on&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) dword FLASH_DATA_CHECKSUM;&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) tUSUARIO FLASH_USUARIOS[FLASH_USUARIOS_dim];&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) byte FLASH_USUARIO_ACTIVO = 0xFF;&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) dword FLASH_CLAVE = 0xFFFFFFFF;&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) byte FLASH_RECARGA_SALDO_NUM[FLASH_TEL_NUMBER_size];&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) byte FLASH_CONSULTA_SALDO_TXT[FLASH_SALOO_TXT_size];&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) byte FLASH_CONSULTA_SALDO_NUM[FLASH_TEL_NUMBER_size];&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) byte ResetCounter = 0xFF;&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) byte ForceDelAllCounter = 0x00;&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) byte ATcmdNotRecogCounter = 0x00;&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) byte ATcmdNoRtaCounter&amp;nbsp; = 0x00;&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) byte FLASH_ALARM_STATE[4];&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) byte FLASH_IGNICION_STATE[4];&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) tSPAM FLASH_SPAM_list[dim_SPAM];&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) dword FLASH_DATA_END;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# .myDATA&lt;/P&gt;&lt;P&gt;&amp;nbsp; 00002800 00000001 .myDATA FLASH_USUARIO_ACTIVO (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 00002801 00000004 .myDATA FLASH_CLAVE (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 00002805 00000001 .myDATA ResetCounter (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 00002806 00000001 .myDATA ForceDelAllCounter (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 00002807 00000001 .myDATA ATcmdNotRecogCounter (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 00002808 00000001 .myDATA ATcmdNoRtaCounter (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 00002809 00000004 .myDATA FLASH_DATA_END (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0000280D 00000050 .myDATA FLASH_SPAM_list (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0000285D 00000004 .myDATA FLASH_IGNICION_STATE (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 00002861 00000004 .myDATA FLASH_ALARM_STATE (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 00002865 00000010 .myDATA FLASH_CONSULTA_SALDO_NUM (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 00002875 00000014 .myDATA FLASH_CONSULTA_SALDO_TXT (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 00002889 00000010 .myDATA FLASH_RECARGA_SALDO_NUM (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 00002899 000000A8 .myDATA FLASH_USUARIOS (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 00002941 00000004 .myDATA FLASH_DATA_CHECKSUM (Grabaciones Flash.c)&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope someone can help me&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards!&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SebaS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Jul 2013 20:39:09 GMT</pubDate>
    <dc:creator>sebasira</dc:creator>
    <dc:date>2013-07-01T20:39:09Z</dc:date>
    <item>
      <title>Place variables at absolute address</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Place-variables-at-absolute-address/m-p/249008#M11546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello to all of you!&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working with CW v6.1 and MCF51QE128. I've got a special section where I put constant data (user config). Till now, I didn't mind where the compiler puts those variables, as long as they were inside this section. Rigth now, the order matters to me.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, I assume that the compiler will place the variables in the same order I declare them. If VAR1 is declared before VAR2, then VAR1 is in a smaller address than VAR2. But I found out that the compiler place them wherever it wants. I also try adding the &lt;STRONG&gt;@&lt;/STRONG&gt; but if I do, then the variable dissapears from xMAP.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's how I declare them and how they appear in the xMAP:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#pragma define_section _myDATA ".myDATA" far_absolute R&lt;/P&gt;&lt;P&gt;#pragma explicit_zero_data on&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) dword FLASH_DATA_CHECKSUM;&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) tUSUARIO FLASH_USUARIOS[FLASH_USUARIOS_dim];&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) byte FLASH_USUARIO_ACTIVO = 0xFF;&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) dword FLASH_CLAVE = 0xFFFFFFFF;&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) byte FLASH_RECARGA_SALDO_NUM[FLASH_TEL_NUMBER_size];&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) byte FLASH_CONSULTA_SALDO_TXT[FLASH_SALOO_TXT_size];&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) byte FLASH_CONSULTA_SALDO_NUM[FLASH_TEL_NUMBER_size];&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) byte ResetCounter = 0xFF;&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) byte ForceDelAllCounter = 0x00;&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) byte ATcmdNotRecogCounter = 0x00;&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) byte ATcmdNoRtaCounter&amp;nbsp; = 0x00;&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) byte FLASH_ALARM_STATE[4];&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) byte FLASH_IGNICION_STATE[4];&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) tSPAM FLASH_SPAM_list[dim_SPAM];&lt;/P&gt;&lt;P&gt;__declspec(_myDATA) dword FLASH_DATA_END;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# .myDATA&lt;/P&gt;&lt;P&gt;&amp;nbsp; 00002800 00000001 .myDATA FLASH_USUARIO_ACTIVO (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 00002801 00000004 .myDATA FLASH_CLAVE (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 00002805 00000001 .myDATA ResetCounter (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 00002806 00000001 .myDATA ForceDelAllCounter (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 00002807 00000001 .myDATA ATcmdNotRecogCounter (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 00002808 00000001 .myDATA ATcmdNoRtaCounter (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 00002809 00000004 .myDATA FLASH_DATA_END (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0000280D 00000050 .myDATA FLASH_SPAM_list (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0000285D 00000004 .myDATA FLASH_IGNICION_STATE (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 00002861 00000004 .myDATA FLASH_ALARM_STATE (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 00002865 00000010 .myDATA FLASH_CONSULTA_SALDO_NUM (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 00002875 00000014 .myDATA FLASH_CONSULTA_SALDO_TXT (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 00002889 00000010 .myDATA FLASH_RECARGA_SALDO_NUM (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 00002899 000000A8 .myDATA FLASH_USUARIOS (Grabaciones Flash.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 00002941 00000004 .myDATA FLASH_DATA_CHECKSUM (Grabaciones Flash.c)&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope someone can help me&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards!&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SebaS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jul 2013 20:39:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Place-variables-at-absolute-address/m-p/249008#M11546</guid>
      <dc:creator>sebasira</dc:creator>
      <dc:date>2013-07-01T20:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: Place variables at absolute address</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Place-variables-at-absolute-address/m-p/249009#M11547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been reading &lt;A _jive_internal="true" href="https://community.nxp.com/thread/17176"&gt;this&lt;/A&gt; thread but it is not exactly what I need, although it helped me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Testing, I've found out that if I don't initialize the variables, then they are arranged upside down in memory: The first declared variable is at a higher memory address and the last declared variable is at the lowest address (section ini). But if I initialize one of them, the one that it is initialized appears first in memory (lower address).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, to avoid any other problem, I've declared all the variables so its length is multiple of 4. Just in case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'd like to know is how to place a constant variable, inside a section and at a fixed address. Like using &lt;STRONG&gt;@&lt;/STRONG&gt; or &lt;STRONG&gt;:&lt;/STRONG&gt; modifiers. If I use any of them, they dessapear from xMAP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jul 2013 11:51:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Place-variables-at-absolute-address/m-p/249009#M11547</guid>
      <dc:creator>sebasira</dc:creator>
      <dc:date>2013-07-02T11:51:01Z</dc:date>
    </item>
  </channel>
</rss>

