<?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>Kinetis MicrocontrollersのトピックRe: hard fault caused by BusFault</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/hard-fault-caused-by-BusFault/m-p/1025904#M56359</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@NXP&amp;nbsp; should I open a ticket instead ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Jan 2020 11:31:54 GMT</pubDate>
    <dc:creator>jbrud</dc:creator>
    <dc:date>2020-01-20T11:31:54Z</dc:date>
    <item>
      <title>hard fault caused by BusFault</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/hard-fault-caused-by-BusFault/m-p/1025903#M56358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I encounter frequent hard fault as soon I use CAN &amp;amp; USB at the same time. I'm using FreeRTOS&amp;nbsp; on a MK64F MCU.&lt;/P&gt;&lt;P&gt;I tried to analyze fault registers to find out the cause of the hard fault but I'm not sure to interpret the value of BFAR.&lt;/P&gt;&lt;P&gt;See below the steps when it is stopped in HardFault_Handler function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Inspect Configurable Fault Status Registers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GDB: print/x *(uint32_t *) 0xE000ED28&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Entire CFSR&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x008200&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with [ UFSR | BFSR | MMFSR ]&lt;BR /&gt;UFSR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x0000&lt;BR /&gt;BFSR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x82&lt;BR /&gt;MMFSR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;2. BusFault Status Register (BFSR) - 0xE000ED29&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GDB: print/x *(uint8_t *) 0xE000ED29&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BFSR 0x82&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&amp;gt; 0b10000010&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7: BFARVALID&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;BR /&gt;1: PRECISERR&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Bus Fault Address Register (BFAR)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GDB: print/x *(uint32_t *) 0xE000ED38&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&amp;gt; 0x2c80001c&lt;/P&gt;&lt;P&gt;should hold the address which triggered the fault ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See my linker script from SDK:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Specify the memory areas */&lt;BR /&gt;MEMORY&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; m_interrupts&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RX)&amp;nbsp; : ORIGIN = 0x00000000, LENGTH = 0x00000400&lt;BR /&gt;&amp;nbsp; m_flash_config&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RX)&amp;nbsp; : ORIGIN = 0x00000400, LENGTH = 0x00000010&lt;BR /&gt;&amp;nbsp; m_text&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; (RX)&amp;nbsp; : ORIGIN = 0x00000410, LENGTH = 0x000FFBF0&lt;BR /&gt;&amp;nbsp; m_data&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; (RW)&amp;nbsp; : ORIGIN = 0x1FFF0000, LENGTH = 0x00010000&lt;BR /&gt;&amp;nbsp; m_data_2&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; (RW)&amp;nbsp; : ORIGIN = 0x20000000, LENGTH = 0x00030000&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would assume it should point somewhere in m_text region...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas ?&amp;nbsp; &lt;SPAN class="" lang="en"&gt;&lt;SPAN title=""&gt;What am I doing wrong ?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Register addresses from: &lt;A class="link-titled" href="https://developer.arm.com/docs/dui0553/b/cortex-m4-peripherals/system-control-block/configurable-fault-status-register#Cihbeigb" title="https://developer.arm.com/docs/dui0553/b/cortex-m4-peripherals/system-control-block/configurable-fault-status-register#Cihbeigb"&gt;https://developer.arm.com/docs/dui0553/b/cortex-m4-peripherals/system-control-block/configurable-fault-status-register#C…&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2020 10:38:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/hard-fault-caused-by-BusFault/m-p/1025903#M56358</guid>
      <dc:creator>jbrud</dc:creator>
      <dc:date>2020-01-17T10:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: hard fault caused by BusFault</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/hard-fault-caused-by-BusFault/m-p/1025904#M56359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@NXP&amp;nbsp; should I open a ticket instead ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jan 2020 11:31:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/hard-fault-caused-by-BusFault/m-p/1025904#M56359</guid>
      <dc:creator>jbrud</dc:creator>
      <dc:date>2020-01-20T11:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: hard fault caused by BusFault</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/hard-fault-caused-by-BusFault/m-p/1025905#M56360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Johannes,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you are doing well. I apologize for the delayed response, this community thread is fine there is no need to open a ticket.&lt;/P&gt;&lt;P&gt;If possible could you please share an example project of when this is occuring using both CAN and USB, so that I may attempt to reproduce this error from my side and can check it with detail.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also if you could please confirm the IDE version you are using and your OS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Sabina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jan 2020 21:50:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/hard-fault-caused-by-BusFault/m-p/1025905#M56360</guid>
      <dc:creator>Sabina_Bruce</dc:creator>
      <dc:date>2020-01-20T21:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: hard fault caused by BusFault</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/hard-fault-caused-by-BusFault/m-p/1025906#M56361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sabina,&lt;/P&gt;&lt;P&gt;unfortunately this is not possible since we use a custom board and the software is not executable on a NXP's development board.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For me it would be helpful if a someone could check my inspection of fault registers. If I interpret them wrongly or why the result is out of specification ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jan 2020 08:02:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/hard-fault-caused-by-BusFault/m-p/1025906#M56361</guid>
      <dc:creator>jbrud</dc:creator>
      <dc:date>2020-01-21T08:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: hard fault caused by BusFault</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/hard-fault-caused-by-BusFault/m-p/1025907#M56362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Johannes,&lt;/P&gt;&lt;P&gt;In the case of the information provided, the address listed in the BFAR should point to where the exception is being made. Generally, you will find that the line prior to this, is causing the exception.&lt;/P&gt;&lt;P&gt;I recommend to check the tips given in the &lt;A href="https://interrupt.memfault.com/blog/cortex-m-fault-debug#bad-address-read-example"&gt;following site&lt;/A&gt;, they go through how to debug the different possibilities listed in the BSFR.&lt;/P&gt;&lt;P&gt;You can also refer to the ARM website for a more complete description of the above.&lt;/P&gt;&lt;P&gt;Also by stepping through just before the address while debugging, it will be easier to begin pin pointing where the root issue is.&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Sabina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2020 21:58:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/hard-fault-caused-by-BusFault/m-p/1025907#M56362</guid>
      <dc:creator>Sabina_Bruce</dc:creator>
      <dc:date>2020-01-22T21:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: hard fault caused by BusFault</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/hard-fault-caused-by-BusFault/m-p/1025908#M56363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I solved my problem, but its to application specific to explain it here. It was basically&amp;nbsp; a memory corruption which cause a faulty stack.&lt;/P&gt;&lt;P&gt;Anyway my interpretation of ARM registers wast not correct. Just want to clarify it in case if someone encounter a similar problem and tries to follow my inspection of registers. The referred ARM specification says:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;The BFAR contains the address of the location that generated a BusFault.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I misunderstood this statement. I thought that BFAR points to the "line of code" in flash memory. Instead it shows which address was tried to accessed. The "line of code" can be restored by recovering the call stack and is much more helpful. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jan 2020 09:00:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/hard-fault-caused-by-BusFault/m-p/1025908#M56363</guid>
      <dc:creator>jbrud</dc:creator>
      <dc:date>2020-01-28T09:00:29Z</dc:date>
    </item>
  </channel>
</rss>

