<?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 Forcing a Software Reset in Classic/Legacy CodeWarrior</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Forcing-a-Software-Reset/m-p/189608#M4741</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have searched the Forum but I don't see an answer to my particular situation so I am hoping someone out there has done something similar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Processor -&amp;nbsp;56F8323&lt;/P&gt;&lt;P&gt;Codewarrior Version - DSC56800/E 8.1.1a&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use a section of the&amp;nbsp;Data FLASH to store some configuration data.&amp;nbsp; What I am trying to do is to implement a Factory Reset where this data is erased and then I need to restart the code so that way the Firmware will think it was just powered up for the first time after assembly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can erase the FLASH but my issue is with how to restart from address 0x0000.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) I turned on the Watch dog and the plan was to just sit in a loop until the Dog caused a reset after I erase the FLASH.&amp;nbsp; The problem I am having is the Dog seems to reset the code everytime I break in Debug mode.&amp;nbsp; I know the datasheet specifically says the Dog's timer stops running when halted in debug but for some reason it is still running and I am getting a reset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) With the Watchdog not doing what I want then my next attempt at a solution is to erase the FLASH then execute a reset command.&amp;nbsp; I have not found any kind of method to perform a Software reset.&amp;nbsp; I looked for an ASM opcode, a Reset Macro or function but I am just not seeing anything.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my question is - Can someone point me to some good information on how to fix the Watchdog when in Debug mode OR can someone point me to a good software reset method?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Jun 2009 00:39:47 GMT</pubDate>
    <dc:creator>v_dave</dc:creator>
    <dc:date>2009-06-12T00:39:47Z</dc:date>
    <item>
      <title>Forcing a Software Reset</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Forcing-a-Software-Reset/m-p/189608#M4741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have searched the Forum but I don't see an answer to my particular situation so I am hoping someone out there has done something similar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Processor -&amp;nbsp;56F8323&lt;/P&gt;&lt;P&gt;Codewarrior Version - DSC56800/E 8.1.1a&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use a section of the&amp;nbsp;Data FLASH to store some configuration data.&amp;nbsp; What I am trying to do is to implement a Factory Reset where this data is erased and then I need to restart the code so that way the Firmware will think it was just powered up for the first time after assembly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can erase the FLASH but my issue is with how to restart from address 0x0000.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) I turned on the Watch dog and the plan was to just sit in a loop until the Dog caused a reset after I erase the FLASH.&amp;nbsp; The problem I am having is the Dog seems to reset the code everytime I break in Debug mode.&amp;nbsp; I know the datasheet specifically says the Dog's timer stops running when halted in debug but for some reason it is still running and I am getting a reset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) With the Watchdog not doing what I want then my next attempt at a solution is to erase the FLASH then execute a reset command.&amp;nbsp; I have not found any kind of method to perform a Software reset.&amp;nbsp; I looked for an ASM opcode, a Reset Macro or function but I am just not seeing anything.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my question is - Can someone point me to some good information on how to fix the Watchdog when in Debug mode OR can someone point me to a good software reset method?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2009 00:39:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Forcing-a-Software-Reset/m-p/189608#M4741</guid>
      <dc:creator>v_dave</dc:creator>
      <dc:date>2009-06-12T00:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: Forcing a Software Reset</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Forcing-a-Software-Reset/m-p/189609#M4742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, I found a simple solution and it works just fine for my application:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
   Data_IFsh1_EraseSector(FLASH_Init);   asm(jmp 0x00);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just erase the FLASH sector then jump to address 0x000.&amp;nbsp; It was just a little to simple for me to see at first.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone has a better way I would be glad to hear it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:41:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Forcing-a-Software-Reset/m-p/189609#M4742</guid>
      <dc:creator>v_dave</dc:creator>
      <dc:date>2020-10-29T09:41:01Z</dc:date>
    </item>
  </channel>
</rss>

