<?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>CodeWarrior for MCUのトピックRe: Flash Programming: CW-Debugger vs. TCL vs. TTF</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Flash-Programming-CW-Debugger-vs-TCL-vs-TTF/m-p/497314#M12688</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to complete this post - the PROGHCS08 utility (from P&amp;amp;E-Micro) indeed resolves the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a usage example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C:\PEMicro\PROGHCS08\cproghcs08.exe prog.cfg INTERFACE=USBMULTILINK PORT=USB1 /logfile prog.log&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where file prog.cfg contains the flash-programming sequence.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;RE ;Reset the MCU&lt;/P&gt;&lt;P&gt;CM C:\Freescale\CW MCU v10.6\MCU\bin\Plugins\support\hc08\gdi\P&amp;amp;E\9s08qg4.s8p ;Choose Flash Module&lt;/P&gt;&lt;P&gt;EM ;Erase the module&lt;/P&gt;&lt;P&gt;SS ImageFileName.s19 ;Specify the S19 to use&lt;/P&gt;&lt;P&gt;PM ;Program the module with the S19&lt;/P&gt;&lt;P&gt;VC ;Verify CRC of Object File to Module&lt;/P&gt;&lt;P&gt;PT ;Program trim value&lt;/P&gt;&lt;P&gt;RE ;Reset the MCU&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your help :smileyhappy:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 May 2016 05:36:05 GMT</pubDate>
    <dc:creator>barakmanos</dc:creator>
    <dc:date>2016-05-30T05:36:05Z</dc:date>
    <item>
      <title>Flash Programming: CW-Debugger vs. TCL vs. TTF</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Flash-Programming-CW-Debugger-vs-TCL-vs-TTF/m-p/497311#M12685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a problem that I’ve been struggling with unsuccessfully (as of yet).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using CW Target Tasks in order to burn (program) an image to flash.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My target MCU is MC9S08QG4.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have configured the task (TTF file) to execute the following operations:&lt;BR /&gt;– Unprotect all sectors&lt;BR /&gt;– Erase all sectors&lt;BR /&gt;– Program image&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Flash address range is 0xF000 thru 0xFFFF.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For all it matters (though I don’t think that it has anything to do with the problem at hand), the security bits (SEC01:SEC00) are located at 0xFFBF.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, this task occasionally fails.&lt;BR /&gt;The output I get in the console varies.&lt;BR /&gt;Here are a few examples:&lt;BR /&gt;– Error: Erase sector failed. Operation timeout.&lt;BR /&gt;– Error: Protect Command Failed. Operation timeout.Failed to erase sector data.&lt;BR /&gt;– Error: Detect frequence Loop count suspended&lt;BR /&gt;– Error: Can’t resume target HC/RS/S12Z GDI Protocol Adapter : An error occurred while trying to write registers. The Debugger can not write one register.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it helps, then you can see the entire output (successful and non-successful cases) at:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" data-containerid="2028" data-containertype="14" data-objectid="391365" data-objecttype="1" href="https://community.nxp.com/thread/391365"&gt;https://community.freescale.com/thread/391365&lt;/A&gt;.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, I would normally suspect the HW (power supply, cable length, CPU clock / oscillator, physical connections, etc).&lt;/P&gt;&lt;P&gt;However, when I program the same image via the debugger (i.e., Run Configuration –&amp;gt; Debug), it &lt;STRONG&gt;always&lt;/STRONG&gt; completes successfully.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So there is definitely a “soft” way to resolve the problem that I am experiencing, and I am left to conclude that the CW debugger performs additional operations during the image-download procedure (operations which I have skipped in my task).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The question is – what exactly &lt;STRONG&gt;are&lt;/STRONG&gt; these operations?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have searched through my project’s Run/Debug settings, but I have not found anything to explain it. In fact, I feel quite limited in the ability to even compare the two methods, as they seem to be using a different interface and/or language:&lt;BR /&gt;– The target task uses TCL (though the TTF file is in XML format, so I don’t quite see how I can add TCL commands to it anyway).&lt;BR /&gt;– The CW image-download procedure runs via some other functionality, which I do not fully understand.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One way to see what CW is actually doing “behind the scene”, is by enabling the Flash Programming Dialog option (in the project’s launch-configuration).&lt;BR /&gt;This is a very clumsy utility (dialog-box) which disappears automatically as soon as the image-download process completes, so I need to disconnect the MCU during the process, and be extremely lucky in order to see the entire log up to the point when it’s done.&lt;BR /&gt;To make it worse, it doesn’t even allow you to copy the text (though I could “live with that”).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In any case, here is what I’ve managed to get from that dialog-box (not including what I believe is just “status messages”):&lt;BR /&gt;CMD&amp;gt;RE&lt;BR /&gt;CMD&amp;gt;CM C:\Freescale\CW MCU v10.6\MCU\bin\Plugins\support\hc08\gdi\P&amp;amp;E\9s08gq4.s8p&lt;BR /&gt;CMD&amp;gt;EM&lt;BR /&gt;CMD&amp;gt;PM&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I suppose that the above is equivalent to Reset, Erase, Program (and that an additional Verify or something similar would probably follow). But how can I emulate that using TCL (or if possible, how can I add it in the TTF file)?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following description in the MCU’s data-sheet provides me with a good reason to suspect that CW sets the FCDIV register during the process:&lt;BR /&gt;“Before any program or erase command can be accepted, the FLASH clock divider register (FCDIV) must be written to set the internal clock for the FLASH module to a frequency between 150 kHz and 200 kHz. This register can be written only once, so normally this write is done during reset initialization.”.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I can’t see how to access chip registers via TCL (and most certainly via TTF).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have also posted this question on Erich Styger's blog, at:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fmcuoneclipse.com%2F2012%2F08%2F03%2Fcodewarrior-flash-programming-from-a-dos-shell%2F" rel="nofollow" target="_blank"&gt;https://mcuoneclipse.com/2012/08/03/codewarrior-flash-programming-from-a-dos-shell/&lt;/A&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for reading through &lt;SPAN aria-label="Happy" class="emoticon_happy emoticon-inline" style="height:16px;width:16px;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2016 17:32:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Flash-Programming-CW-Debugger-vs-TCL-vs-TTF/m-p/497311#M12685</guid>
      <dc:creator>barakmanos</dc:creator>
      <dc:date>2016-05-24T17:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Programming: CW-Debugger vs. TCL vs. TTF</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Flash-Programming-CW-Debugger-vs-TCL-vs-TTF/m-p/497312#M12686</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;One possible cause of your problem is clock trim.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one difference between debugging from Simple Flash/Task&amp;nbsp;&amp;nbsp; and debugger is that:&amp;nbsp; TRIM can work for debug while not for Simple Flash/Task.&lt;/P&gt;&lt;P&gt;that's to say, &lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;We can only use debugger to perform &lt;STRONG&gt;trim&lt;/STRONG&gt; but can’t with CW standalone programmer in the same way. &lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;CW is a professional development tool(edit, built, debug), but not professional standalone programmer.&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;If user need advance feature in standalone programmer, we need other 3rd programmer software.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;&lt;A href="http://www.pemicro.com/products/product_viewDetails.cfm?product_id=27"&gt;http://www.pemicro.com/products/product_viewDetails.cfm?product_id=27&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Jennie Zhang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2016 09:27:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Flash-Programming-CW-Debugger-vs-TCL-vs-TTF/m-p/497312#M12686</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2016-05-26T09:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Programming: CW-Debugger vs. TCL vs. TTF</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Flash-Programming-CW-Debugger-vs-TCL-vs-TTF/m-p/497313#M12687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jennie&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Funny enough, the two issues that you've mentioned (TRIM value and PE-Micro product) are the exact same conclusions that I've reached during my investigation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. I have noticed the TRIM in the Advanced Options configuration window (below), and I suspected that it could be the difference between the debugger operation and a standalone task... But I did not suspect it to the point where I thought I should bring it up to your attention.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="adv_opt_win.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/58818iBBA181E21E4FA654/image-size/large?v=v2&amp;amp;px=999" role="button" title="adv_opt_win.png" alt="adv_opt_win.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. I have already (yesterday) ordered PE-Micro's Command-Line Flash-Programming utility (well, to be precise, I ordered PROG08SZ by mistake, and then had to change it to PROGHCS08).&lt;/P&gt;&lt;P&gt;However, there is one thing left unclear to me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By enabling the Flash-Programming Dialog (in the window above), I can clearly see the operations executed by this utility.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I have previously described, I see the following text:&lt;/P&gt;&lt;P&gt;CMD&amp;gt;RE&lt;BR /&gt;CMD&amp;gt;CM C:\Freescale\CW MCU v10.6\MCU\bin\Plugins\support\hc08\gdi\P&amp;amp;E\9s08gq4.s8p&lt;BR /&gt;CMD&amp;gt;EM&lt;BR /&gt;CMD&amp;gt;PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So one way or another, this utility is already installed on my computer.&lt;/P&gt;&lt;P&gt;I'm not sure whether it comes along with CW installation or with PE-Micro drivers, but common sense tells me that it's "gotta be there".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would you be able to explain why I need to purchase a product that appears to be running on my PC every time I download (burn) my program with CW?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2016 11:24:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Flash-Programming-CW-Debugger-vs-TCL-vs-TTF/m-p/497313#M12687</guid>
      <dc:creator>barakmanos</dc:creator>
      <dc:date>2016-05-26T11:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Programming: CW-Debugger vs. TCL vs. TTF</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Flash-Programming-CW-Debugger-vs-TCL-vs-TTF/m-p/497314#M12688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to complete this post - the PROGHCS08 utility (from P&amp;amp;E-Micro) indeed resolves the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a usage example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C:\PEMicro\PROGHCS08\cproghcs08.exe prog.cfg INTERFACE=USBMULTILINK PORT=USB1 /logfile prog.log&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where file prog.cfg contains the flash-programming sequence.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;RE ;Reset the MCU&lt;/P&gt;&lt;P&gt;CM C:\Freescale\CW MCU v10.6\MCU\bin\Plugins\support\hc08\gdi\P&amp;amp;E\9s08qg4.s8p ;Choose Flash Module&lt;/P&gt;&lt;P&gt;EM ;Erase the module&lt;/P&gt;&lt;P&gt;SS ImageFileName.s19 ;Specify the S19 to use&lt;/P&gt;&lt;P&gt;PM ;Program the module with the S19&lt;/P&gt;&lt;P&gt;VC ;Verify CRC of Object File to Module&lt;/P&gt;&lt;P&gt;PT ;Program trim value&lt;/P&gt;&lt;P&gt;RE ;Reset the MCU&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your help :smileyhappy:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2016 05:36:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Flash-Programming-CW-Debugger-vs-TCL-vs-TTF/m-p/497314#M12688</guid>
      <dc:creator>barakmanos</dc:creator>
      <dc:date>2016-05-30T05:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Programming: CW-Debugger vs. TCL vs. TTF</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Flash-Programming-CW-Debugger-vs-TCL-vs-TTF/m-p/497315#M12689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;the P&amp;amp;E utility you mentioned coming with CW install can not work standalone. it can only work inside CW but can't work as PROGHCS08 utility you ordered from P&amp;amp;E.&lt;/P&gt;&lt;P&gt;this is commercial issue and market decision.&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jennie Zhang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2016 09:08:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Flash-Programming-CW-Debugger-vs-TCL-vs-TTF/m-p/497315#M12689</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2016-05-30T09:08:59Z</dc:date>
    </item>
  </channel>
</rss>

