<?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: Programming MC1321x from Linux in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Programming-MC1321x-from-Linux/m-p/209469#M17883</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Lineage,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;try look at this thread:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&amp;amp;thread.id=9971" target="_blank"&gt;http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&amp;amp;thread.id=9971&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;BR,&lt;/DIV&gt;&lt;DIV&gt;Mads&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Apr 2008 21:57:58 GMT</pubDate>
    <dc:creator>Mads</dc:creator>
    <dc:date>2008-04-03T21:57:58Z</dc:date>
    <item>
      <title>Programming MC1321x from Linux</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Programming-MC1321x-from-Linux/m-p/209467#M17881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'd like to be able to program the flash on a MC1321x Zigbee board from a linux host. Ideally using the embedded boot loader or using the P&amp;amp;E USB Multilink. I have .s19 files, I just want to load them without having to go find an MS-Windows machine every time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a linux version of the embedded bootloader app?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a doc anywhere that has the 'on-the-wire' protocol for the embedded bootloader so I can write an app?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone got any ideas? The CPU is an MC9S08.&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Apr 2008 16:23:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Programming-MC1321x-from-Linux/m-p/209467#M17881</guid>
      <dc:creator>lineage</dc:creator>
      <dc:date>2008-04-03T16:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Programming MC1321x from Linux</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Programming-MC1321x-from-Linux/m-p/209468#M17882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'll answer my own question having found AN2295 in case its of use to anyone else.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AN2295 is a simple resident bootloader. Bit like the embedded one, but documented :smileywink:&lt;BR /&gt;Grab the AN and the AN2295SW, unpack it. There is a master(host) and target section.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First sort out the linux loader (master) end:&lt;BR /&gt;The loader almost built without a hitch. The only minor issue was undefined strnicmp function on my system. Easilly 'kludged'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cd an2295sw/master/&lt;BR /&gt;edit prog.c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;add:&amp;nbsp;&amp;nbsp;&amp;nbsp; #define strnicmp strncasecmp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then it will make&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;P&gt;Then sort out the slave end:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;load up codewarrior&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;open an2295sw/HC08 bootloader/HC08 bootloader.mcp&lt;BR /&gt;find the&amp;nbsp; hc08sprg-&amp;gt;S08-&amp;gt;hc08sprg-08gbgt.mcp branch&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the main controller unit, on the targets tab, select the&lt;BR /&gt;"S08GB/GT60(A) SCI1, MC1321x" target which creates&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; an2295sw/src/S08GBGT/bin/hc08sprg-s08gbgt60-sci1.abs.s19&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will work on the DSUB-9 port&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "S08GB/GT60(A) SCI2" target makes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; an2295sw/src/S08GBGT/bin/hc08sprg-s08gbgt60-sci2.abs.s19&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which works using the USB port on either the NCB or SRB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to do a one-time load with a BDM. I used a P&amp;amp;E USB Multilink and Test Tool (which you can get from &lt;A href="http://www.freescale.com/webapp/sps/site/overview.jsp?code=ZIGBEE"&gt;www.freescale.com/zigbee&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you have got the loader in there all you do is;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Run the hc08sprg loader on the linux system and just dab the reset button on the module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As the module resets it mumbles to the loader and that stops the rest of the boot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Typical output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;localhost:cas:master&amp;gt;./hc08sprg /dev/ttyUSB1 9600 "Wireless UART SRB.S19"&lt;BR /&gt;---------------------------------------------------------------------------&lt;BR /&gt;hc08sprg - Developer's Serial Bootloader for HC(S)08 - $Version: 9.0.37.0$&lt;BR /&gt;---------------------------------------------------------------------------&lt;BR /&gt;FC protocol versions supported:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x01 (HC08)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x03 (large HC08)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x02 (S08)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x06 (long S08)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x0A (large S08)&lt;BR /&gt;---------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parsed S-record lines: 133&amp;nbsp; Bytes total: 4163&lt;BR /&gt;Source address range: 0x182C-0xFFFF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Waiting for HC(S)08 reset ACK...received 0x2f (ignoring).&lt;BR /&gt;received 0x0f (ignoring).&lt;BR /&gt;received 0xe2 (ignoring).&lt;BR /&gt;received 0xe2 (ignoring).&lt;BR /&gt;--- the above is just junk output from the code running on the SRB&lt;BR /&gt;--- I hit reset at this point&lt;BR /&gt;received 0xfc (good).&lt;BR /&gt;Calibration break pulse sent. Count: 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bootloader protocol version: 0x02 (S08, read command supported)&lt;BR /&gt;Bootloader version string: GB/GT60(A)&lt;BR /&gt;System device ID: 0x002 [MC9S08(GB/GT)(32-60),MC1321x] rev. 8&lt;BR /&gt;Number of memory blocks: 2&lt;BR /&gt;Memory block #1: 0x1080-0x17FF&lt;BR /&gt;Memory block #2: 0x182C-0xFDBF&lt;BR /&gt;Erase block size: 512 bytes&lt;BR /&gt;Write block size: 128 bytes&lt;BR /&gt;Original vector table: 0xFFC0-0xFFFF&lt;BR /&gt;New vector table:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xFDC0-0xFDFF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you sure to program part? [y/N]: y&lt;BR /&gt;Memory programmed:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100%&lt;BR /&gt;Memory verified:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hit reset again and your code is running!&lt;BR /&gt;So far, seems to work OK.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Apr 2008 19:17:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Programming-MC1321x-from-Linux/m-p/209468#M17882</guid>
      <dc:creator>lineage</dc:creator>
      <dc:date>2008-04-03T19:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Programming MC1321x from Linux</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Programming-MC1321x-from-Linux/m-p/209469#M17883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Lineage,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;try look at this thread:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&amp;amp;thread.id=9971" target="_blank"&gt;http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&amp;amp;thread.id=9971&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;BR,&lt;/DIV&gt;&lt;DIV&gt;Mads&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Apr 2008 21:57:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Programming-MC1321x-from-Linux/m-p/209469#M17883</guid>
      <dc:creator>Mads</dc:creator>
      <dc:date>2008-04-03T21:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: Programming MC1321x from Linux</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Programming-MC1321x-from-Linux/m-p/209470#M17884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Mads,&lt;BR /&gt;&lt;BR /&gt;Thanks - intersting site. The CW/SDCC comparison is useful too.&lt;BR /&gt;I'm guessing the programming dongle there wont work on the MC1321x BDM port though..&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Apr 2008 22:54:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Programming-MC1321x-from-Linux/m-p/209470#M17884</guid>
      <dc:creator>lineage</dc:creator>
      <dc:date>2008-04-03T22:54:39Z</dc:date>
    </item>
  </channel>
</rss>

