<?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: How to make a read-only segment in Flash in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-to-make-a-read-only-segment-in-Flash/m-p/236848#M9282</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mehdi:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have some comments:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1- Your &lt;STRONG&gt;m_text&lt;/STRONG&gt; and &lt;STRONG&gt;m_factory_params&lt;/STRONG&gt; segments are overlapping, and they need to be separated. It is common to place configuration parameters at flash start or end.&lt;/P&gt;&lt;P&gt;2- You declare the array inside of a function. It is not necessary. Just declare the array alone.&lt;/P&gt;&lt;P&gt;3- In CPU processor expert build options, use "R" instead of "RX". The same for the section declaration.&lt;/P&gt;&lt;P&gt;4- As your array is in flash (read-only) use &lt;STRONG&gt;const&lt;/STRONG&gt; instead of &lt;STRONG&gt;static&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;5- In the main you put ".para_config". According to your lcf, this should be ".paraconfig".&lt;/P&gt;&lt;P&gt;5- You are declaring the array, but as it is not referenced from your code yet, the linker is being "smart" and ignoring that section. Use KEEP_SECTION to force the linker to place that section.&lt;/P&gt;&lt;P&gt;6- :smileyalert: Once you modify the linker file, you need to disable linker file generation from CPU processor expert component. It is in the "Build options" tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With all that being said, here is how I would achieve your need:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- In the LCF file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13925852999968181" jivemacro_uid="_13925852999968181" modifiedtitle="true"&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;KEEP_SECTION { .vectortable }&lt;/P&gt;
&lt;P&gt;KEEP_SECTION { .cfmconfig }&lt;/P&gt;
&lt;P&gt;KEEP_SECTION { .paraconfig }&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;MEMORY {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x000001E0&lt;/P&gt;
&lt;P&gt;&amp;nbsp; m_text&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RX) : ORIGIN = 0x00000410, LENGTH = 0x0007F7F0&lt;/P&gt;
&lt;P&gt;&amp;nbsp; m_data&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x00010000&lt;/P&gt;
&lt;P&gt;&amp;nbsp; m_data_20000000 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00010000&lt;/P&gt;
&lt;P&gt;&amp;nbsp; m_factory_param (R) : ORIGIN = 0x0007FC00, LENGTH = 0x00000400&lt;/P&gt;
&lt;P&gt;&amp;nbsp; m_cfmprotrom&amp;nbsp; (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;SECTIONS {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; ## Heap and Stack sizes definition &lt;/P&gt;
&lt;P&gt;&amp;nbsp; __heap_size = 0x0400;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; ___stack_size = 0x0400;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .para_config :&lt;/P&gt;
&lt;P&gt;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; __PARACFG = .;&amp;nbsp; # start address of the new parameter configuration sector.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; . = ALIGN(0x4);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; * (.paraconfig) # actual data matching pragma directives&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; . = ALIGN(0x4);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; } &amp;gt; m_factory_param&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- In your code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13925855483975005" jivemacro_uid="_13925855483975005" modifiedtitle="true"&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;#pragma define_section para ".paraconfig" abs32 R&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;__declspec(para) &lt;/P&gt;
&lt;P&gt;const uint8_t se_mee[0x10] = &lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x01U, 0x02U, 0x03U, 0x04U, 0x05U, 0x06U, 0x07U, 0x08U, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x09U, 0x0Au, 0x0BU, 0x0CU, 0x0DU, 0x0Eu, 0x0FU, 0x00U&lt;/P&gt;
&lt;P&gt;};&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;/*lint -save&amp;nbsp; -e970 Disable MISRA rule (6.3) checking. */&lt;/P&gt;
&lt;P&gt;int main(void)&lt;/P&gt;
&lt;P&gt;/*lint -restore Enable MISRA rule (6.3) checking. */&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Jorge Gonzalez&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 16 Feb 2014 21:20:43 GMT</pubDate>
    <dc:creator>Jorge_Gonzalez</dc:creator>
    <dc:date>2014-02-16T21:20:43Z</dc:date>
    <item>
      <title>How to make a read-only segment in Flash</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-to-make-a-read-only-segment-in-Flash/m-p/236847#M9281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to make a 1KB read-only memory segment in my Flash.&lt;/P&gt;&lt;P&gt;My chip is MK10DN512Z VLL10. It has PFLASH0 and PFLASH1 section, each having 256KB of data. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My lcf file looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="9690_9690.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/119717i14FBF72427F72CD0/image-size/large?v=v2&amp;amp;px=999" role="button" title="9690_9690.png" alt="9690_9690.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="lcf.PNG.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/42496i0EDC818A09436F9B/image-size/large?v=v2&amp;amp;px=999" role="button" title="lcf.PNG.png" alt="lcf.PNG.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and in my main file I did this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="9691_9691.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/119718i86F609B89873E169/image-size/large?v=v2&amp;amp;px=999" role="button" title="9691_9691.png" alt="9691_9691.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="main1.PNG.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/14076iF3D3189C3B296C82/image-size/large?v=v2&amp;amp;px=999" role="button" title="main1.PNG.png" alt="main1.PNG.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;then I called that myTest() function in my main file. But when I read from that memory segment, I see nothing is written to it!!!&lt;/P&gt;&lt;P&gt;Now once I do all this, I the xMAP file, I cannot see that my_factory sector is created (the pointer to linker file is generated only):&lt;/P&gt;&lt;P&gt;# .para_config&lt;/P&gt;&lt;P&gt;#&amp;gt;00004000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __PARACFG (linker command file)&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why is that?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The goal is to specify a read-only sector in my FLASH memory that my code can write to it only. Once the FW is up, no one can write to that segment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Feb 2014 01:23:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-to-make-a-read-only-segment-in-Flash/m-p/236847#M9281</guid>
      <dc:creator>mehdikarimibiuk</dc:creator>
      <dc:date>2014-02-15T01:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a read-only segment in Flash</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-to-make-a-read-only-segment-in-Flash/m-p/236848#M9282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mehdi:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have some comments:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1- Your &lt;STRONG&gt;m_text&lt;/STRONG&gt; and &lt;STRONG&gt;m_factory_params&lt;/STRONG&gt; segments are overlapping, and they need to be separated. It is common to place configuration parameters at flash start or end.&lt;/P&gt;&lt;P&gt;2- You declare the array inside of a function. It is not necessary. Just declare the array alone.&lt;/P&gt;&lt;P&gt;3- In CPU processor expert build options, use "R" instead of "RX". The same for the section declaration.&lt;/P&gt;&lt;P&gt;4- As your array is in flash (read-only) use &lt;STRONG&gt;const&lt;/STRONG&gt; instead of &lt;STRONG&gt;static&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;5- In the main you put ".para_config". According to your lcf, this should be ".paraconfig".&lt;/P&gt;&lt;P&gt;5- You are declaring the array, but as it is not referenced from your code yet, the linker is being "smart" and ignoring that section. Use KEEP_SECTION to force the linker to place that section.&lt;/P&gt;&lt;P&gt;6- :smileyalert: Once you modify the linker file, you need to disable linker file generation from CPU processor expert component. It is in the "Build options" tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With all that being said, here is how I would achieve your need:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- In the LCF file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13925852999968181" jivemacro_uid="_13925852999968181" modifiedtitle="true"&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;KEEP_SECTION { .vectortable }&lt;/P&gt;
&lt;P&gt;KEEP_SECTION { .cfmconfig }&lt;/P&gt;
&lt;P&gt;KEEP_SECTION { .paraconfig }&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;MEMORY {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x000001E0&lt;/P&gt;
&lt;P&gt;&amp;nbsp; m_text&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RX) : ORIGIN = 0x00000410, LENGTH = 0x0007F7F0&lt;/P&gt;
&lt;P&gt;&amp;nbsp; m_data&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x00010000&lt;/P&gt;
&lt;P&gt;&amp;nbsp; m_data_20000000 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00010000&lt;/P&gt;
&lt;P&gt;&amp;nbsp; m_factory_param (R) : ORIGIN = 0x0007FC00, LENGTH = 0x00000400&lt;/P&gt;
&lt;P&gt;&amp;nbsp; m_cfmprotrom&amp;nbsp; (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;SECTIONS {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; ## Heap and Stack sizes definition &lt;/P&gt;
&lt;P&gt;&amp;nbsp; __heap_size = 0x0400;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; ___stack_size = 0x0400;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .para_config :&lt;/P&gt;
&lt;P&gt;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; __PARACFG = .;&amp;nbsp; # start address of the new parameter configuration sector.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; . = ALIGN(0x4);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; * (.paraconfig) # actual data matching pragma directives&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; . = ALIGN(0x4);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; } &amp;gt; m_factory_param&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- In your code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13925855483975005" jivemacro_uid="_13925855483975005" modifiedtitle="true"&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;#pragma define_section para ".paraconfig" abs32 R&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;__declspec(para) &lt;/P&gt;
&lt;P&gt;const uint8_t se_mee[0x10] = &lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x01U, 0x02U, 0x03U, 0x04U, 0x05U, 0x06U, 0x07U, 0x08U, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x09U, 0x0Au, 0x0BU, 0x0CU, 0x0DU, 0x0Eu, 0x0FU, 0x00U&lt;/P&gt;
&lt;P&gt;};&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;/*lint -save&amp;nbsp; -e970 Disable MISRA rule (6.3) checking. */&lt;/P&gt;
&lt;P&gt;int main(void)&lt;/P&gt;
&lt;P&gt;/*lint -restore Enable MISRA rule (6.3) checking. */&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Jorge Gonzalez&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Feb 2014 21:20:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-to-make-a-read-only-segment-in-Flash/m-p/236848#M9282</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2014-02-16T21:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a read-only segment in Flash</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-to-make-a-read-only-segment-in-Flash/m-p/236849#M9283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Thank you Jorge,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Okay so this is what I am going to do:&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;1- since I will be implementing switch feature for FW update, I need PFLASH1 section for future use. So I am not touching that section.&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;2- As you suggested, I specify the last KB of my PFLASH0 as factory values. It starts at address 0x0040_0000.&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;3- I follow your fixes to my linker file and change RX to R. Once I adjust my linker file and main code, I printf those memory values.&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;linker file:&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/skins/images/86B059E97A0E613DF565D8EA3D710484/responsive_peak/images/image_not_found.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/skins/images/86B059E97A0E613DF565D8EA3D710484/responsive_peak/images/image_not_found.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;and below is my code:&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;#pragma define_section para ".paraconfig" abs32 R&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;__declspec(para)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; const uint8_t factory_values[3] = {&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; 0x01,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; 0x02,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; 0x03&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; };&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;/*lint -save&amp;nbsp; -e970 Disable MISRA rule (6.3) checking. */&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;int main(void)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;/*lint -restore Enable MISRA rule (6.3) checking. */&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;{&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; /* Write your local variable definition here */&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; PE_low_level_init();&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; /*** End of Processor Expert internal initialization.&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ***/&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; /* Write your code here */&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;printf("factory param0 = 0x%x\n", IO_READ32(0x00040000));&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;printf("factory param1 = 0x%x\n", IO_READ32(0x00040001));&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;printf("factory param2 = 0x%x\n", IO_READ32(0x00040002));&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;printf("factory param3 = 0x%x\n", IO_READ32(0x00040003));&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;printf("factory param4 = 0x%x\n", IO_READ32(0x00040004));&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;the printf shows me:&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;factory param0 = 0x30201&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;factory param1 = 0xff000302&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;factory param2 = 0xffff0003&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;factory param3 = 0xffffff00&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;factory param4 = 0xffffffff&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I would expect to see param0 to be 0xff030201, and the rest of registers to stay 'ff' all?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Feb 2014 20:28:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-to-make-a-read-only-segment-in-Flash/m-p/236849#M9283</guid>
      <dc:creator>mehdikarimibiuk</dc:creator>
      <dc:date>2014-02-17T20:28:07Z</dc:date>
    </item>
  </channel>
</rss>

