<?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>LPCXpresso IDEのトピックRe: Writing the default const values to the flash information block</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/Writing-the-default-const-values-to-the-flash-information-block/m-p/593937#M30697</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by abhilash.bidari on Sat Mar 17 00:23:52 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;here iam attaching ld scripts and&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 22:54:30 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T22:54:30Z</dc:date>
    <item>
      <title>Writing the default const values to the flash information block</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Writing-the-default-const-values-to-the-flash-information-block/m-p/593933#M30693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by abhilash.bidari on Thu Mar 15 06:03:11 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Controller: LPC1227&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to write some default values to the flash information block &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have modified the linker script as given below. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Memory map properly. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But once i download the code iam not able to see the default values in the flash information block&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
[FONT=Courier New]debug_mem.ld[/FONT]
[FONT=Courier New][/FONT] 
[FONT=Courier New]MEMORY
{
&amp;nbsp; /* Define each memory region */
&amp;nbsp; MFlash128 (rx) : ORIGIN = 0x0, LENGTH = 0x20000 /* 128k */
&amp;nbsp; RamLoc8 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x2000 /* 8k */
&amp;nbsp; InfoFlash(rx) :&amp;nbsp; ORIGIN = 0x00040200, LENGTH = 0x200&amp;nbsp; [/FONT]
[FONT=Courier New]}[/FONT]
[FONT=Courier New][/FONT] 
[FONT=Courier New]debug.ld[/FONT]
[FONT=Courier New][/FONT] 
[FONT=Courier New].rodata :
{ 
&amp;nbsp;&amp;nbsp; PROVIDE(__init_start = 0x00040200);[/FONT]
[FONT=Courier New]&amp;nbsp;&amp;nbsp; KEEP(*(.infodata*));
&amp;nbsp;&amp;nbsp; *(.rodata*)[/FONT]
[FONT=Courier New]&amp;nbsp;&amp;nbsp; PROVIDE(__init_end = 0x00040400);
} &amp;gt; InfoFlash[/FONT]
[FONT=Courier New][/FONT] 
[FONT=Courier New][/FONT] 
[FONT=Courier New]source code[/FONT]
[FONT=Courier New][/FONT] 
[FONT=Courier New][/FONT] 
[FONT=Courier New]__attribute__ ((section(".eeprom"))) const chardataval[4]={ 1,1,1,1};[/FONT]
&lt;SPAN&gt;[IMG]&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fmail.google.com%2Fmail%2Fimages%2Fcleardot.gif%5B%2FIMG%5D" rel="nofollow noopener noreferrer" target="_blank"&gt;https://mail.google.com/mail/images/cleardot.gif[/IMG]&lt;/A&gt;

 
 
 
 
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;please tell me what is the problem&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in map file it is coming as&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.rodata&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00040200&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xa&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; *(.infodata*)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:54:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Writing-the-default-const-values-to-the-flash-information-block/m-p/593933#M30693</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Writing the default const values to the flash information block</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Writing-the-default-const-values-to-the-flash-information-block/m-p/593934#M30694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by abhilash.bidari on Fri Mar 16 02:12:22 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Please any one help regarding this,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:54:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Writing-the-default-const-values-to-the-flash-information-block/m-p/593934#M30694</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: Writing the default const values to the flash information block</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Writing-the-default-const-values-to-the-flash-information-block/m-p/593935#M30695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by CodeRedSupport on Fri Mar 16 08:22:38 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;So where is you linker script placing the section ".eeprom" that you are using in your code, as opposed to the placing of the section ".infodata" that you appear to have in your linker script?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If that doesn't solve your problem, then please post your actually map file and full linker script(s).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;PS - this might be of use generally...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://"&gt;http://support.code-red-tech.com/CodeRedWiki/PlacingData&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CodeRedSupport&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:54:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Writing-the-default-const-values-to-the-flash-information-block/m-p/593935#M30695</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: Writing the default const values to the flash information block</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Writing-the-default-const-values-to-the-flash-information-block/m-p/593936#M30696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by abhilash.bidari on Fri Mar 16 22:46:33 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;sorry by mistake i have written eeprom&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;actual code in the source file is as below&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;__attribute__ ((section(".infodata"))) const chardataval[4]={ 1,1,1,1};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;[IMG]&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fmail.google.com%2Fmail%2Fimages%2Fcleardot.gif%5B%2FIMG%5D" rel="nofollow" target="_blank"&gt;https://mail.google.com/mail/images/cleardot.gif[/IMG]&lt;/A&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:54:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Writing-the-default-const-values-to-the-flash-information-block/m-p/593936#M30696</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Writing the default const values to the flash information block</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Writing-the-default-const-values-to-the-flash-information-block/m-p/593937#M30697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by abhilash.bidari on Sat Mar 17 00:23:52 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;here iam attaching ld scripts and&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:54:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Writing-the-default-const-values-to-the-flash-information-block/m-p/593937#M30697</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Writing the default const values to the flash information block</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Writing-the-default-const-values-to-the-flash-information-block/m-p/593938#M30698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by abhilash.bidari on Sat Mar 17 00:31:34 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Here Iam attaching the zip file contains ld script and map file.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:54:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Writing-the-default-const-values-to-the-flash-information-block/m-p/593938#M30698</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Writing the default const values to the flash information block</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Writing-the-default-const-values-to-the-flash-information-block/m-p/593939#M30699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Rob65 on Sat Mar 17 01:34:51 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: abhilash.bidari&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;in map file it is coming as&lt;BR /&gt; &lt;BR /&gt;.rodata&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00040200&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xa&lt;BR /&gt; *(.infodata*)&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Which does not surprise me at all.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you write:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
MEMORY
{
&amp;nbsp; /* Define each memory region */
&amp;nbsp; MFlash128 (rx) : ORIGIN = 0x0, LENGTH = 0x20000 /* 128k */
&amp;nbsp; RamLoc8 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x2000 /* 8k */
&amp;nbsp; [B][COLOR=Red]InfoFlash(rx)[/COLOR][/B] :&amp;nbsp; ORIGIN = 0x00040200, LENGTH = 0x200&amp;nbsp; 
}
[B][COLOR=Red].rodata[/COLOR][/B] :
{ 
&amp;nbsp;&amp;nbsp; PROVIDE(__init_start = 0x00040200);
&amp;nbsp;&amp;nbsp; KEEP(*(.infodata*));
&amp;nbsp;&amp;nbsp; *(.rodata*)
&amp;nbsp;&amp;nbsp; PROVIDE(__init_end = 0x00040400);
} &amp;gt; [B][COLOR=Red]InfoFlash[/COLOR][/B]
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;then where else would you think this would go ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You named your section .rodata which is just an arbitrary name. But this name is kind of 'reserved' in that this is the default name for read only data sections used by some compilers to mark read only data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But still - it seems to be working like you wanted it to. Just have a look at the .map file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To make this generally usable for others as well I defined a separate memory section called DataFlash and a memory section .flashdata:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
MEMORY
{
&amp;nbsp; /* Define each memory region */
&amp;nbsp; MFlash128 (rx) : ORIGIN = 0x0, LENGTH = 0x1f000 /* 128k */
&amp;nbsp; [B][COLOR=Red]DataFlash (rw) : ORIGIN = 0x1f000, LENGTH = 0x1000[/COLOR][/B]
&amp;nbsp; RamLoc16 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x4000 /* 16k */
&amp;nbsp; RamAHB16 (rwx) : ORIGIN = 0x2007c000, LENGTH = 0x4000 /* 16k */

}

