<?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: K22F VBAT register file causes hardfault on battery failure</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22F-VBAT-register-file-causes-hardfault-on-battery-failure/m-p/636418#M38413</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No responses yet, so I'll share what I've got so far. &amp;nbsp;I found the Kinetis Peripheral Module Quick Reference (KQRUG) - a document I've never come across before and that I can't seem to find through browsing the documentation library - and it includes a little information. &amp;nbsp;It shows a dual Schottky diode being used to provide alternate power from VDD, and on page 50 it says:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;If VBAT supply is not present, then accesses to the RTC registers may not occur and could result in a core-lockup type reset in the MCU.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would be nice if a warning was given about access to the VBAT register file. It does say this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;The RTC interrupt is asserted whenever a status flag and the corresponding interrupt&lt;BR /&gt;enable bit are both set... and when the VBAT power supply is powered down.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't see that that solves my problem of needing to check (without crashing) that VBAT is powered, since I can't make any reads or writes to the RTC control registers if it's not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there was just a single status bit in the CPU's power domain that reflected the status of VBAT, that would make things so much easier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Apr 2017 18:35:41 GMT</pubDate>
    <dc:creator>scottm</dc:creator>
    <dc:date>2017-04-03T18:35:41Z</dc:date>
    <item>
      <title>K22F VBAT register file causes hardfault on battery failure</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22F-VBAT-register-file-causes-hardfault-on-battery-failure/m-p/636417#M38412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using the VBAT register file to back up some counters, and I'm finding that attempting to access the register file if the battery is missing or dead causes a hardfault. &amp;nbsp;I don't see any provision for checking the status of VBAT in software first - if there's a status bit, I can't find it documented.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a safe way to test this, short of having to wire up a separate input pin to the battery and dealing with the additional drain on the battery and loss of a pin that's needed elsewhere? &amp;nbsp;As it stands, I can't use the VBAT register file at all - a failed backup battery shouldn't do more than reset the RTC and some associated counters, but right now a dead or missing battery will crash the whole system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't see anything in AN4503 about avoiding this situation. &amp;nbsp;Is there some other documentation that covers proper use of the VBAT register file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The other problem I was having was that the flash programmer was trying to initialize the VBAT section when downloading, and it would likewise crash if VBAT was unpowered. &amp;nbsp;This was particularly puzzling because Codewarrior would get stuck in a mode where it would say there was an error, but no errors would show up in the console. &amp;nbsp;I had to clean the project and restart Codewarrior to clear it. &amp;nbsp;The fix for the root cause of this problem was to use the nobits flag in the section attribute:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;__attribute__ ((section (".vbat,\"aw\",%nobits@")))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm including that fix here in case anyone else runs into the same problem. &amp;nbsp;Doesn't help my runtime problems, though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Mar 2017 21:16:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22F-VBAT-register-file-causes-hardfault-on-battery-failure/m-p/636417#M38412</guid>
      <dc:creator>scottm</dc:creator>
      <dc:date>2017-03-30T21:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: K22F VBAT register file causes hardfault on battery failure</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22F-VBAT-register-file-causes-hardfault-on-battery-failure/m-p/636418#M38413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No responses yet, so I'll share what I've got so far. &amp;nbsp;I found the Kinetis Peripheral Module Quick Reference (KQRUG) - a document I've never come across before and that I can't seem to find through browsing the documentation library - and it includes a little information. &amp;nbsp;It shows a dual Schottky diode being used to provide alternate power from VDD, and on page 50 it says:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;If VBAT supply is not present, then accesses to the RTC registers may not occur and could result in a core-lockup type reset in the MCU.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would be nice if a warning was given about access to the VBAT register file. It does say this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;The RTC interrupt is asserted whenever a status flag and the corresponding interrupt&lt;BR /&gt;enable bit are both set... and when the VBAT power supply is powered down.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't see that that solves my problem of needing to check (without crashing) that VBAT is powered, since I can't make any reads or writes to the RTC control registers if it's not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there was just a single status bit in the CPU's power domain that reflected the status of VBAT, that would make things so much easier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Apr 2017 18:35:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22F-VBAT-register-file-causes-hardfault-on-battery-failure/m-p/636418#M38413</guid>
      <dc:creator>scottm</dc:creator>
      <dc:date>2017-04-03T18:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: K22F VBAT register file causes hardfault on battery failure</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22F-VBAT-register-file-causes-hardfault-on-battery-failure/m-p/636419#M38414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Scott,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for the later reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Kinetis product doesn't have VBAT voltage detection feature.&lt;/P&gt;&lt;P&gt;As you mentioned before, customer could use below design to make sure there with power supply to VBAT pin:&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/18133i52FDCBEA4685C832/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;Or, there need to use an ADC pin to detect the VBAT voltage with setting time interval.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Ma Hui&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, 06 Apr 2017 08:38:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22F-VBAT-register-file-causes-hardfault-on-battery-failure/m-p/636419#M38414</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2017-04-06T08:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: K22F VBAT register file causes hardfault on battery failure</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22F-VBAT-register-file-causes-hardfault-on-battery-failure/m-p/636420#M38415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, next question - where should I have gone to find this information in the documentation? &amp;nbsp;And is there a documentation feedback process?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Apr 2017 18:43:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22F-VBAT-register-file-causes-hardfault-on-battery-failure/m-p/636420#M38415</guid>
      <dc:creator>scottm</dc:creator>
      <dc:date>2017-04-07T18:43:46Z</dc:date>
    </item>
  </channel>
</rss>

