<?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: LPC1343 startup issue in LPCXpresso IDE</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564613#M17675</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by BPC on Tue Nov 29 15:56:02 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there an easy way to change the "CRP DISABLED" name of the mass storage device after entering ISP mode? Or is this in the ROM?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 22:23:25 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T22:23:25Z</dc:date>
    <item>
      <title>LPC1343 startup issue</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564578#M17640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by BoyBoogaloo on Wed Aug 10 09:48:12 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a custom board with an embeddeed LPC1343.&amp;nbsp; I have been programming it via USB, (pull PIO0_1 low, USB boot with PIO0_3 high, enumerate as MSC device to PC, etc.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The USB also supplies 5V which is regulated to 3.3V to power the LPC1343 and the user code executes properly upon reset.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem comes when I switch to using a different power supply.&amp;nbsp; When I start the board with an external 5V supply and no USB cable plugged in, the LPC1343 takes about 1 minute before it begins to execute the user code.&amp;nbsp; If I plug in the USB cable during this delay time, the user code starts execution immediately.&amp;nbsp; Oddly enough, this procedure still works when only the DATA lines of the USB cable are connected during the start-up delay (D+ and D-).&amp;nbsp; I can't understand the reason for this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Help!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:23:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564578#M17640</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1343 startup issue</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564579#M17641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by kendwyer on Wed Aug 10 17:40:28 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Very strange....is it related to the following, see LPC1300 UM, 19.2.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1 In the user code, the memory location must be initialized as follows to create a&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;work-around for this issue:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;*((unit32_t *)(0x1000 0054)) = 0x0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. If the USB ISP mode is entered on power-up (see Section 19.3), the memory is not&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;initialized, and no user code is executed which could write to this memory location.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Therefore the device times out when first connected to the Windows operating&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;system, and the MSD disk only appears after a time-out and retry, which takes 45 sec&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;or longer. A work-around for the time-out issue is not available.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:23:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564579#M17641</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1343 startup issue</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564580#M17642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Rob65 on Wed Aug 10 22:46:33 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Boy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When ISP mode is entered, it will stay there forever waiting for a connection.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So that already answers the question if you still have P0_1 pulled low (no).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When P0_1 is not pulled low during reset, the lpc1343 immediately starts executing user code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Not knowing what your hardware or software looks like it is kind of difficult to give a solution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does your code use the USB drivers from ROM? In that case, use the workaround as given by Ken (add[I] *((uint32_t *)(0x1000 0054)) = 0x0;[/I]). It could be a solution to your problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Did you also test this with something basic like the Blinky example code? This surely sound like a problem with your user application or some kind of a powering/reset issue - although I am unable to explain why connecting the datalines should help in that case.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:23:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564580#M17642</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1343 startup issue</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564581#M17643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by ktownsend on Thu Aug 11 01:50:29 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Indeed, it would be easier to offer some help if you could post a partial schematic showing USB, power and how you have the ISP/Bootloader pin connected.&amp;nbsp; If you set a breakpoint at the start of main, does it take 1s to arrive at main() before any user code is executed?&amp;nbsp; Is it possible the delay is caused a bit later in the user code during initialisation, such as waiting for USB when it isn't connected, etc.?&amp;nbsp; You may have already checked this, but setting a breakpoint before any meaningful user code is executed would at least help narrow down where the delay is occuring.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:23:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564581#M17643</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1343 startup issue</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564582#M17644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by BoyBoogaloo on Thu Aug 11 09:46:11 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;@kendwyer&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That is a possibility that I am experiencing the device time out going into USB ISP mode.&amp;nbsp; (In fact, I do see that delay when I go to load the program via USB)&amp;nbsp; However, I am getting this delay when going to user code, which I don't think is right.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;@Rob65&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not using the USB ROM drivers, so that should not affect my program.&amp;nbsp; I've tried running simple "blinky" type code, but my programs doesn't even begin to execute until after the delay.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;@KTownsend&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The user code does not execute at all until after the delay.&amp;nbsp; I'm including a schematic that shows my USB circuit.&amp;nbsp; It does not show my external power supply with 3.3V regulator, but I have checked the external power and the output is fine.&amp;nbsp; On the USB connector (on the left) the U_RESET and U_ISP lines are connected to external switches which ground those inputs when pressed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH]529[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:23:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564582#M17644</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1343 startup issue</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564583#M17645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Rob65 on Fri Aug 12 00:44:53 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;My first thought is that the supervisor circuit is playing a joke on you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Not knowing the exact type of the reset generator (U2) and the missing 5V/3V3 converter leaves me a bit in the dark but I am guessing that depending on the power supply it takes too long for the 3v3 to reach a level at which U2 releases the reset line.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Carefully check your 3v3 level and the reset line when powering your board.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:23:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564583#M17645</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1343 startup issue</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564584#M17646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Polux rsv on Fri Aug 12 01:18:42 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Unless the Reset pin of LPC1343 has an internal pull-up, there is no external pull-up. I would try puting an external 10k to check if it helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Angelo&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:23:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564584#M17646</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1343 startup issue</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564585#M17647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Rob65 on Fri Aug 12 01:42:57 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;The chip does have a pull up, but it's just a weak pull up so this may not be enough when external components with OC/OD outputs are used.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If U2 has an open collector ouput you should add a pull up, but I would still suggest to first try without this chip to detect any power/reset problems.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've seen funny things with these type of chips where it can take a relatively long time before the reset line is released when the power (reference) voltage rises to slow.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is a power on reset circuit in the chip so there is no need to include an external reset for the lpc1343 to behave correctly. But it still may be very useful since the lpc1343 works from voltages as low as 2.0V.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:23:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564585#M17647</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1343 startup issue</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564586#M17648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by ktownsend on Fri Aug 12 06:36:33 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Rob65&lt;/STRONG&gt;&lt;BR /&gt;The chip does have a pull up, but it's just a weak pull up so this may not be enough when external components with OC/OD outputs are used.&lt;BR /&gt;If U2 has an open collector ouput you should add a pull up, but I would still suggest to first try without this chip to detect any power/reset problems.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I initially dropped the 10K pullup on reset myself when I started with the 1114/1343 thinking the internal pullup is enough, but remember one situation where I had to add it back in and have been doing so since.&amp;nbsp; Alas ... the exact reason escapes me now :( (I think it was a problem with either waking up from deep sleep or the bootloader after a SW-based reset).&amp;nbsp; Despite the (very weak) internal pullup I would strongly recommend an external 10K pullup on the line.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd try pulling U2 off as well and see if that helps since it seems like a likely culprit to me.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:23:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564586#M17648</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1343 startup issue</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564587#M17649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by wdawson61 on Sun Aug 14 06:26:47 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;On a side note, I notice from your schematic that your "USB_CONNECT) signal will never pull D+ lower than 3.3v - ~.7v = 2.6v (give or take based on the transistor's hFE)&amp;nbsp; Is that low enough to force a bus enumeration?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Wade&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:23:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564587#M17649</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1343 startup issue</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564588#M17650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by BPC on Thu Oct 27 11:26:22 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I am able to successfully communicate (send commands, receive data) with the LPC1343 using a modified version of the CDC example.&amp;nbsp; However, this only works when using the debugger.&amp;nbsp; When I try to just plug in my device to Windows, it shows up as a USB Mass Storage Device (not what I want).&amp;nbsp; When using the debugger, it shows up as a VCOM port (what I want).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I did a quick experiment and found that after the device boots up as a Mass Storage Device, I can press the reset button and it will change to a VCOM port.&amp;nbsp; Is there any way I can have the device show up as a VCOM without having to press restart or use the debugger?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank for the help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:23:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564588#M17650</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1343 startup issue</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564589#M17651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Thu Oct 27 13:09:00 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: BPC&lt;/STRONG&gt;&lt;BR /&gt;I did a quick experiment and found that after the device boots up as a Mass Storage Device...&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you aware that MSC is a part of LPC1343 bootloader :eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would strongly suggest to check your PIO0_1 (and it's pullup)&amp;nbsp; :)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:23:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564589#M17651</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1343 startup issue</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564590#M17652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by BPC on Thu Oct 27 14:33:09 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Zero.&amp;nbsp; Worked immediately.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:23:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564590#M17652</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1343 startup issue</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564591#M17653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by BPC on Mon Oct 31 16:59:58 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;What is the best way to collect serial buffer incoming data and wait until a '\r' is received?&amp;nbsp; I noticed that using the below code, the incoming data (say 10 bytes), comes in small groups, first1 byte, then 3 bytes, then 2 bytes, etc.&amp;nbsp; One I receive a '\r', I need to act upon it, but I need to retain the integrity of the entire incoming data string.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; if (numAvailByte &amp;gt; 0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; numBytesToRead = numAvailByte &amp;gt; 32 ? 32 : numAvailByte;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; numBytesRead = CDC_RdOutBuf (&amp;amp;serBuf[0], &amp;amp;numBytesToRead);&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;I am able to work around this by changing to [if (numAvailByte &amp;gt; 9)], however, some of the incoming commands are 3 bytes, some 8 bytes, and some 10 bytes, so this doesn't work for all cases. The one saving grave is that they all have a '\r' at the end of each command.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be much appreciated.&amp;nbsp; Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:23:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564591#M17653</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1343 startup issue</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564592#M17654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Mon Oct 31 17:15:20 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I usually write incoming buffer bytes into a new command buffer until \r is detected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;After interpreting and executing this command I reset command buffer byte counter and start to read a new command :)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:23:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564592#M17654</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1343 startup issue</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564593#M17655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by BPC on Wed Nov 09 09:45:23 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Zero,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you again for both of your replies.&amp;nbsp; They were very helpful.&amp;nbsp; My firmware is coming along quite well now, but I am running into a code size issue for my LPC1343.&amp;nbsp; I am a few hundred bytes away from the 32kB limit.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code that I have written isn't anything too crazy (~1000 lines), but I'm hoping that I can reduce my code size by removing some of my unused&amp;nbsp; #includes or by optimizing some of these header files.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also noticed that when I added my first sprintf, my code size immediately increased by about 10kB.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any advise would be much appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:23:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564593#M17655</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1343 startup issue</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564594#M17656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Wed Nov 09 09:57:55 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: BPC&lt;/STRONG&gt;&lt;BR /&gt;I also noticed that when I added my first sprintf, my code size immediately increased by about 10kB.&lt;BR /&gt;&lt;BR /&gt;Any advise would be much appreciated.&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Advice: Don't use sprintf :)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If it's possible use itoa :eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://"&gt;http://support.code-red-tech.com/CodeRedWiki/redlib_v2_notes?highlight=%28itoa%29&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:23:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564594#M17656</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1343 startup issue</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564595#M17657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by BPC on Fri Nov 11 10:51:27 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Zero,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to store about 10 "calibration" or zeroing values (for an ADC) in flash memory so they will be retained during power cycling.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there an easy way to store variables in flash?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Brian&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:23:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564595#M17657</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1343 startup issue</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564596#M17658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by BPC on Mon Nov 14 10:32:15 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;What is the best way to convert a float to a string (for serial buffer) without using sprintf?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:23:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564596#M17658</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1343 startup issue</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564597#M17659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Mon Nov 14 10:35:54 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;#1 Cast it from float to int :rolleyes:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#2 Use itoa &lt;SPAN class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;&lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or google for ftoa&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