SECTIONS
{

...
&amp;nbsp;&amp;nbsp;&amp;nbsp; .flashdata : ALIGN(4)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; KEEP(*(.flash.data*))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; . = ALIGN(4);
&amp;nbsp;&amp;nbsp;&amp;nbsp; } &amp;gt; [B][COLOR=Red]DataFlash[/COLOR][/B]
...
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;And in my C-code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
__attribute__ ((__section__(".flash.data"))) const char dataval[4];
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;If I compile and look in the .map file this ends up as:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
.flashdata&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x0001f000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x4
 *(.flash.data*)
 .flash.data&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x0001f000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x4 ./src/main.o
&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;&amp;nbsp;&amp;nbsp; 0x0001f000&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;&amp;nbsp;&amp;nbsp; dataval
&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;&amp;nbsp;&amp;nbsp; 0x0001f004&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;&amp;nbsp;&amp;nbsp; . = ALIGN (0x4)
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;I think you'll grasp the way of doing this but I will still explain a bit just for others as well:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The memory region DataFlash is the top part of my Flash memory (you might want to align this to a complete flash block) - it defines the physical memory and the addresses.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The [B][FONT=Courier New].dataflash { ... } &amp;gt; DataFlash[/FONT][/B] just tells that there is an overall section called .dataflash in which everything in the '...' is collected and this section is mapped in the (physical) memory region called DataFlash.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The [B][FONT=Courier New]*(.flash.data*)[/FONT][/B] is the way to specify that all sections that are named .flash.data are collected. With the [B][FONT=Courier New]KEEP(...)[/FONT][/B] around this we specify that whatever happens, these sections should always be loaded.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the .map file we see that the .flashdata section is 4 bytes long and that it contains the .flash.data section.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The extra asterisk in the flash.data.* definition allows us to use multiple names.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have a look at the example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
__attribute__ ((__section__(".flash.data1"))) const char dataval1[4];
__attribute__ ((__section__(".flash.data2"))) const char dataval2[4];
__attribute__ ((__section__(".flash.data1"))) const char dataval3[7];

