<?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のトピックRe: Initial Synchronization and checksum related issues in LPC1767 using c#</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Initial-Synchronization-and-checksum-related-issues-in-LPC1767/m-p/953126#M37845</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="344787" data-username="bilalqureshi.epic@gmail.com" href="https://community.nxp.com/people/bilalqureshi.epic@gmail.com"&gt;Muhammad Bilal&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Q1:My first question is , do we need to erase flash every time after its been written? or does it get overwritten after writing on it for second time? and for only erasing flash do we need initial handshaking i.e ?,synchronized\r\n,crystal frequency?&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;Yes, the on-chip flash of LPC17xx is NOR flash, you have to&amp;nbsp; erase the flash every time before you program it. Ersaing flash makes all flash data in 0xFF(all bits in flash are ONE), programing flash can make the bits to 0 or keep to 1. I do not think you need any synchronization or crystal setting when you erase/program flash.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q2:Does the LPC1767 micro controller always enter ISP mode after connecting cable, I read what is said in "&lt;STRONG&gt;UM&lt;/STRONG&gt;" but i didn't get it.&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;Whether the LPC17xx enters ISP mode or user application code is dependent on the P2.10 pin logic during/after Reset, when the pin is logic 0 by a pull-down resistor during/after Reset, the chip enters to execute user application code. When the pin is logic high by a pull-up resistor during/after Reset, the chip enters ISP mode.&lt;/P&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" id="bodyTable"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="" style="width: 10px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q3:This is my c# code for initial handshaking but after sending "Synchronized\r\n", we get invalid characters such as "?", "/","o" etc from reader instead of "OK" so that i can give crystal frequency next. I am following "&lt;STRONG&gt;UM&lt;/STRONG&gt;" document by NXP. what might be the issue here?&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;I suppose that the baudrate of uart does not match, which leads to the issue, pls check you code on both PC and the LPC sides.&lt;/P&gt;&lt;P&gt;Hope it can help you&lt;BR /&gt;BR&lt;/P&gt;&lt;P&gt;Xiangjun rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Sep 2019 06:43:30 GMT</pubDate>
    <dc:creator>xiangjun_rong</dc:creator>
    <dc:date>2019-09-23T06:43:30Z</dc:date>
    <item>
      <title>Initial Synchronization and checksum related issues in LPC1767 using c#</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Initial-Synchronization-and-checksum-related-issues-in-LPC1767/m-p/953125#M37844</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 making a software to write into LPC1767, I have&amp;nbsp;four questions&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;My first question is , do we need to erase flash every time after its been written? or does it get overwritten after writing on it for second time? and for only erasing flash do we need initial handshaking i.e ?,synchronized\r\n,crystal frequency?&lt;/LI&gt;&lt;LI&gt;Does the LPC1767 micro controller always enter ISP mode after connecting cable, I read what is said in "&lt;STRONG&gt;UM&lt;/STRONG&gt;" but i didn't get it.&lt;/LI&gt;&lt;LI&gt;This is my c# code for initial handshaking but after sending "Synchronized\r\n", we get invalid characters such as "?", "/","o" etc from reader instead of "OK" so that i can give crystal frequency next. I am following "&lt;STRONG&gt;UM&lt;/STRONG&gt;" document by NXP. what might be the issue here?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;Code&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;if (serialport.IsOpen)&lt;BR /&gt; {&lt;BR /&gt; #region Attempt 2&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;serialport.Write("?");&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; string responseSync = "Synchronized\r\n";&lt;BR /&gt; readWait(responseSync.Length);&lt;BR /&gt; string result = serialport.ReadExisting();&lt;BR /&gt; readTextBox.Text += result + System.Environment.NewLine;//sync by reader&lt;/P&gt;&lt;P&gt;// Synchronized OK&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; if (result.Equals(responseSync))&lt;BR /&gt; {&lt;BR /&gt; string w1 = "Synchronized\r\n";&lt;BR /&gt; serialport.WriteLine(w1);&lt;BR /&gt; string r1 = "OK\r\n";&lt;BR /&gt; readWait(r1.Length);&lt;BR /&gt; Thread.Sleep(50000);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;string r2 = serialport.ReadExisting(&lt;/STRONG&gt;);// OK by reader &amp;lt;--------- ISSUE IS HERE I DON'T GET "OK" instead i get //random chars&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;readTextBox.Text += "Check if sync ok" + System.Environment.NewLine;&lt;BR /&gt;&lt;BR /&gt; readTextBox.Text += r2 + System.Environment.NewLine;&lt;BR /&gt;//crystal frequency&lt;BR /&gt; if (r2.Equals(r1))&lt;BR /&gt; {&lt;BR /&gt; &lt;STRONG&gt;//send crystal frequency&lt;/STRONG&gt;&lt;BR /&gt; string crystalFrequency = "12000\r\n";&lt;BR /&gt; //host now send crystal frequency&lt;BR /&gt; serialport.Write(crystalFrequency);&lt;BR /&gt; //wait for reciever to sent OK&lt;BR /&gt; readWait(r1.Length);//wait after OK&lt;BR /&gt; string readCrystalFrequencyOk = serialport.ReadExisting();//will read response OK&lt;BR /&gt; readTextBox.Text += readCrystalFrequencyOk + System.Environment.NewLine;&lt;BR /&gt; if (readCrystalFrequencyOk.Equals(r1))&lt;BR /&gt; {&lt;BR /&gt; readTextBox.Text += "Crystal Frequency sent" + System.Environment.NewLine;&lt;/P&gt;&lt;P&gt;readTextBox.Text += "Closing SerialPort after initial commands" + System.Environment.NewLine;&lt;BR /&gt; serialport.Close();&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;4. This is the UU-encoded data which will be written later on device, The issue is the first 512 bytes checksum is valid according to "&lt;STRONG&gt;AN&lt;/STRONG&gt;" NXP doc, but after sniffing data from &lt;STRONG&gt;flashmagic&lt;/STRONG&gt; the first 512 bytes are invalid as they are 35644.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_7.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/84391i04CE214D22145C48/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_7.png" alt="pastedImage_7.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Help will be appreciated, Thank you in advance.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;M.Bilal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Sep 2019 11:18:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Initial-Synchronization-and-checksum-related-issues-in-LPC1767/m-p/953125#M37844</guid>
      <dc:creator>bilalqureshi_ep</dc:creator>
      <dc:date>2019-09-20T11:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Initial Synchronization and checksum related issues in LPC1767 using c#</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Initial-Synchronization-and-checksum-related-issues-in-LPC1767/m-p/953126#M37845</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="344787" data-username="bilalqureshi.epic@gmail.com" href="https://community.nxp.com/people/bilalqureshi.epic@gmail.com"&gt;Muhammad Bilal&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Q1:My first question is , do we need to erase flash every time after its been written? or does it get overwritten after writing on it for second time? and for only erasing flash do we need initial handshaking i.e ?,synchronized\r\n,crystal frequency?&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;Yes, the on-chip flash of LPC17xx is NOR flash, you have to&amp;nbsp; erase the flash every time before you program it. Ersaing flash makes all flash data in 0xFF(all bits in flash are ONE), programing flash can make the bits to 0 or keep to 1. I do not think you need any synchronization or crystal setting when you erase/program flash.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q2:Does the LPC1767 micro controller always enter ISP mode after connecting cable, I read what is said in "&lt;STRONG&gt;UM&lt;/STRONG&gt;" but i didn't get it.&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;Whether the LPC17xx enters ISP mode or user application code is dependent on the P2.10 pin logic during/after Reset, when the pin is logic 0 by a pull-down resistor during/after Reset, the chip enters to execute user application code. When the pin is logic high by a pull-up resistor during/after Reset, the chip enters ISP mode.&lt;/P&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" id="bodyTable"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="" style="width: 10px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q3:This is my c# code for initial handshaking but after sending "Synchronized\r\n", we get invalid characters such as "?", "/","o" etc from reader instead of "OK" so that i can give crystal frequency next. I am following "&lt;STRONG&gt;UM&lt;/STRONG&gt;" document by NXP. what might be the issue here?&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;I suppose that the baudrate of uart does not match, which leads to the issue, pls check you code on both PC and the LPC sides.&lt;/P&gt;&lt;P&gt;Hope it can help you&lt;BR /&gt;BR&lt;/P&gt;&lt;P&gt;Xiangjun rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Sep 2019 06:43:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Initial-Synchronization-and-checksum-related-issues-in-LPC1767/m-p/953126#M37845</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2019-09-23T06:43:30Z</dc:date>
    </item>
  </channel>
</rss>

