<?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>Kinetis Design StudioのトピックDATA_SEG with Kinetis development</title>
    <link>https://community.nxp.com/t5/Kinetis-Design-Studio/DATA-SEG-with-Kinetis-development/m-p/489660#M5863</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: sans-serif, Arial, Verdana, 'Trebuchet MS'; font-size: 13px;"&gt;My company has been using Freescale (HCS12X) parts for more than 10 years with CodeWarrior development.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: sans-serif, Arial, Verdana, 'Trebuchet MS'; font-size: 13px;"&gt;We now want to use the Kinetis KE06Z part for a new lower code development. I have the FRDM-KE06Z board and have code running on it, using the CodeWarrior Development Studio V1.06. But as I progress I'm running into troubles.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: sans-serif, Arial, Verdana, 'Trebuchet MS'; font-size: 13px;"&gt;My problem today started with the support or lack of support for #pragma. My research so far suggests there is NO SUPPORT for "#pragma DATA_SEG", for example. Is this true?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: sans-serif, Arial, Verdana, 'Trebuchet MS'; font-size: 13px;"&gt;I want to place variables into specific memory locations so that both the normal project software, and the bootloader, can access the same data. How do I do this - in the past I used the DATA_SEG and then set up the linker to place that segment somewhere specific.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: sans-serif, Arial, Verdana, 'Trebuchet MS'; font-size: 13px;"&gt;If no support for DATA_SEG, what is the alternative?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN style="color: #333333; font-family: sans-serif, Arial, Verdana, 'Trebuchet MS'; font-size: 13px;"&gt; &lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: sans-serif, Arial, Verdana, 'Trebuchet MS'; font-size: 13px;"&gt;Documentation online is very confusing perhaps due to the Freescale / NXP business but also because there seems to be two separate development systems (the other is Kinetis Design Studio I think).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: sans-serif, Arial, Verdana, 'Trebuchet MS'; font-size: 13px;"&gt;I wonder if I have chosen the wrong dev suite - where is any helpful information on which is the better choice, what the differences are, etc?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: sans-serif, Arial, Verdana, 'Trebuchet MS'; font-size: 13px;"&gt;In any case does Kinetis Design Studio support "#pragma DATA_SEG"?&lt;/SPAN&gt;&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;&lt;SPAN style="color: #333333; font-family: sans-serif, Arial, Verdana, 'Trebuchet MS'; font-size: 13px;"&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: sans-serif, Arial, Verdana, 'Trebuchet MS'; font-size: 13px;"&gt;Ian Cull. PG Trionic Inc&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: sans-serif, Arial, Verdana, 'Trebuchet MS'; font-size: 13px;"&gt;Essex, MA, USA&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Jan 2016 19:24:21 GMT</pubDate>
    <dc:creator>iancull</dc:creator>
    <dc:date>2016-01-13T19:24:21Z</dc:date>
    <item>
      <title>DATA_SEG with Kinetis development</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/DATA-SEG-with-Kinetis-development/m-p/489660#M5863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: sans-serif, Arial, Verdana, 'Trebuchet MS'; font-size: 13px;"&gt;My company has been using Freescale (HCS12X) parts for more than 10 years with CodeWarrior development.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: sans-serif, Arial, Verdana, 'Trebuchet MS'; font-size: 13px;"&gt;We now want to use the Kinetis KE06Z part for a new lower code development. I have the FRDM-KE06Z board and have code running on it, using the CodeWarrior Development Studio V1.06. But as I progress I'm running into troubles.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: sans-serif, Arial, Verdana, 'Trebuchet MS'; font-size: 13px;"&gt;My problem today started with the support or lack of support for #pragma. My research so far suggests there is NO SUPPORT for "#pragma DATA_SEG", for example. Is this true?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: sans-serif, Arial, Verdana, 'Trebuchet MS'; font-size: 13px;"&gt;I want to place variables into specific memory locations so that both the normal project software, and the bootloader, can access the same data. How do I do this - in the past I used the DATA_SEG and then set up the linker to place that segment somewhere specific.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: sans-serif, Arial, Verdana, 'Trebuchet MS'; font-size: 13px;"&gt;If no support for DATA_SEG, what is the alternative?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN style="color: #333333; font-family: sans-serif, Arial, Verdana, 'Trebuchet MS'; font-size: 13px;"&gt; &lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: sans-serif, Arial, Verdana, 'Trebuchet MS'; font-size: 13px;"&gt;Documentation online is very confusing perhaps due to the Freescale / NXP business but also because there seems to be two separate development systems (the other is Kinetis Design Studio I think).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: sans-serif, Arial, Verdana, 'Trebuchet MS'; font-size: 13px;"&gt;I wonder if I have chosen the wrong dev suite - where is any helpful information on which is the better choice, what the differences are, etc?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: sans-serif, Arial, Verdana, 'Trebuchet MS'; font-size: 13px;"&gt;In any case does Kinetis Design Studio support "#pragma DATA_SEG"?&lt;/SPAN&gt;&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;&lt;SPAN style="color: #333333; font-family: sans-serif, Arial, Verdana, 'Trebuchet MS'; font-size: 13px;"&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: sans-serif, Arial, Verdana, 'Trebuchet MS'; font-size: 13px;"&gt;Ian Cull. PG Trionic Inc&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: sans-serif, Arial, Verdana, 'Trebuchet MS'; font-size: 13px;"&gt;Essex, MA, USA&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jan 2016 19:24:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/DATA-SEG-with-Kinetis-development/m-p/489660#M5863</guid>
      <dc:creator>iancull</dc:creator>
      <dc:date>2016-01-13T19:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: DATA_SEG with Kinetis development</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/DATA-SEG-with-Kinetis-development/m-p/489661#M5864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ian,&lt;/P&gt;&lt;P&gt;things are a bit different in GNU/gcc/ld land. So yes, there is no such pragma CODE_SEG or DATA_SEG. Pragmas are very compiler specific.&lt;/P&gt;&lt;P&gt;But there is the very flexible __attribute__ in GNU land, e.g.:&lt;/P&gt;&lt;P&gt;static unsigned char __attribute__((section (".mySection"))) ucHeap[configTOTAL_HEAP_SIZE];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additionally, you need to understand a bit the GNU linker file. Maybe have a look here which discusses a specific case how to allocate a variable in a special section:&lt;/P&gt;&lt;P&gt;&lt;A href="http://mcuoneclipse.com/2013/07/10/freertos-heap-with-segmented-kinetis-k-sram/" title="http://mcuoneclipse.com/2013/07/10/freertos-heap-with-segmented-kinetis-k-sram/"&gt;FreeRTOS Heap with Segmented Kinetis K SRAM | MCU on Eclipse&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Related on that topic, this might be helpful too: &lt;A href="http://mcuoneclipse.com/2012/11/01/defining-variables-at-absolute-addresses-with-gcc/" title="http://mcuoneclipse.com/2012/11/01/defining-variables-at-absolute-addresses-with-gcc/"&gt;Defining Variables at Absolute Addresses with gcc | MCU on Eclipse&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jan 2016 19:36:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/DATA-SEG-with-Kinetis-development/m-p/489661#M5864</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2016-01-13T19:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: DATA_SEG with Kinetis development</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/DATA-SEG-with-Kinetis-development/m-p/489662#M5865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks, and fast! That "Defining Variables at Absolute Addresses with gcc" looks like it might be very much what I need, I'll try modifying my pragmas to match and see how it goes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jan 2016 19:47:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/DATA-SEG-with-Kinetis-development/m-p/489662#M5865</guid>
      <dc:creator>iancull</dc:creator>
      <dc:date>2016-01-13T19:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: DATA_SEG with Kinetis development</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/DATA-SEG-with-Kinetis-development/m-p/489663#M5866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With that help, I'm done :smileyhappy:&lt;/P&gt;&lt;P&gt;In the linker file, I split off 16 bytes of memory:&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #00acff;"&gt;&lt;STRONG&gt;MEMORY&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;{&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp; m_data&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (rwx) : &lt;SPAN style="color: #007aaa;"&gt;&lt;STRONG&gt;ORIGIN&lt;/STRONG&gt;&lt;/SPAN&gt; = 0x1FFFF800, &lt;SPAN style="color: #007aaa;"&gt;&lt;STRONG&gt;LENGTH&lt;/STRONG&gt;&lt;/SPAN&gt; = 8K - 16 &lt;SPAN style="color: #d81e00;"&gt;/* SRAM */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp; m_fixedboot&amp;nbsp;&amp;nbsp;&amp;nbsp; (rwx) : &lt;SPAN style="color: #007aaa;"&gt;&lt;STRONG&gt;ORIGIN&lt;/STRONG&gt;&lt;/SPAN&gt; = 0x200017F0, &lt;SPAN style="color: #007aaa;"&gt;&lt;STRONG&gt;LENGTH&lt;/STRONG&gt;&lt;/SPAN&gt; = 16 &lt;SPAN style="color: #d81e00;"&gt;/* SRAM */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I set up a new section to fill it:&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp; .FIXEDBOOT_DATA :&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp; {&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *(.FIXEDBOOT_DATA1)&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *(.FIXEDBOOT_DATA2)&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *(.FIXEDBOOT_DATA3)&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp; } &amp;gt; m_fixedboot&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And in the memory definitions C code I labeled the variables (I did it this way in three section attributes since the order appeared unpredictable if I just put all in the same section):&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #006141;"&gt;byte&lt;/SPAN&gt; &lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;__attribute__&lt;/STRONG&gt;&lt;/SPAN&gt;((section (&lt;SPAN style="color: #3933ff;"&gt;".FIXEDBOOT_DATA1"&lt;/SPAN&gt;))) ramFlashCodes[4];&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #006141;"&gt;byte&lt;/SPAN&gt; &lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;__attribute__&lt;/STRONG&gt;&lt;/SPAN&gt;((section (&lt;SPAN style="color: #3933ff;"&gt;".FIXEDBOOT_DATA2"&lt;/SPAN&gt;))) ramResetData[4];&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #4e9072;"&gt;&lt;SPAN style="color: #006141;"&gt;longword&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;__attribute__&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;((section (&lt;/SPAN&gt;&lt;SPAN style="color: #3933ff;"&gt;".FIXEDBOOT_DATA3"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;))) ramPowerUpCheck;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #4e9072;"&gt;&lt;/P&gt;&lt;P&gt;Perfect, thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jan 2016 20:40:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/DATA-SEG-with-Kinetis-development/m-p/489663#M5866</guid>
      <dc:creator>iancull</dc:creator>
      <dc:date>2016-01-13T20:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: DATA_SEG with Kinetis development</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/DATA-SEG-with-Kinetis-development/m-p/489664#M5867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Ian&lt;/P&gt;&lt;P&gt;Like you, our company has used HSC12X for years and I am getting to grips with Kinetis for a new project (specifically the KL26).&lt;/P&gt;&lt;P&gt;As you noted, there is no direct equivalent of the #pragma DATA_SEG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The downside of the method you have used is that you have to insert the __attribute__ ((section(".mydata"))) statement into every declaration for constants.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The alternative is to use the linker file to put all constant data from a given source file into the specified memory area as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Put your constant data into a separate source file. In my project, it's called "changer_data.c"&lt;/P&gt;&lt;P&gt;It can be defined simply as "const byte ramFlashCodes[4];" etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. in the MEMORY{} block define a segment of memory where the data will be stored.&lt;/P&gt;&lt;P&gt;E.g.&amp;nbsp;&amp;nbsp; m_changer_data (R) : ORIGIN = 0x00003600, LENGTH = 0x00001000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. In the SECTIONS{} segment, add a statement that directs all output from the source file with the constant data to this segment. E.g.&lt;/P&gt;&lt;P&gt;&amp;nbsp; .m_changer_data_seg :&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; . = ALIGN(4);&lt;/P&gt;&lt;P&gt;&amp;nbsp; *changer_data.o (.rodata .rodata*)&lt;/P&gt;&lt;P&gt;&amp;nbsp; . = ALIGN(4);&lt;/P&gt;&lt;P&gt;&amp;nbsp; } &amp;gt; m_changer_data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will take all the compiled output from "changer_data.c" and link it into the m_changer_data area of memory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got this from another post by Eric Styger at &lt;A href="http://mcuoneclipse.com/2014/10/06/putting-code-of-files-into-special-section-with-the-gnu-linker/" title="http://mcuoneclipse.com/2014/10/06/putting-code-of-files-into-special-section-with-the-gnu-linker/"&gt;Putting Code of Files into Special Section with the GNU Linker | MCU on Eclipse&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jan 2016 23:16:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/DATA-SEG-with-Kinetis-development/m-p/489664#M5867</guid>
      <dc:creator>Jiun_Yong</dc:creator>
      <dc:date>2016-01-13T23:16:16Z</dc:date>
    </item>
  </channel>
</rss>

