<?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>LPC Microcontrollersのトピックgetopt - command line options parsing</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/getopt-command-line-options-parsing/m-p/696734#M28060</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I'm trying to use getopt (from &amp;lt;unistd.h&amp;gt;) in some LPC-projects, where I have a small shell running.&lt;BR /&gt;Part of this shell is doing the command line processing, where I then need to process different kind of options.&lt;BR /&gt;I would like this to be as generic as possible, hence getopt().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem I'm facing at the moment is when playing around with heap/stack, I often get a HardFault.&lt;BR /&gt;This is because I don't know the memory usage/needs of getopt().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to estimate its max usage, without having access to the implementation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know using such function on an embedded target might be discouraged, but re-inventing the wheel each time is also not really convenient, nor maintainable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Or has someone an alternative or better ideas ?)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My configuration:&lt;BR /&gt;LPCOpen C++ project with NewLib&lt;BR /&gt;MCUXpresso&lt;BR /&gt;LPC1769&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Oct 2017 12:26:42 GMT</pubDate>
    <dc:creator>jd-soc</dc:creator>
    <dc:date>2017-10-04T12:26:42Z</dc:date>
    <item>
      <title>getopt - command line options parsing</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/getopt-command-line-options-parsing/m-p/696734#M28060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I'm trying to use getopt (from &amp;lt;unistd.h&amp;gt;) in some LPC-projects, where I have a small shell running.&lt;BR /&gt;Part of this shell is doing the command line processing, where I then need to process different kind of options.&lt;BR /&gt;I would like this to be as generic as possible, hence getopt().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem I'm facing at the moment is when playing around with heap/stack, I often get a HardFault.&lt;BR /&gt;This is because I don't know the memory usage/needs of getopt().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to estimate its max usage, without having access to the implementation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know using such function on an embedded target might be discouraged, but re-inventing the wheel each time is also not really convenient, nor maintainable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Or has someone an alternative or better ideas ?)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My configuration:&lt;BR /&gt;LPCOpen C++ project with NewLib&lt;BR /&gt;MCUXpresso&lt;BR /&gt;LPC1769&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Oct 2017 12:26:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/getopt-command-line-options-parsing/m-p/696734#M28060</guid>
      <dc:creator>jd-soc</dc:creator>
      <dc:date>2017-10-04T12:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: getopt - command line options parsing</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/getopt-command-line-options-parsing/m-p/696735#M28061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" data-content-finding="Community" data-userid="290416" data-username="jd-soc" href="https://community.nxp.com/people/jd-soc"&gt;Julien Delbergue&lt;/A&gt;,&lt;/P&gt;&lt;DIV style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px;"&gt;&lt;SPAN style="font-family: 'Microsoft YaHei', STXihei; background-color: #ffffff;"&gt;Thank you for your interest in NXP Semiconductor products and&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px;"&gt;&lt;SPAN style="font-family: 'Microsoft YaHei', STXihei; background-color: #ffffff;"&gt;for the opportunity to serve you.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px;"&gt;&lt;SPAN style="font-family: 'Microsoft YaHei', STXihei; background-color: #ffffff;"&gt;Optimizing the heap and stack may be a good way, and in the MCUXpresso IDE user's guide, 11.9 More advanced heap/stack placement illustrates the detailed information.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px;"&gt;&lt;SPAN style="font-family: 'Microsoft YaHei', STXihei; background-color: #ffffff;"&gt;Hope this helps.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;TIC&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>Mon, 09 Oct 2017 08:10:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/getopt-command-line-options-parsing/m-p/696735#M28061</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2017-10-09T08:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: getopt - command line options parsing</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/getopt-command-line-options-parsing/m-p/696736#M28062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/jeremyzhou"&gt;jeremyzhou&lt;/A&gt;,&lt;BR /&gt;Thanks for your answer.&lt;/P&gt;&lt;P&gt;I don't think it actually is because of memory layout (12.9 btw in the latest user's guide).&lt;BR /&gt;I suspect it is because I'm using &lt;STRONG&gt;C++&lt;/STRONG&gt;, and most likely this getopt implementation is using &lt;STRONG&gt;malloc&lt;/STRONG&gt;, which is discouraged in C++ from what I am reading.&lt;/P&gt;&lt;P&gt;Could you maybe confirm that malloc is being used in your getopt implementation ?&lt;BR /&gt;I'm still open to alternatives or other ideas.&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Julien&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Oct 2017 10:06:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/getopt-command-line-options-parsing/m-p/696736#M28062</guid>
      <dc:creator>jd-soc</dc:creator>
      <dc:date>2017-10-16T10:06:26Z</dc:date>
    </item>
  </channel>
</rss>

