<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>printf() causes crash before being called</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/40727/printf-causes-crash-before-being-called</link><description> 
Hi, 
Using Keil uVision 5.11 with Cortex M4 target. 

 
I wrote a program with printf() calls. I added a fputc() &amp;amp;
output to UART. 
I have now created another project with the same fputc(). 
If in the second program I add a printf() then I get an exception</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: printf() causes crash before being called</title><link>https://community.arm.com/thread/82169?ContentTypeID=1</link><pubDate>Wed, 01 Oct 2014 09:58:23 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ee35ecea-c118-4700-8c8c-cf453fd6e8b7</guid><dc:creator>Pete Roberts</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thanks. Using NXP, my understanding is that CMSIS may not be
applicable.&lt;/p&gt;

&lt;p&gt;
Turns out that I had not included retarget.h. Would like to know
how to get the linker to tell me that it will insert a breakpoint for
next WEAK disaster!&lt;br /&gt;
Still new with the debugger/assembler &amp;amp; suppose that the
breakpoint is just close to an exception vector.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: printf() causes crash before being called</title><link>https://community.arm.com/thread/63165?ContentTypeID=1</link><pubDate>Wed, 01 Oct 2014 09:45:14 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:0a24e1e1-f8e7-481c-9c3e-9e97b5b1545b</guid><dc:creator>Westonsupermare Pier</dc:creator><description>&lt;p&gt;&lt;p&gt;
Under the CMSIS model SystemInit() is typically called prior to
your main() function, and BEFORE the statics are initialized, so be
very conscious about what&amp;#39;s in system_arch.c, what it&amp;#39;s calling, and
perhaps what stack size you have.&lt;/p&gt;

&lt;p&gt;
You could always analyze the Hard Fault, or implement a half
useful one (Joseph Yiu) to display the details.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>