<?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: How to enable debug_printfs within Kinetis Bootloader? in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-enable-debug-printfs-within-Kinetis-Bootloader/m-p/486671#M4292</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;Alice&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you able to share a&amp;nbsp;solution&amp;nbsp;on how to get printfs working with KBOOT1.2 or 2.0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jerome&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Jan 2019 04:27:49 GMT</pubDate>
    <dc:creator>F50SC</dc:creator>
    <dc:date>2019-01-22T04:27:49Z</dc:date>
    <item>
      <title>How to enable debug_printfs within Kinetis Bootloader?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-enable-debug-printfs-within-Kinetis-Bootloader/m-p/486664#M4285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am running Kinetis Bootlader 1.2 on TWR-K65F180M. How do I enable the debug_printfs? The board is flashed over USB SDA. I tried defining DEBUG within KDS. But couldn't find corresponding outputs either in KDS console or ACM.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to include the utility files within hello_world example, which did not compile properly. I am hoping to resolve the compile errors. But wanted to check whether there is a simpler solution, which I failed to notice.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Thanks,&lt;/P&gt;&lt;P&gt;Tony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2015 14:12:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-enable-debug-printfs-within-Kinetis-Bootloader/m-p/486664#M4285</guid>
      <dc:creator>tonysonney</dc:creator>
      <dc:date>2015-12-16T14:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable debug_printfs within Kinetis Bootloader?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-enable-debug-printfs-within-Kinetis-Bootloader/m-p/486665#M4286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to update, I have managed to get printfs working using the example code. But am still keen to know if there is an alternative method..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2015 17:23:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-enable-debug-printfs-within-Kinetis-Bootloader/m-p/486665#M4286</guid>
      <dc:creator>tonysonney</dc:creator>
      <dc:date>2015-12-16T17:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable debug_printfs within Kinetis Bootloader?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-enable-debug-printfs-within-Kinetis-Bootloader/m-p/486666#M4287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Tony,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please tell me what's mean about the "an alternative method." ?&lt;/P&gt;&lt;P&gt;And tell me which KDS version do you use ?&lt;/P&gt;&lt;P&gt;'"I tried to include the utility files within hello_world example, which did not compile properly." does it still have error , if yes, could you please&lt;/P&gt;&lt;P&gt;show the error on KDS ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Dec 2015 08:06:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-enable-debug-printfs-within-Kinetis-Bootloader/m-p/486666#M4287</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2015-12-21T08:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable debug_printfs within Kinetis Bootloader?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-enable-debug-printfs-within-Kinetis-Bootloader/m-p/486667#M4288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have the same question, how do you get debug_printf() to work? I tried the IAR example. Also noticed none of the uarts are configured. I thought defining DEBUG would make it work but no luck. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I saw this comment in fsl_platform_common.h:&lt;/P&gt;&lt;P&gt;//! This print function will only output text when the @a DEBUG macro is defined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But not sure what an @a DEBUG macro is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2016 18:15:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-enable-debug-printfs-within-Kinetis-Bootloader/m-p/486667#M4288</guid>
      <dc:creator>marks</dc:creator>
      <dc:date>2016-05-24T18:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable debug_printfs within Kinetis Bootloader?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-enable-debug-printfs-within-Kinetis-Bootloader/m-p/486668#M4289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mark,&lt;/P&gt;&lt;P&gt;Could you please tell me&amp;nbsp; which demo proeject ？&lt;/P&gt;&lt;P&gt;The SDK demo ? the KBOOT demo ?&lt;/P&gt;&lt;P&gt;Also which board.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2016 03:14:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-enable-debug-printfs-within-Kinetis-Bootloader/m-p/486668#M4289</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2016-05-25T03:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable debug_printfs within Kinetis Bootloader?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-enable-debug-printfs-within-Kinetis-Bootloader/m-p/486669#M4290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alice&lt;/P&gt;&lt;P&gt;NXP_Kinetis_Bootloader_2_0_0 is the boot loader project&lt;/P&gt;&lt;P&gt;The board is either TWR-K22F120M or FRDM-K22F.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2016 20:50:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-enable-debug-printfs-within-Kinetis-Bootloader/m-p/486669#M4290</guid>
      <dc:creator>marks</dc:creator>
      <dc:date>2016-08-29T20:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable debug_printfs within Kinetis Bootloader?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-enable-debug-printfs-within-Kinetis-Bootloader/m-p/486670#M4291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alice&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You never came back and answered Mark on his question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a similar problem, and would like to get printfs working for debugging.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using the following tools and SDK for development.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KDS V3.2&lt;BR /&gt;KSDK 1.3&lt;/P&gt;&lt;P&gt;MQX 5.0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the fsl_platform_common.h there is the following definition of a debug printf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define debug_printf(x, ...) do {} while (false)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Obviously this does nothing as it simply loops forever. The only call to this method is from main, which has after bootloader_run();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;debug_printf("Warning: reached end of main()\r\n");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is also this definition...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#if (defined(DEBUG) || defined(_DEBUG)) &amp;amp;&amp;amp; !defined(DEBUG_PRINT_DISABLE)&lt;BR /&gt;static inline void debug_printf(const char * format, ...);&lt;/P&gt;&lt;P&gt;//! @brief Debug print utility.&lt;BR /&gt;//!&lt;BR /&gt;//! This print function will only output text when the @a DEBUG macro is defined.&lt;BR /&gt;static inline void debug_printf(const char * format, ...)&lt;BR /&gt;{&lt;BR /&gt; va_list args;&lt;BR /&gt; va_start(args, format);&lt;BR /&gt; vprintf(format, args);&lt;BR /&gt;// Temporarily disable MISRA rule 14.2&lt;BR /&gt;#if defined(__ICCARM__)&lt;BR /&gt;#pragma diag_suppress=Pm049&lt;BR /&gt;#endif&lt;BR /&gt; va_end(args);&lt;BR /&gt;#if defined(__ICCARM__)&lt;BR /&gt;#pragma diag_default=Pm049&lt;BR /&gt;#endif&lt;BR /&gt;}&lt;BR /&gt;#else // (DEBUG || _DEBUG) &amp;amp;&amp;amp; !DEBUG_PRINT_DISABLE&lt;BR /&gt;&lt;BR /&gt;What is the @a DEBUG? and if I define my own DEBUG will debug_printf become operational?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;How is the UART setup for printfs?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;BR /&gt;Jerome&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Sep 2018 05:01:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-enable-debug-printfs-within-Kinetis-Bootloader/m-p/486670#M4291</guid>
      <dc:creator>F50SC</dc:creator>
      <dc:date>2018-09-13T05:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable debug_printfs within Kinetis Bootloader?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-enable-debug-printfs-within-Kinetis-Bootloader/m-p/486671#M4292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;Alice&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you able to share a&amp;nbsp;solution&amp;nbsp;on how to get printfs working with KBOOT1.2 or 2.0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jerome&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2019 04:27:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-enable-debug-printfs-within-Kinetis-Bootloader/m-p/486671#M4292</guid>
      <dc:creator>F50SC</dc:creator>
      <dc:date>2019-01-22T04:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable debug_printfs within Kinetis Bootloader?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-enable-debug-printfs-within-Kinetis-Bootloader/m-p/486672#M4293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;SPAN class=""&gt;&lt;A _jive_internal="true" class="" data-content-finding="Community" data-userid="31632" data-username="F50SC" href="https://community.nxp.com/people/F50SC"&gt;Jerome Pitt&lt;/A&gt;&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;Sorry to reply you late.&lt;/P&gt;&lt;P&gt;As to this thread has gone that long a time, could you please describe your new question at this time&lt;/P&gt;&lt;P&gt;in detail, for example, IDE , board.. thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2019 10:03:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-enable-debug-printfs-within-Kinetis-Bootloader/m-p/486672#M4293</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2019-01-24T10:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable debug_printfs within Kinetis Bootloader?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-enable-debug-printfs-within-Kinetis-Bootloader/m-p/486673#M4294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Jerome I'm having the same issue, did you solved it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2019 17:39:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-enable-debug-printfs-within-Kinetis-Bootloader/m-p/486673#M4294</guid>
      <dc:creator>irfanbilaloglu</dc:creator>
      <dc:date>2019-08-23T17:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable debug_printfs within Kinetis Bootloader?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-enable-debug-printfs-within-Kinetis-Bootloader/m-p/486674#M4295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Irfan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, I&amp;nbsp;solved my issue although I was not the OP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Without looking at the code....I can tell you what I did.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to overwrite the "weak" read write functions for STDIO that printf and the like use for outputting onto the serial port.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These functions will have your low level putch and getch to your serial UART.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After many days searching forums, googling I put various references together to come up with my own solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The most helpful I found was by Erich Styger on MCU on Eclipse. See below link&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://mcuoneclipse.com/2014/07/11/printf-and-scanf-with-gnu-arm-libraries/" title="https://mcuoneclipse.com/2014/07/11/printf-and-scanf-with-gnu-arm-libraries/"&gt;printf() and scanf() with GNU ARM Libraries | MCU on Eclipse&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You can essentially copy paste this code...and change the UARTx to the port of your choice....and printf should work like a charm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need more info let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jerome&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 31 Aug 2019 06:02:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-enable-debug-printfs-within-Kinetis-Bootloader/m-p/486674#M4295</guid>
      <dc:creator>F50SC</dc:creator>
      <dc:date>2019-08-31T06:02:58Z</dc:date>
    </item>
  </channel>
</rss>

