<?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 MCF52235 flash configuration field initialised with assembly code in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52235-flash-configuration-field-initialised-with-assembly/m-p/137862#M1992</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When attempting to make a bootloader, I discovered that none of the examples I've compared our code to seems to take care of the CFM configuration field as described in Table 17-1 in rev 4 of the MCF52235 reference manual.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;According to the manual (if I understand it correctly), flash address 0x400 to 0x417 should contain CFM configuration. __start (or whatever the initial assembly is called) should not occupy this memory space.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This seems to apply for examples from Codewarrior, Interniche and Codesourcery. An SVN repository or similar for improved example code could help others getting more quickly started.&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Jun 2007 17:30:48 GMT</pubDate>
    <dc:creator>pnordby</dc:creator>
    <dc:date>2007-06-22T17:30:48Z</dc:date>
    <item>
      <title>MCF52235 flash configuration field initialised with assembly code</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52235-flash-configuration-field-initialised-with-assembly/m-p/137862#M1992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When attempting to make a bootloader, I discovered that none of the examples I've compared our code to seems to take care of the CFM configuration field as described in Table 17-1 in rev 4 of the MCF52235 reference manual.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;According to the manual (if I understand it correctly), flash address 0x400 to 0x417 should contain CFM configuration. __start (or whatever the initial assembly is called) should not occupy this memory space.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This seems to apply for examples from Codewarrior, Interniche and Codesourcery. An SVN repository or similar for improved example code could help others getting more quickly started.&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 17:30:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52235-flash-configuration-field-initialised-with-assembly/m-p/137862#M1992</guid>
      <dc:creator>pnordby</dc:creator>
      <dc:date>2007-06-22T17:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: MCF52235 flash configuration field initialised with assembly code</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52235-flash-configuration-field-initialised-with-assembly/m-p/137863#M1993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hi&lt;BR /&gt;&lt;BR /&gt;It is true that a lot of people stumble on the FLASH initialisation when making their first "Boot-loader" type project. Leaving the initialisation locations unprogrammed (0xff) results in no CPU access rights and so an immediate exception.&lt;BR /&gt;&lt;BR /&gt;The uTasker project has set ups for CW and GNU (Codesourcery) and they work like this.&lt;BR /&gt;&lt;BR /&gt;1 CodeWarrior.&lt;BR /&gt;In the linker map we have defined these locations like this&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;I&gt;flashconfig&amp;nbsp;&amp;nbsp; (RX)&amp;nbsp;&amp;nbsp; : ORIGIN = 0x00000400, LENGTH = 0x00000018&amp;nbsp;&lt;/I&gt;&lt;BR /&gt;then we place the contents of an assembler file (called flash_config.s) to this area.&lt;BR /&gt;&lt;I&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .flashconfig :&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; flash_config.s (.text)&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;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &amp;gt; flashconfig&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/I&gt;flash_config.s contains table where initialisation values can be specifically set. In the general case - when no special protection is required - the contents are left at zero.&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;PRE&gt;FLASH_CONFIG:_FLASH_CONFIG:.long 0x00000000 .long 0x00000000.long 0x00000000.long 0x00000000.long 0x00000000.long 0x00000000.end&lt;/PRE&gt;&lt;/DIV&gt;The only thing which is also needed is for the start location to be referenced somewhere in the code (dummy reference) so that the linker optimiser doesn't optimise it away..&lt;BR /&gt;&lt;BR /&gt;2. GNU (CodeSourcery)&lt;BR /&gt;Here we replace the crt1.s file from the libray (linker flag = -nostartfiles) with our own startup file.&lt;BR /&gt;This contains all assembler required in the project [152 bytes]. Then we have simply filled out the rest so that also the FLASH initialisation 'table' can be set as desired (again default all zero).&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;PRE&gt;gnu_startup.s

/* 0x98..fill out with zeros - add general purpose assember in this space if required */    .rept 256-38    .long 0x00000000            /* fill unused area */    .endr/* 0x400..0x418 is used to configure FLASH controller on initialisation */    .rept 265-257    .long 0x00000000            /* flash initialisation range - zero is general case with no protection */    .endr&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;Note that the project also include a boot loader where the first 2k FLASH sector contains code allowing decryption and FLASH programming (enables complete SW uploads via Ethernet -&lt;BR /&gt;&lt;A href="http://www.utasker.com/docs/uTasker/BM-Booloader_for_M5223X.PDF" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;http://www.utasker.com/docs/uTasker/BM-Booloader_for_M5223X.PDF&lt;/A&gt; )&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;Regards&lt;BR /&gt;&lt;BR /&gt;Mark Butcher&lt;BR /&gt;&lt;A href="http://www.uTasker.com" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;&lt;/A&gt;&lt;A href="https://community.nxp.com/www.uTasker.com" rel="nofollow noopener noreferrer noopener noreferrer" target="test_blank"&gt;www.uTasker.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;I&gt;&lt;BR /&gt;&lt;/I&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 14:46:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52235-flash-configuration-field-initialised-with-assembly/m-p/137863#M1993</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2020-11-02T14:46:10Z</dc:date>
    </item>
  </channel>
</rss>

