<?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>ColdFire/68K Microcontrollers and Processors中的主题 Re: mcf54415 sbf header and boot issue</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/mcf54415-sbf-header-and-boot-issue/m-p/666486#M13209</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I haven't ever done this, I'm just reading the manual. From there, the SBF bytes should be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;00&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; Four zero bits for sync, then 4 bits of BLDIV&lt;/P&gt;&lt;P&gt;00 20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x2000 (8k longs or 32k bytes)&lt;/P&gt;&lt;P&gt;61 00 0F 01&amp;nbsp;&amp;nbsp; 0x010F0061 - 32 bit muxed, NAND, PLL Div 1, 0x0F, other dividers&lt;/P&gt;&lt;P&gt;==== Code Follows ====&lt;/P&gt;&lt;P&gt;00 00 00 00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Stack Pointer is ZERO?&lt;/P&gt;&lt;P&gt;80 00 00 8C&amp;nbsp;&amp;nbsp;&amp;nbsp; Initial Program Counter in SRAM at 8000008c or 8c000000&lt;/P&gt;&lt;P&gt;47 E0 04 B6&amp;nbsp;&amp;nbsp;&amp;nbsp; These are meant to be Interrupt Vectors. Those addresses aren't in RAM?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you sure the BLDIV is appropriate for your clock rate? What is the SPI clock and is it "legal" for your memory chip? At least you can measure this with your scope.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm surprised at the above as it is reading the SPI Flash in LITTLE_ENDIAN order, and this is a BIG_ENDIAN CPU. It is documented as reading the "Length" in little-endian, so maybe it reads all the code the same way. It doesn't say at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is reading the code big-endian, then the code starts at 0x8000008C, or at "93" in your dump, which is "46FC 2700 203C 8000 0000", or:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;46FC 2700&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; move.w #2700, %sr&lt;/P&gt;&lt;P&gt;203C 8000 0000&amp;nbsp;&amp;nbsp; move.l #80000000, %d0 (maybe)&lt;/P&gt;&lt;P&gt;4EB7&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;&amp;nbsp; jmp (somewhere)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, that looks like your code. Are you sure you don't want to set up a stack pointer in the vector table? And where did those vector addresses come from? I'm guessing the bootstrap copies itself to SDRAM (0x40000000) after setting it up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if the SBF is reading the rest of the chip little-endian, then you code is going to end up scrambled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Type "SBF" into the Search Bar on this page and see if anything else shows up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can get a copy of a working SPI Flash image, you can disassemble it like I did to work out what order the bytes are in. Use the table in the "CFPRM.pdf" document to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure you get a copy of the older version of the manual. The new one has one of the chapters broken. Read here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/message/306792"&gt;https://community.nxp.com/message/306792&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 May 2017 07:03:50 GMT</pubDate>
    <dc:creator>TomE</dc:creator>
    <dc:date>2017-05-30T07:03:50Z</dc:date>
    <item>
      <title>mcf54415 sbf header and boot issue</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/mcf54415-sbf-header-and-boot-issue/m-p/666485#M13208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am trying booting u-boot using SBF and a SPI NOR flash. I am actually flashing the spi NOR with a small tool i did running from sram.&lt;/P&gt;&lt;P&gt;So, i program the SPI NOR with an u-boot (derived from the fsl TWR system, so same start.S) but prepending the binary with the 7 bytes of sbf header just before.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Screenshot_20170530_001205.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/19405iC314998095B03ED9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot_20170530_001205.png" alt="Screenshot_20170530_001205.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;So from the above SBF header i would boot just a chunk of 32k. I see by scope 32k of data read from the SPI NOR correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Btw, no code seems executed just after this load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible this is due to some incorrect SBF_RCON setup ?&lt;/P&gt;&lt;P&gt;I have a 30Mhz crystal so if anyone have a sbf header i can test, as proven to work, that's welcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;angelo&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 May 2017 22:13:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/mcf54415-sbf-header-and-boot-issue/m-p/666485#M13208</guid>
      <dc:creator>angelo_d</dc:creator>
      <dc:date>2017-05-29T22:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: mcf54415 sbf header and boot issue</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/mcf54415-sbf-header-and-boot-issue/m-p/666486#M13209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I haven't ever done this, I'm just reading the manual. From there, the SBF bytes should be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;00&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; Four zero bits for sync, then 4 bits of BLDIV&lt;/P&gt;&lt;P&gt;00 20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x2000 (8k longs or 32k bytes)&lt;/P&gt;&lt;P&gt;61 00 0F 01&amp;nbsp;&amp;nbsp; 0x010F0061 - 32 bit muxed, NAND, PLL Div 1, 0x0F, other dividers&lt;/P&gt;&lt;P&gt;==== Code Follows ====&lt;/P&gt;&lt;P&gt;00 00 00 00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Stack Pointer is ZERO?&lt;/P&gt;&lt;P&gt;80 00 00 8C&amp;nbsp;&amp;nbsp;&amp;nbsp; Initial Program Counter in SRAM at 8000008c or 8c000000&lt;/P&gt;&lt;P&gt;47 E0 04 B6&amp;nbsp;&amp;nbsp;&amp;nbsp; These are meant to be Interrupt Vectors. Those addresses aren't in RAM?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you sure the BLDIV is appropriate for your clock rate? What is the SPI clock and is it "legal" for your memory chip? At least you can measure this with your scope.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm surprised at the above as it is reading the SPI Flash in LITTLE_ENDIAN order, and this is a BIG_ENDIAN CPU. It is documented as reading the "Length" in little-endian, so maybe it reads all the code the same way. It doesn't say at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is reading the code big-endian, then the code starts at 0x8000008C, or at "93" in your dump, which is "46FC 2700 203C 8000 0000", or:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;46FC 2700&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; move.w #2700, %sr&lt;/P&gt;&lt;P&gt;203C 8000 0000&amp;nbsp;&amp;nbsp; move.l #80000000, %d0 (maybe)&lt;/P&gt;&lt;P&gt;4EB7&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;&amp;nbsp; jmp (somewhere)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, that looks like your code. Are you sure you don't want to set up a stack pointer in the vector table? And where did those vector addresses come from? I'm guessing the bootstrap copies itself to SDRAM (0x40000000) after setting it up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if the SBF is reading the rest of the chip little-endian, then you code is going to end up scrambled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Type "SBF" into the Search Bar on this page and see if anything else shows up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can get a copy of a working SPI Flash image, you can disassemble it like I did to work out what order the bytes are in. Use the table in the "CFPRM.pdf" document to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure you get a copy of the older version of the manual. The new one has one of the chapters broken. Read here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/message/306792"&gt;https://community.nxp.com/message/306792&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 07:03:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/mcf54415-sbf-header-and-boot-issue/m-p/666486#M13209</guid>
      <dc:creator>TomE</dc:creator>
      <dc:date>2017-05-30T07:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: mcf54415 sbf header and boot issue</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/mcf54415-sbf-header-and-boot-issue/m-p/666487#M13210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the "family" support, seems we are few "lonely" coldfire cowboys now a day :smileyhappy:&lt;/P&gt;&lt;P&gt;SOLVED.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ok i try to explain what happen, if some day some other developer pass from here with a similar issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) as Tom explained, SBF header CODE LENGTH (2 bytes) and SBF_RCON header (4 bytes), for mcf5441X,&lt;/P&gt;&lt;P&gt;must be written "little endian" into the SPI NOR. Strange but true :smileyhappy:&lt;/P&gt;&lt;P&gt;2) as Tom explained, another important thing is to set a quite low clock setup in SBF_RCON fields, or a too high clock (not supported from spi nor) screw up the program loading.&lt;/P&gt;&lt;P&gt;3) rest of the code can be written "as is", as produced from the compiler, so addresses are "big endian"&lt;/P&gt;&lt;P&gt;4) note that length must be in longwords and total code must not exceed 64KB of internal SRAM or the code in excess is anyway read and probably wrapped around that limit back to 0x80000000 screwing up the boot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I paste here below a working sbf header for mcf54415 and a 30Mhz crytal, tested by a square wave on gpios.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Screenshot_20170530_222829.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/19649i192CAB2A602F4C37/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot_20170530_222829.png" alt="Screenshot_20170530_222829.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;still many thanks Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;angelo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 20:31:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/mcf54415-sbf-header-and-boot-issue/m-p/666487#M13210</guid>
      <dc:creator>angelo_d</dc:creator>
      <dc:date>2017-05-30T20:31:40Z</dc:date>
    </item>
  </channel>
</rss>

