<?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>MCUXpresso IDEのトピックsprintf causing hardfault</title>
    <link>https://community.nxp.com/t5/MCUXpresso-IDE/sprintf-causing-hardfault/m-p/762338#M2137</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to use sprintf with.&lt;/P&gt;&lt;P&gt;K64 freedom board.&lt;/P&gt;&lt;P&gt;REDLIB nohost.&lt;/P&gt;&lt;P&gt;every time i try to use sprintf i see a hard fault.&lt;/P&gt;&lt;P&gt;I did not find a place to change the heap, do i have to change it? increase?&lt;/P&gt;&lt;P&gt;I get no error when compiling the project and everything else is working so far.&lt;/P&gt;&lt;P&gt;(void)sprintf(distance,"%s\r\n",_distance);&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Jun 2018 01:24:07 GMT</pubDate>
    <dc:creator>Edrianocarlos</dc:creator>
    <dc:date>2018-06-08T01:24:07Z</dc:date>
    <item>
      <title>sprintf causing hardfault</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/sprintf-causing-hardfault/m-p/762338#M2137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to use sprintf with.&lt;/P&gt;&lt;P&gt;K64 freedom board.&lt;/P&gt;&lt;P&gt;REDLIB nohost.&lt;/P&gt;&lt;P&gt;every time i try to use sprintf i see a hard fault.&lt;/P&gt;&lt;P&gt;I did not find a place to change the heap, do i have to change it? increase?&lt;/P&gt;&lt;P&gt;I get no error when compiling the project and everything else is working so far.&lt;/P&gt;&lt;P&gt;(void)sprintf(distance,"%s\r\n",_distance);&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jun 2018 01:24:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/sprintf-causing-hardfault/m-p/762338#M2137</guid>
      <dc:creator>Edrianocarlos</dc:creator>
      <dc:date>2018-06-08T01:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: sprintf causing hardfault</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/sprintf-causing-hardfault/m-p/762339#M2138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What version of MCUXpresso IDE are you using?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've just tried a simple sprintf example on K64 (based on&amp;nbsp;&lt;A class="link-titled" href="http://www.cplusplus.com/reference/cstdio/sprintf/?kw=sprintf" title="http://www.cplusplus.com/reference/cstdio/sprintf/?kw=sprintf"&gt;http://www.cplusplus.com/reference/cstdio/sprintf/?kw=sprintf&lt;/A&gt;) with the current MCUXpresso IDE v10.2, and all seems to be OK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It might be worth stepping through your code at the instruction level to try to work out what is&amp;nbsp;triggering the hard fault.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In particular how are "distance" and "_distance" defined in your example? I suspect you might be&amp;nbsp;passing the buffer&amp;nbsp;rather than a pointer to&amp;nbsp;the buffer into your sprintf call&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are still having problems, can you use the Quickstart Panel 's "Export project to archive" option" and post an example project that replicates the problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;MCUXpresso IDE Support&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2018 07:47:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/sprintf-causing-hardfault/m-p/762339#M2138</guid>
      <dc:creator>lpcxpresso_supp</dc:creator>
      <dc:date>2018-06-12T07:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: sprintf causing hardfault</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/sprintf-causing-hardfault/m-p/762340#M2139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;Yes it was my mistake, my buffer was too short.&lt;/P&gt;&lt;P&gt;now everything is working.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2018 23:26:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/sprintf-causing-hardfault/m-p/762340#M2139</guid>
      <dc:creator>Edrianocarlos</dc:creator>
      <dc:date>2018-06-21T23:26:27Z</dc:date>
    </item>
  </channel>
</rss>

