<?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: Can not exit Bus Fault Handler in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Can-not-exit-Bus-Fault-Handler/m-p/493068#M30482</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;My problem is that corrupted flash causes a fault exception to be generated when read. So I can not check the data with a CRC because I can not read the data from flash.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Thanks I check this as soon as possible.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 29 May 2016 21:22:37 GMT</pubDate>
    <dc:creator>ralf1694</dc:creator>
    <dc:date>2016-05-29T21:22:37Z</dc:date>
    <item>
      <title>Can not exit Bus Fault Handler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Can-not-exit-Bus-Fault-Handler/m-p/493062#M30476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. I have the problem, that I can not exit the Bus Fault Handler.&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;startup:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BusFault_Handler\&lt;/P&gt;&lt;P&gt;&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; PROC&lt;/P&gt;&lt;P&gt;&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; EXPORT&amp;nbsp; BusFault_Handler&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [WEAK]&lt;/P&gt;&lt;P&gt;&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; IMPORT&amp;nbsp; BusFault_ISR_Handler&lt;/P&gt;&lt;P&gt;&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; LDR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; R0, =BusFault_ISR_Handler&lt;/P&gt;&lt;P&gt;&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; BX&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; R0&lt;/P&gt;&lt;P&gt;&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; ENDP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;main(){&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;//Enalbe Bus Fault exception&lt;/P&gt;&lt;P&gt;SCB-&amp;gt;SHCSR |= SCB_SHCSR_BUSFAULTENA_Msk;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void BusFault_ISR_Handler(void){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int test = 1;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2016 13:05:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Can-not-exit-Bus-Fault-Handler/m-p/493062#M30476</guid>
      <dc:creator>ralf1694</dc:creator>
      <dc:date>2016-05-23T13:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Can not exit Bus Fault Handler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Can-not-exit-Bus-Fault-Handler/m-p/493063#M30477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Oliver,&lt;/P&gt;&lt;P&gt;Thank you for your interest in NXP Semiconductor product and&lt;/P&gt;&lt;P&gt;I was wondering if you can tell what the exactly chip you use, and it will help me to investigate the issue.&lt;BR /&gt;Have a great day,&lt;BR /&gt;Ping&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>Tue, 24 May 2016 01:31:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Can-not-exit-Bus-Fault-Handler/m-p/493063#M30477</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2016-05-24T01:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Can not exit Bus Fault Handler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Can-not-exit-Bus-Fault-Handler/m-p/493064#M30478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. I use the MK22FX512VLH12.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I write 2 times the same Flash address to provoke an bus error.&lt;/P&gt;&lt;P&gt;When I am reading this address, I jump in the Bus Fault ISR but can not leave them.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 May 2016 13:31:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Can-not-exit-Bus-Fault-Handler/m-p/493064#M30478</guid>
      <dc:creator>ralf1694</dc:creator>
      <dc:date>2016-05-27T13:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: Can not exit Bus Fault Handler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Can-not-exit-Bus-Fault-Handler/m-p/493065#M30479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bus Faults generally point out fatal firmware flaws.&amp;nbsp; A 'return' to re-execute the offending code will cause the fault to recur.&amp;nbsp; In what context do you see a 'return from bus fault' being a useful concept?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 May 2016 14:19:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Can-not-exit-Bus-Fault-Handler/m-p/493065#M30479</guid>
      <dc:creator>egoodii</dc:creator>
      <dc:date>2016-05-27T14:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: Can not exit Bus Fault Handler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Can-not-exit-Bus-Fault-Handler/m-p/493066#M30480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I use the fault to find corruption on flash memory.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 May 2016 14:02:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Can-not-exit-Bus-Fault-Handler/m-p/493066#M30480</guid>
      <dc:creator>ralf1694</dc:creator>
      <dc:date>2016-05-29T14:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can not exit Bus Fault Handler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Can-not-exit-Bus-Fault-Handler/m-p/493067#M30481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't understand what that statement means.&amp;nbsp; Most of us find 'corruption' in Flash memory contents by running a CRC over it as part of BIST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you are still going to pursue this concept:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ARM 'fault process' pushes a special frame onto the stack, a 'coded value' into LX, and some extra 'fault info' in core control registers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You say you 'cannot exit' the handler, and let me speculate the cause: 'Imprecise error' is SET, and this means the core-control registers contain 'limited useful content', and the LX code-value may be one the hardware recognizes as 'non viable' return info. This means the fault occurred NOT as a 'direct result' of the 'current' instruction. The 'most particular' cause of such is a 'write fault', because this ARM architecture has 'write buffers' to improve performance by allowing code to proceed while the actual write-op works thru arbs and busses to completion.&amp;nbsp; So the detection that said 'write' is 'bad' is 'many cycles removed' from the causing-instruction, and thus the 'capture' by hardware of processor-state at THAT instant is 'way-late' and non-informative -- the faulting instruction CANNOT be found and re-started.&amp;nbsp; To make write-faults PRECISE you must turn off the write-buffering capability in THAT system-control register.&amp;nbsp; Only in THAT mode COULD you look at the offending information, run a 'corrective action' (like enabling a peripheral clock, or paging-in a block of memory...) and return to let the instruction re-run.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 May 2016 15:21:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Can-not-exit-Bus-Fault-Handler/m-p/493067#M30481</guid>
      <dc:creator>egoodii</dc:creator>
      <dc:date>2016-05-29T15:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can not exit Bus Fault Handler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Can-not-exit-Bus-Fault-Handler/m-p/493068#M30482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;My problem is that corrupted flash causes a fault exception to be generated when read. So I can not check the data with a CRC because I can not read the data from flash.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Thanks I check this as soon as possible.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 May 2016 21:22:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Can-not-exit-Bus-Fault-Handler/m-p/493068#M30482</guid>
      <dc:creator>ralf1694</dc:creator>
      <dc:date>2016-05-29T21:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: Can not exit Bus Fault Handler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Can-not-exit-Bus-Fault-Handler/m-p/493069#M30483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have never heard of&amp;nbsp; 'bus fault' from ANY flash-read operation, UNLESS said flash-bank is 'busy' doing a write-op, where of course THAT type of operation needs proper full interlock.&amp;nbsp; Still sounds like a 'fatal firmware flaw' that you need to track down, but I still don't see how 'return from fault' comes into your normal code suite.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What kind of process do you believe is CAUSING this 'corruption'???&amp;nbsp; I guess I have heard of issues where users try to re-write 'parts of a flash phrase' WITHOUT a prior erase, and this 'forbidden over-write' process CAN cause read trouble as the ECC associated with that phrase CANNOT be properly 'added to'.&amp;nbsp; Now that I re-read your prior statement in this light, it looks like you have done EXACTLY this to provoke this exact error condition.&amp;nbsp; So IS this a fault you are 'trying to handle' in the 'final product' as part of said bootloader-BIST (presumably due to some kind of actual uncorrectable FLASH memory alteration by comsic rays)?&amp;nbsp; In that case, then occurrence of such a fault sounds 'sufficient' to declare the FLASH contents 'bad' and invoke the process to attempt application-image recovery.&amp;nbsp; I STILL don't see any reason to attempt to RETURN from the bus fault (to the CRC-loop).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 May 2016 21:49:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Can-not-exit-Bus-Fault-Handler/m-p/493069#M30483</guid>
      <dc:creator>egoodii</dc:creator>
      <dc:date>2016-05-29T21:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: Can not exit Bus Fault Handler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Can-not-exit-Bus-Fault-Handler/m-p/493070#M30484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I save my data on flash, when a powerfail is detcted. The problem is that I can not dissable the Interrupts when I am doing the write command, because I need the Interrupts. So I think an interrupt occurse when I try to write my flash. When I read the flash address, I get a bus fault.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2016 06:03:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Can-not-exit-Bus-Fault-Handler/m-p/493070#M30484</guid>
      <dc:creator>ralf1694</dc:creator>
      <dc:date>2016-05-30T06:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: Can not exit Bus Fault Handler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Can-not-exit-Bus-Fault-Handler/m-p/493071#M30485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As long as your vector-table and handlers are in a different flash-bank from that which you are 'writing' you shouldn't have any DIRECT problems as a result of interrupts-during-write.&amp;nbsp; BUT if this is 'powerfail' logic you might need to double-check your supply holdup time to insure you have valid power long enough to complete the flash-erase/write cycle!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the potential for 'power loss while writing' is unavoidable, such that the phrase-write CANNOT be guaranteed, it sounds like your bus-fault handler could 'look into' the stacked fault frame, 'recognize' the pointed-to instruction as being your 'valid read' loop, and MODIFY the index-registers-in-use to SKIP the 'current' phrase entirely (and supply some kind of 'dummy' data?) and THEN you should be able to 'return' from the handler back to that code and it could continue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2016 13:37:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Can-not-exit-Bus-Fault-Handler/m-p/493071#M30485</guid>
      <dc:creator>egoodii</dc:creator>
      <dc:date>2016-05-30T13:37:26Z</dc:date>
    </item>
  </channel>
</rss>

