<?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>Question: what would cause the c/c++ lib run time init fails?</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/39968/question-what-would-cause-the-c-c-lib-run-time-init-fails</link><description> 
I&amp;#39;v been trying to use the c++&amp;#39;s cout object with my stm32
(cotex-m3) board. 

 
I think I&amp;#39;v reimplemented the necessary functions, after reading
the related topics of the documentation, such as &amp;lt; http://www.keil.com/support/man/docs/armlib/armlib_CJAIABCF</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Question: what would cause the c/c++ lib run time init fails?</title><link>https://community.arm.com/thread/127885?ContentTypeID=1</link><pubDate>Fri, 16 Nov 2012 09:41:49 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:89bcf061-d8ff-4f52-bcbf-70f3acd92b1e</guid><dc:creator>Pony279 Pony279</dc:creator><description>&lt;p&gt;&lt;p&gt;
Yes.&lt;br /&gt;
But personally I don&amp;#39;t like to manually divided the RAM into parts,
and have the size of each part of it explicitly defined.&lt;br /&gt;
Re-implementing a low level function like _clock_init feeds my need
to do some basic initializations.&lt;/p&gt;

&lt;p&gt;
In some special case, the programmer wants to know whether a
powerup or an abnormal system reset occurs, you suggestion will be
good.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question: what would cause the c/c++ lib run time init fails?</title><link>https://community.arm.com/thread/119889?ContentTypeID=1</link><pubDate>Fri, 16 Nov 2012 09:30:39 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2274a443-81eb-4e21-bdb1-838ec31dfbfd</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
As I mentioned, it is possible to have a project where some part
of the RAM are zero-initialzed and the rest isn&amp;#39;t. So you can get a
correct environment for a C/C++ program while at the same time have
some data survive a reboot.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question: what would cause the c/c++ lib run time init fails?</title><link>https://community.arm.com/thread/106599?ContentTypeID=1</link><pubDate>Fri, 16 Nov 2012 08:52:00 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:8414e237-0b97-4a9c-895c-2ced35c5fd80</guid><dc:creator>Pony279 Pony279</dc:creator><description>&lt;p&gt;&lt;p&gt;
to Per Westermark,&lt;br /&gt;
&amp;quot; can&amp;#39;t see why the library should issue any bugs if your project
settings are incorrect.&lt;br /&gt;
&amp;quot;&lt;br /&gt;
you are right,&lt;br /&gt;
I took a look at the C++0x standard, searching with the key
&amp;quot;initialize&amp;quot;. And found&lt;br /&gt;
&amp;quot;Variables with static storage duration (3.7.1) or thread storage
duration (3.7.2) shall be zero-initialized (8.5)before any other
initialization takes place&amp;quot;&lt;br /&gt;
Thus the &amp;quot;NoInit&amp;quot; setting is in conflict with the standard.&lt;/p&gt;

&lt;p&gt;
I used to declared zero-init variables with the &amp;quot;NoInit&amp;quot; because
my previous code do the basic hardware and related software
initializations before __main is call.&lt;br /&gt;
But Now I have to give up &amp;quot;NoInit&amp;quot;. Re-implementing the _clock_init
function and doing the necessary basic initializations may be a good
choice too.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question: what would cause the c/c++ lib run time init fails?</title><link>https://community.arm.com/thread/92187?ContentTypeID=1</link><pubDate>Fri, 16 Nov 2012 08:31:07 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:39a4df43-707e-41c0-8861-aa58dc23109a</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
I can&amp;#39;t see why the library should issue any bugs if your project
settings are incorrect.&lt;/p&gt;

&lt;p&gt;
You have to realize that the tools supports programs with all
assembler, or all C or mixes. And it supports multiple memory
regions. In the end, it is up to the developer to make proper project
settings depending on the requirements/needs.&lt;/p&gt;

&lt;p&gt;
Most people who do want uninitialized memory would probably either
specify two separate memory ranges and have all normal data in the
first region - complete with zeroing of memory. And then a second
region configured with that noninit setting. Or alternatively, people
would specify a smaller address range in the project form, and then
use pointers or absolute addresses to make use of the &amp;quot;hidden&amp;quot; memory
range.&lt;/p&gt;

&lt;p&gt;
But in the end, the project file has to be general enough (to
support all types of projects) that many project combinations will
fail to give a correct application in relation to the customers
expectations.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question: what would cause the c/c++ lib run time init fails?</title><link>https://community.arm.com/thread/61382?ContentTypeID=1</link><pubDate>Fri, 16 Nov 2012 06:35:14 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:94ca13bc-7e69-442e-9ffc-71d3370b0ff4</guid><dc:creator>Pony279 Pony279</dc:creator><description>&lt;p&gt;&lt;p&gt;
Problem solved.&lt;br /&gt;
I uncheck the NoInit option for the RAM, and then the program went
normally.&lt;/p&gt;

&lt;p&gt;
The simulator clear the ram before the program start, so the
program goes pretty well.&lt;/p&gt;

&lt;p&gt;
While using real hardware, the content of RAM is unknown after the
mcu&amp;#39;s being powered up.&lt;/p&gt;

&lt;p&gt;
&lt;b&gt;I think this may be considered a bug of the library, because it
cannot successfully be initialized with the &amp;quot;NoInit&amp;quot; option, which is
used to tell the compiler to leave the undefined-init-value global
variables alone.&lt;/b&gt; What&amp;#39;s worse, the library didn&amp;#39;t even report any
useful debug information and that really make me having a hard time
debuggin the program!&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>