<?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: First longword write to flash fails with illegal address.  It works if you set a breakpoint one instruction after the write (0x80 to fstat). All protection registers have default values following reset.. in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/First-longword-write-to-flash-fails-with-illegal-address-It/m-p/470855#M12693</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that is normal, and catches a lot of people out. Here's the last one:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/389552"&gt;Flash Logical Block in MCF52235&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why don\t they make FLASH chips where you can read them while they're programming? It would take a lot more silicon to do that and would make the chips cost a lot more. So they don't.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 04 Jun 2016 04:38:47 GMT</pubDate>
    <dc:creator>TomE</dc:creator>
    <dc:date>2016-06-04T04:38:47Z</dc:date>
    <item>
      <title>First longword write to flash fails with illegal address.  It works if you set a breakpoint one instruction after the write (0x80 to fstat). All protection registers have default values following reset..</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/First-longword-write-to-flash-fails-with-illegal-address-It/m-p/470853#M12691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assembly language.&amp;nbsp; mcf51jm128.&amp;nbsp; A longword write&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2016 15:21:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/First-longword-write-to-flash-fails-with-illegal-address-It/m-p/470853#M12691</guid>
      <dc:creator>waynestewart</dc:creator>
      <dc:date>2016-06-01T15:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: First longword write to flash fails with illegal address.  It works if you set a breakpoint one instruction after the write (0x80 to fstat). All protection registers have default values following reset..</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/First-longword-write-to-flash-fails-with-illegal-address-It/m-p/470854#M12692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It appears that the entire flash memory is unavailable.&amp;nbsp; Not just the sector your are writing.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2016 16:17:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/First-longword-write-to-flash-fails-with-illegal-address-It/m-p/470854#M12692</guid>
      <dc:creator>waynestewart</dc:creator>
      <dc:date>2016-06-01T16:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: First longword write to flash fails with illegal address.  It works if you set a breakpoint one instruction after the write (0x80 to fstat). All protection registers have default values following reset..</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/First-longword-write-to-flash-fails-with-illegal-address-It/m-p/470855#M12693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that is normal, and catches a lot of people out. Here's the last one:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/389552"&gt;Flash Logical Block in MCF52235&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why don\t they make FLASH chips where you can read them while they're programming? It would take a lot more silicon to do that and would make the chips cost a lot more. So they don't.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Jun 2016 04:38:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/First-longword-write-to-flash-fails-with-illegal-address-It/m-p/470855#M12693</guid>
      <dc:creator>TomE</dc:creator>
      <dc:date>2016-06-04T04:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: First longword write to flash fails with illegal address.  It works if you set a breakpoint one instruction after the write (0x80 to fstat). All protection registers have default values following reset..</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/First-longword-write-to-flash-fails-with-illegal-address-It/m-p/470856#M12694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First please be note that in the case of the ColdFire V1, the code must be executed from RAM in order to perform this operation. &lt;/P&gt;&lt;P&gt;Flash routines are physically stored in ROM. At software startup, "__copy_rom_sections_to_ram" function will copy them to RAM, as defined by __S_romp table in the linker definition file.&lt;/P&gt;&lt;P&gt;It’s important to mention that all the flash writes and erase must be performed with longword aligned addresses. If you try to write to a non-aligned location (i.e. 0x10001) the device will return an address error. &lt;/P&gt;&lt;P&gt;This is the reason why you’ll see that for the ColdFire all the pointers and addresses are declared as long and the addresses are longword aligned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now that the code is in RAM, you can use the routines to write and erase flash. &lt;/P&gt;&lt;P&gt;It is very important to set FCDIV correctly depending on the bus frequency (to get flash programming clock frequency between 150 kHz and 200 kHz). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The functions in the example are:&lt;/P&gt;&lt;P&gt;Flash_SectorErase(Address);&lt;/P&gt;&lt;P&gt;This definition erases a flash sector (1024 bytes); the parameter sent is a 32-bit address within that sector.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Flash_Program(Address, Data);&lt;/P&gt;&lt;P&gt;This one is used to program a longword for the ColdFire into the Flash; you have to sent the 32-bit address and a variable containing the data to be programmed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Flash_BurstProgram(Address, Pointer, Size); The last definition is used to program an array into flash; the parameters needed are the address, the pointer to the buffer where the data that will be programmed is and the amount of longwords to be programmed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to mention, that internal flash is very nicely described in the MCF51JM128 Reference Manual in the section 4.4. It shows state diagrams of a flow of all flash commands.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2016 08:09:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/First-longword-write-to-flash-fails-with-illegal-address-It/m-p/470856#M12694</guid>
      <dc:creator>miduo</dc:creator>
      <dc:date>2016-06-13T08:09:48Z</dc:date>
    </item>
  </channel>
</rss>

