<?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: AN2720 Bootloader in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/AN2720-Bootloader/m-p/124700#M179</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Thought it best to reawaken this thread rather than start another separate as that which preceded me should be of help to future readers.&lt;BR /&gt;&lt;BR /&gt;AN2720 v2 was recently released. I don't have a copy of v1 but I have inherited a project which uses a bootloader obviously derived from AN2720.&lt;BR /&gt;&lt;BR /&gt;Source code files for AN2720 include the following snippet:&lt;BR /&gt;&lt;BR /&gt;EVEN ;Make code start word aliened&lt;BR /&gt;SpSub:&lt;BR /&gt;ldab SpSubEnd-SpSub+3,sp ;get PPAGE back from stack&lt;BR /&gt;stab PPAGE ;Store the PPAGE address&lt;BR /&gt;&lt;BR /&gt;But in the pdf version it says:&lt;BR /&gt;&lt;BR /&gt;ldab SpSubEnd-SpSub+2,sp ;get PPAGE back&lt;BR /&gt;&lt;BR /&gt;Am guessing the source version is correct.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Second question is about flash.c. In the pdf file Flash_Write_Word() converts 24 bit far_address into 16 bit address. Tests address for odd. Then the pdf version passes 16 bit address to DoOnStack() which is declared:&lt;BR /&gt;&lt;BR /&gt;extern DoOnStack(unsigned int *far address);&lt;BR /&gt;&lt;BR /&gt;DoOnStack() is used with far_address everywhere else in the pdf other than Flash_Write_Word(). Source file versions pass far_address. So what is the point in making a 16 bit address out of the 24 bit far_address?&lt;BR /&gt;&lt;BR /&gt;Once again it appears the source code is most correct and pdf is less correct. Correct?&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 May 2008 01:11:51 GMT</pubDate>
    <dc:creator>dkelly</dc:creator>
    <dc:date>2008-05-01T01:11:51Z</dc:date>
    <item>
      <title>AN2720 Bootloader</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/AN2720-Bootloader/m-p/124696#M175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to write an ethernet bootloader for the NE64.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've looked at a load of application notes for bootloaders, in particular AN2720.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My understanding so far....&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The NE64 has just a single 64K block of flash memory. You cannot execute code in the flash block while you are erasing or programming anywhere else in the flash block. AN2720 gets around this using the DoOnStack function which executes the critical parts of the flash erase/programming code from the stack rather than flash.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have some basic questions....&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) If I am using this functionality to re-program the whole flash block, how do I avoid overwriting the AN2720 C functions still in flash and still needing to be used ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Can I reserve some flash memory and force these functions to reside there ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3) Can I force the linker to always place the bootloader code part of my application at a certain absolute address and the rest of my application code to follow on from there ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any help,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Karl&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jul 2006 21:33:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/AN2720-Bootloader/m-p/124696#M175</guid>
      <dc:creator>williamskj</dc:creator>
      <dc:date>2006-07-21T21:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: AN2720 Bootloader</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/AN2720-Bootloader/m-p/124697#M176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;HI Karl,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks for your interest in the NE64. I think that you are going to have some problems implementing a Ethernet bootloader.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Sure, the flash on a NE64 can be programmed in situ (but with the code running from RAM) however, you're going to need some form of stack running, to be able to download&amp;nbsp; the code. Problem is, the stack will be larger than the RAM on the NE64. You're gonna need to download a page at a time (512 bytes, as I recall), cache that in RAM, then jump to RAM and write the new code, but this is all hideous. As you said, how do you ensure that you don't erase/program something that you need to go back to.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;A more elegant solution would be with the ColdFire MCF52235 device, with 256kbytes of flash, arranged as 2 banks. You can run code from one flash bank and reprogram the other, and the InterNiche Niche_Lite stack easily fits into one bank. That's just what we did with the Ethernet Seminar lab material back in 2Q06 - the stack lived in one bank and the webpages in the dynamic flash file system live in the other bank.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Aug 2006 04:53:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/AN2720-Bootloader/m-p/124697#M176</guid>
      <dc:creator>UK_CF_FAE</dc:creator>
      <dc:date>2006-08-09T04:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: AN2720 Bootloader</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/AN2720-Bootloader/m-p/124698#M177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;... but to address your linker question, have a look at the #pragma CODESEG documentation in the linker manual.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;In your code, you'll say&lt;/DIV&gt;&lt;DIV&gt;#pragma CODE_SEG MY_STUFF&amp;nbsp; //place this function where I say&lt;/DIV&gt;&lt;DIV&gt;void MyFunction(void)&lt;/DIV&gt;&lt;DIV&gt;#pragma CODE_SEG DEFAULT&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;.... and in the linker command file&lt;/DIV&gt;&lt;DIV&gt;SECTIONS&lt;/DIV&gt;&lt;DIV&gt;...&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp; MY_SPACE = READ_ONLY 0x8000 TO 0x8100;&amp;nbsp; //this is the properties for my memory area&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;PLACEMENT&lt;/DIV&gt;&lt;DIV&gt;....&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp; MY_STUFF INTO MY_SPACE&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Aug 2006 05:04:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/AN2720-Bootloader/m-p/124698#M177</guid>
      <dc:creator>UK_CF_FAE</dc:creator>
      <dc:date>2006-08-09T05:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: AN2720 Bootloader</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/AN2720-Bootloader/m-p/124699#M178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Thanks for this information. I'd actually opened a Service Request with Freescale and they said the same thing but I've not had a chance to try it out yet.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This ethernet bootloader does seem a bit challenging, particularly for an embedded&amp;nbsp;novice. I was suspicious from&amp;nbsp;the start because there's no evidence anywhere of anybody having done this yet.&lt;/DIV&gt;&lt;DIV&gt;Unfortunately I have no choice but to persevere with the NE64 - its way too late for the hardware design to change to a ColdFire processor now.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I'm having enough problems just getting AN2720 to work on the NE64. I've got another Service Request open with Freescale on this. They've replicated the problem and its been referred to the hardware engineers. I will post again if anything useful comes back from this.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Aug 2006 18:24:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/AN2720-Bootloader/m-p/124699#M178</guid>
      <dc:creator>williamskj</dc:creator>
      <dc:date>2006-08-09T18:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: AN2720 Bootloader</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/AN2720-Bootloader/m-p/124700#M179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Thought it best to reawaken this thread rather than start another separate as that which preceded me should be of help to future readers.&lt;BR /&gt;&lt;BR /&gt;AN2720 v2 was recently released. I don't have a copy of v1 but I have inherited a project which uses a bootloader obviously derived from AN2720.&lt;BR /&gt;&lt;BR /&gt;Source code files for AN2720 include the following snippet:&lt;BR /&gt;&lt;BR /&gt;EVEN ;Make code start word aliened&lt;BR /&gt;SpSub:&lt;BR /&gt;ldab SpSubEnd-SpSub+3,sp ;get PPAGE back from stack&lt;BR /&gt;stab PPAGE ;Store the PPAGE address&lt;BR /&gt;&lt;BR /&gt;But in the pdf version it says:&lt;BR /&gt;&lt;BR /&gt;ldab SpSubEnd-SpSub+2,sp ;get PPAGE back&lt;BR /&gt;&lt;BR /&gt;Am guessing the source version is correct.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Second question is about flash.c. In the pdf file Flash_Write_Word() converts 24 bit far_address into 16 bit address. Tests address for odd. Then the pdf version passes 16 bit address to DoOnStack() which is declared:&lt;BR /&gt;&lt;BR /&gt;extern DoOnStack(unsigned int *far address);&lt;BR /&gt;&lt;BR /&gt;DoOnStack() is used with far_address everywhere else in the pdf other than Flash_Write_Word(). Source file versions pass far_address. So what is the point in making a 16 bit address out of the 24 bit far_address?&lt;BR /&gt;&lt;BR /&gt;Once again it appears the source code is most correct and pdf is less correct. Correct?&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 May 2008 01:11:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/AN2720-Bootloader/m-p/124700#M179</guid>
      <dc:creator>dkelly</dc:creator>
      <dc:date>2008-05-01T01:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: AN2720 Bootloader</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/AN2720-Bootloader/m-p/124701#M180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;To be honest, we gave up on this. I'm not saying its not possible but there were too many discouraging comments from far more experienced Freescale experts. In our case it was a 'nice to have' feature and we could not justify the effort&amp;nbsp;when there was a real&amp;nbsp;risk that we would not succeed. Good luck with it though !&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 16:40:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/AN2720-Bootloader/m-p/124701#M180</guid>
      <dc:creator>williamskj</dc:creator>
      <dc:date>2008-05-02T16:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: AN2720 Bootloader</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/AN2720-Bootloader/m-p/124702#M181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;In my case I can't give up, have several thousand of these fielded and have to figure out what is happening. The bootloader/updater is based on AN2720 but gets the new firmware image from an Atmel Dataflash on SPI.&lt;BR /&gt;&lt;BR /&gt;Thinking it best that I study AN2546 and AN3391 to create a bootloader that runs completely out of RAM. But have to understand my existing bootloader well enough to cause it to install the new.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 22:41:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/AN2720-Bootloader/m-p/124702#M181</guid>
      <dc:creator>dkelly</dc:creator>
      <dc:date>2008-05-05T22:41:43Z</dc:date>
    </item>
  </channel>
</rss>

