<?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: MQX 4.1 and Newlib in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-1-and-Newlib/m-p/357746#M11664</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sol,&lt;/P&gt;&lt;P&gt;thanks for getting back to me. The document is interesting, but is specific to EWL (which I had working with MQX 4.0.1 already).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you tell me if using newlib with MQX is supported?&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;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Aug 2014 22:45:42 GMT</pubDate>
    <dc:creator>chrissolomon</dc:creator>
    <dc:date>2014-08-14T22:45:42Z</dc:date>
    <item>
      <title>MQX 4.1 and Newlib</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-1-and-Newlib/m-p/357744#M11662</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 migrate from EWL to Newlib for our product, so we can take advantage of the C++11 features.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am tackling the transition together with the work to migrate from MQX 4.0.1 to 4.1.&lt;/P&gt;&lt;P&gt;We are using manually created make files and linker files, not using code warrior (although I have it just to generate example projects for reference).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have MQX configured to build using the gcc_arm toolchain, and the libraries are building fine.&lt;/P&gt;&lt;P&gt;In my application code I have updated my linker file to provide the symbols required by comp.c, and newlib - so I have&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; __preinit_array_start, __preinit_array_end, __init_array_start, __init_array_end, the fini array, zero table and copy table etc.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For linking I have removed the include paths for EWL and added&amp;nbsp; -lrdimom -specs=rdimon.specs -specs=nano.specs&lt;/P&gt;&lt;P&gt;The code compiles, however in the toolchain_startup it crashes at the "atexit" call (and if that is commented out, at the __libc_init_array).&lt;/P&gt;&lt;P&gt;(Has no problem getting through the init_hardware and data_startup.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have checked the map file, and the functions are present, and I've looked through the source for newlib, and I don't believe I am trying to call malloc (which I guess would fail given there is no heap at that point).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone give me any advice, point me at some useful documentation or example code that would help me get my project going?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Feel free to ask for more information.&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;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2014 06:39:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-1-and-Newlib/m-p/357744#M11662</guid>
      <dc:creator>chrissolomon</dc:creator>
      <dc:date>2014-08-14T06:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.1 and Newlib</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-1-and-Newlib/m-p/357745#M11663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check the below link and let me know if this helps! :smileywink:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-101405"&gt;Creating a new MQX project using GCC C++&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt; Sol&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, 14 Aug 2014 14:56:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-1-and-Newlib/m-p/357745#M11663</guid>
      <dc:creator>soledad</dc:creator>
      <dc:date>2014-08-14T14:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.1 and Newlib</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-1-and-Newlib/m-p/357746#M11664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sol,&lt;/P&gt;&lt;P&gt;thanks for getting back to me. The document is interesting, but is specific to EWL (which I had working with MQX 4.0.1 already).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you tell me if using newlib with MQX is supported?&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;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2014 22:45:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-1-and-Newlib/m-p/357746#M11664</guid>
      <dc:creator>chrissolomon</dc:creator>
      <dc:date>2014-08-14T22:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.1 and Newlib</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-1-and-Newlib/m-p/357747#M11665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;I looks like known issue with C++ global objects:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;C++ startup is trying to register destructors of global objects so they can be invoked during exit() fn.&lt;BR /&gt;The C++ standard says that c++ should support at the least 32 objects. So there is an global array of 32 itemss.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;If there is a more than 32 global objects, startup is trying to create new table &lt;STRONG&gt;by malloc()&lt;/STRONG&gt;. All this happens before main() function. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;In main function we run MQX which create memory pools.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;So malloc call in startup crashes because we don’t have created pool. &lt;BR /&gt;MQX design does not fully support C++, we are working on fix.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;In mean time, we would like to recommend you to do not use global objects.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;RadekS&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>Fri, 15 Aug 2014 14:02:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-1-and-Newlib/m-p/357747#M11665</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2014-08-15T14:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.1 and Newlib</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-1-and-Newlib/m-p/357748#M11666</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 facing the same issue with MQX 4.1 and&amp;nbsp; newlib.&lt;/P&gt;&lt;P&gt;is this issue was fixed?&lt;/P&gt;&lt;P&gt;can anyone tell me how to use MQX 4.1.1 and newlib?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Virendra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Feb 2015 14:37:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-1-and-Newlib/m-p/357748#M11666</guid>
      <dc:creator>virendrapatel</dc:creator>
      <dc:date>2015-02-18T14:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.1 and Newlib</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-1-and-Newlib/m-p/357749#M11667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately not&lt;/P&gt;&lt;P&gt;It is conceptual problem and it will not be fixed even in MQX 4.2.&lt;/P&gt;&lt;P&gt;If it is possible, please don’t use global objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;RadekS&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>Wed, 18 Feb 2015 15:21:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-1-and-Newlib/m-p/357749#M11667</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2015-02-18T15:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.1 and Newlib</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-1-and-Newlib/m-p/357750#M11668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its is very difficult to remove all&amp;nbsp; the&amp;nbsp; global object from our code.&lt;/P&gt;&lt;P&gt;Is there any other indirect way to resolve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Virendra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Feb 2015 09:18:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-1-and-Newlib/m-p/357750#M11668</guid>
      <dc:creator>virendrapatel</dc:creator>
      <dc:date>2015-02-20T09:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.1 and Newlib</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-1-and-Newlib/m-p/357751#M11669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately we didn't found and we do no know about any indirect way.&lt;/P&gt;&lt;P&gt;32 global objects is maximum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;RadekS&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>Fri, 20 Feb 2015 09:51:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-1-and-Newlib/m-p/357751#M11669</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2015-02-20T09:51:57Z</dc:date>
    </item>
  </channel>
</rss>

