<?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: Problem With Class in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-With-Class/m-p/549987#M13922</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Italia on Wed Jul 30 07:28:35 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I put a breakpoint in line 31, but debugger never stop in this place. that means that&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the class is not costructed and initialized. I can access to the member but the costructor&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;is not invoked.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Instead if the class is defined in the main loop is costructed and everithing wirking perfectly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Strange behavior. I tried to see in the init secion in startupfile but the __libc_init_array is&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;always 0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 19:50:19 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T19:50:19Z</dc:date>
    <item>
      <title>Problem With Class</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-With-Class/m-p/549985#M13920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Italia on Wed Jul 30 03:49:11 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i wrote this easy code in mt LPC2468 CPU:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/*&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;===============================================================================&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : $(Module).cpp&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Author&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : $(author)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Version&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Copyright&amp;nbsp;&amp;nbsp; : $(copyright)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Description : $(Module) definition&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;===============================================================================&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;*/&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// TODO: insert include files here&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//#include "RFIDREADER.cc"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// TODO: insert other definitions and declarations here&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;class My_Class&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;public:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My_Class(void);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;unsigned int somma(unsigned int a, unsigned int b);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;private:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;unsigned int risultato;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My_Class::My_Class(void)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;unsigned int i;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for(i=0;i&amp;lt;10;i++)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;risultato=somma(i,i);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;unsigned int My_Class::somma(unsigned int a, unsigned int b)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;return (a+b);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My_Class first;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;int main(void) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// TODO: insert code here&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//RFIDReader RF = new RFIDReader;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// force the counter to be placed into memory&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;volatile static int i = 0 ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// Enter an infinite loop, just incrementing a counter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;while(1) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i++;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;return 0 ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, when i put a breakpoint in the for cycle, the degugger never pass in&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the cycle, so the object is not initialized. I wont to ask the reason and the possible solution. P.s i already try to define this class in the main loop and&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in this case eserithing is well!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:50:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-With-Class/m-p/549985#M13920</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problem With Class</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-With-Class/m-p/549986#M13921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by lpcxpresso-support on Wed Jul 30 06:40:13 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Your code works correctly here. Suggest you post your entire project so we can see exactly what you are trying to do.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;See&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.lpcware.com%2Fcontent%2Ffaq%2Flpcxpresso%2Fhow-importexport-projects" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/content/faq/lpcxpresso/how-importexport-projects&lt;/A&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:50:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-With-Class/m-p/549986#M13921</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem With Class</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-With-Class/m-p/549987#M13922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Italia on Wed Jul 30 07:28:35 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I put a breakpoint in line 31, but debugger never stop in this place. that means that&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the class is not costructed and initialized. I can access to the member but the costructor&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;is not invoked.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Instead if the class is defined in the main loop is costructed and everithing wirking perfectly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Strange behavior. I tried to see in the init secion in startupfile but the __libc_init_array is&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;always 0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:50:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-With-Class/m-p/549987#M13922</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem With Class</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-With-Class/m-p/549988#M13923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Italia on Thu Jul 31 00:58:09 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Have someone give an eye to the code?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:50:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-With-Class/m-p/549988#M13923</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problem With Class</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-With-Class/m-p/549989#M13924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by lpcxpresso-support on Thu Jul 31 01:22:42 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;There is a small error is the startup file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit the startup file, and change&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;.weak&amp;nbsp;&amp;nbsp; __libc_init_array
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;to&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;.global&amp;nbsp;&amp;nbsp; __libc_init_array
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This should fix the problem for you. We will put a fix into the Wizard for the next release of LPCXpresso&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:50:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-With-Class/m-p/549989#M13924</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem With Class</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-With-Class/m-p/549990#M13925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Italia on Thu Jul 31 01:57:54 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I found the same solution too! Thank u for your fast replay!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:50:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-With-Class/m-p/549990#M13925</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:50:21Z</dc:date>
    </item>
  </channel>
</rss>