.flashdata&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x0001f000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x10
 *(.flash.data*)
 .flash.data1&amp;nbsp;&amp;nbsp; 0x0001f000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xc ./src/main.o
&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;&amp;nbsp;&amp;nbsp; 0x0001f000&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;&amp;nbsp;&amp;nbsp; dataval1
&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;&amp;nbsp;&amp;nbsp; 0x0001f004&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;&amp;nbsp;&amp;nbsp; dataval3
 .flash.data2&amp;nbsp;&amp;nbsp; 0x0001f00c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x4 ./src/main.o
&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;&amp;nbsp;&amp;nbsp; 0x0001f00c&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;&amp;nbsp;&amp;nbsp; dataval2
&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;&amp;nbsp;&amp;nbsp; 0x0001f010&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;&amp;nbsp;&amp;nbsp; . = ALIGN (0x4)
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;This results in two different sections .flash.data1 and .flash.data2 that are collected into the .flashdata section (in my DataFlash memory region). Dataval1 and dataval3 are placed in the .flash.data1 section - this is a total of 11 bytes but since I specified the ALIGN(4) on .flashdata each section is aligned at 4 bytes. Dataval2 is placed in section .flash.data2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please note that the order of placement of these sections is arbitrary (in the order in which the linker sees them) and not alphabetically ordered.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,[INDENT]Rob&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:54:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Writing-the-default-const-values-to-the-flash-information-block/m-p/593939#M30699</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Writing the default const values to the flash information block</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Writing-the-default-const-values-to-the-flash-information-block/m-p/593940#M30700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by abhilash.bidari on Mon Mar 19 00:32:16 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I also tried to split the code memory itself, as you shown "Dataflash".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For me it is compiling and map file is generating properly. But when i download and start to run the code, control is going to "hardfault handler" function insted "main" function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What is the problem..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;whether i shold not do like below.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;__attribute__ ((__section__(".flash.data"))) const char dataval[4] = {1,1,1,1};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;While declaring the i shold not define the variables. If not then when i should define the variables.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:54:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Writing-the-default-const-values-to-the-flash-information-block/m-p/593940#M30700</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:54:32Z</dc:date>
    </item>
  </channel>
</rss>

