<?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: KW40Z HardFault in hciLeCallback</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW40Z-HardFault-in-hciLeCallback/m-p/625516#M37511</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ben Pratt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your feedback, I will verify this information and tell to the people that take care of this. Your issue seams to be a improvement, so it should be in the next release, but it may take time to be released.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Jorge Alcala&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Mar 2017 18:57:41 GMT</pubDate>
    <dc:creator>jorge_a_vazquez</dc:creator>
    <dc:date>2017-03-27T18:57:41Z</dc:date>
    <item>
      <title>KW40Z HardFault in hciLeCallback</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW40Z-HardFault-in-hciLeCallback/m-p/625515#M37510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the KW40Z in the&amp;nbsp;GAP Central role to scan and connect to other BLE devices. Occasionally, a HardFault will be triggered while processing scan requests. I've managed to trace the issue back to a potential null-pointer dereference in "hciLeCallback" from "gap_hci_cb.o" in "ble_host_central_lib.a" within Connectivity Software 1.0.1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The disassembly for this function is shown below. There is a conditional breakpoint on address 0x1875C right after the call to "MEM_BufferAlloc". &lt;STRONG&gt;Notice that there is no check to verify that "MEM_BufferAlloc" did not return NULL&lt;/STRONG&gt;, unlike the previous call to "MEM_BufferAlloc" earlier in the function (starting at address 0x18736, the "MOVS" followed by the "BEQ.N").&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/15023iE5261768376AE5FA/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ultimately, the HardFault occurs within the call to "FLib_MemCpy" at address 0x1877C where we end up trying to write to address 0. A snapshot of this condition is shown below (destination in R0, source in R1). There are a few reads and writes that occur between the call to "MEM_BufferAlloc" and "FLib_MemCpy"&amp;nbsp;that I haven't fully decoded, but they don't seem to help us avoid writing to address 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_5.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/15105i70852D510B2982AD/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_5.png" alt="pastedImage_5.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suspect I can increase the heap size to avoid running into this situation, but it doesn't fix the underlying cause. Is there a planned update to the Connectivity Software that happens to address this issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 17:40:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW40Z-HardFault-in-hciLeCallback/m-p/625515#M37510</guid>
      <dc:creator>bpratt</dc:creator>
      <dc:date>2017-03-06T17:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: KW40Z HardFault in hciLeCallback</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW40Z-HardFault-in-hciLeCallback/m-p/625516#M37511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ben Pratt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your feedback, I will verify this information and tell to the people that take care of this. Your issue seams to be a improvement, so it should be in the next release, but it may take time to be released.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Jorge Alcala&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Mar 2017 18:57:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW40Z-HardFault-in-hciLeCallback/m-p/625516#M37511</guid>
      <dc:creator>jorge_a_vazquez</dc:creator>
      <dc:date>2017-03-27T18:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: KW40Z HardFault in hciLeCallback</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW40Z-HardFault-in-hciLeCallback/m-p/625517#M37512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jorge,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the acknowledgement. Increasing the heap size did allow us to avoid the situation. Looking forward to the next release.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Apr 2017 17:11:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW40Z-HardFault-in-hciLeCallback/m-p/625517#M37512</guid>
      <dc:creator>bpratt</dc:creator>
      <dc:date>2017-04-04T17:11:32Z</dc:date>
    </item>
  </channel>
</rss>