ftoa (x, str, prec, format)
float x;
char *str;
{
/* converts a floating point number to an ascii string */
/* x is stored into str, which should be at least 30 chars long */
int ie, i, k, ndig, fstyle;
double y;
if (nargs() != 7)
&amp;nbsp; IEHzap("ftoa&amp;nbsp; ");
ndig = ( prec&amp;lt;=0) ? 7 : (prec &amp;gt; 22 ? 23 : prec+1);
if&amp;nbsp; (format == 'f' || format == 'F')
 fstyle = 1;
else
 fstyle = 0;
/* print in e format unless last arg is 'f' */
ie = 0;
/* if x negative, write minus and reverse */
if ( x &amp;lt; 0)
&amp;nbsp; {
&amp;nbsp; *str++ = '-';
&amp;nbsp; x = -x;
&amp;nbsp; }

/* put x in range 1 &amp;lt;= x &amp;lt; 10 */
if (x &amp;gt; 0.0) while (x &amp;lt; 1.0)
&amp;nbsp; {
&amp;nbsp; x =* 10.0;
&amp;nbsp; ie--;
&amp;nbsp; }
while (x &amp;gt;= 10.0)
&amp;nbsp; {
&amp;nbsp; x = x/10.0;
&amp;nbsp; ie++;
&amp;nbsp; }

/* in f format, number of digits is related to size */
if (fstyle) ndig =+ ie;

/* round. x is between 1 and 10 and ndig will be printed to
&amp;nbsp;&amp;nbsp; right of decimal point so rounding is ... */
for (y = i = 1; i &amp;lt; ndig; i++)
&amp;nbsp; y = y/10.;
x =+ y/2.;
if (x &amp;gt;= 10.0) {x = 1.0; ie++;} /* repair rounding disasters */
/* now loop.&amp;nbsp; put out a digit (obtain by multiplying by
&amp;nbsp; 10, truncating, subtracting) until enough digits out */
/* if fstyle, and leading zeros, they go out special */
if (fstyle &amp;amp;&amp;amp; ie&amp;lt;0)
&amp;nbsp; {
&amp;nbsp; *str++ = '0'; *str++ = '.';
&amp;nbsp; if (ndig &amp;lt; 0) ie = ie-ndig; /* limit zeros if underflow */
&amp;nbsp; for (i = -1; i &amp;gt; ie; i--)
&amp;nbsp;&amp;nbsp;&amp;nbsp; *str++ = '0';
&amp;nbsp; }
for (i=0; i &amp;lt; ndig; i++)
&amp;nbsp; {
&amp;nbsp; k = x;
&amp;nbsp; *str++ = k + '0';
&amp;nbsp; if (i == (fstyle ? ie : 0)) /* where is decimal point */
&amp;nbsp;&amp;nbsp;&amp;nbsp; *str++ = '.';
&amp;nbsp; x =- (y=k);
&amp;nbsp; x =* 10.0;
&amp;nbsp; }

/* now, in estyle,&amp;nbsp; put out exponent if not zero */
if (!fstyle &amp;amp;&amp;amp; ie != 0)
&amp;nbsp; {
&amp;nbsp; *str++ = 'E';
&amp;nbsp; if (ie &amp;lt; 0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; ie = -ie;
&amp;nbsp;&amp;nbsp;&amp;nbsp; *str++ = '-';
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; for (k=100; k &amp;gt; ie; k =/10);
&amp;nbsp; for (; k &amp;gt; 0; k =/10)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *str++ = ie/k + '0';
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ie = ie%k;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
*str = '\0';
return;
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:23:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1343-startup-issue/m-p/564597#M17659</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:23:16Z</dc:date>
    </item>
  </channel>
</rss>

