<?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: LPCOpen for LPC17xx flaw in IAP libraries</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPCOpen-for-LPC17xx-flaw-in-IAP-libraries/m-p/881646#M35276</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A _jive_internal="true" data-content-finding="Community" data-userid="319183" data-username="lmatte" href="https://community.nxp.com/people/lmatte"&gt;Luca Matteini&lt;/A&gt; ,&lt;/P&gt;&lt;P&gt;Thanks for your sharing, I agree with you.&amp;nbsp; And will report it to development team.&lt;/P&gt;&lt;P&gt;It seems only &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;Chip_IAP_ReadUID()&lt;/SPAN&gt; need 5 elements for result, so now the workaroud&lt;/P&gt;&lt;P&gt;is change result[4] under Chip_IAP_ReadPID() function, and iap_entry() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&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:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Mar 2019 07:17:13 GMT</pubDate>
    <dc:creator>Alice_Yang</dc:creator>
    <dc:date>2019-03-25T07:17:13Z</dc:date>
    <item>
      <title>LPCOpen for LPC17xx flaw in IAP libraries</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPCOpen-for-LPC17xx-flaw-in-IAP-libraries/m-p/881645#M35275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All the calls in IAP library (file "iap.c") have a clear astounding defect: they reserve for result data an uint32_t[4] array, while it's clear from UM10360 (sec. &lt;EM&gt;32.8 IAP commands&lt;/EM&gt;) as from way older application notes too, that the result array has to have &lt;STRONG&gt;5&lt;/STRONG&gt; (five) elements.&lt;/P&gt;&lt;P&gt;This is clearly evident when you make a call to IAP for device serial number (command 58), where the result is in four 32-bit values, so since as mentioned in UM10360&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Define data structure or pointers to pass IAP command table and result table to the IAP&lt;BR /&gt;function:&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;unsigned long command[5];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;unsigned long output[5];&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;and &lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;The first entry in the output table is&lt;BR /&gt;the Return Code, followed by any other results, starting with Result0.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;there are &lt;STRONG&gt;5&lt;/STRONG&gt; words written on return - beyond description, I just tested it to hold true on an LPC1769, five words are written as result.&lt;/P&gt;&lt;P&gt;The supplied function &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;Chip_IAP_ReadUID()&lt;/SPAN&gt; is then &lt;STRONG style="text-decoration: underline; "&gt;defective&lt;/STRONG&gt;, and shouldn't be used if not patched - I won't go through what happens on stack allocated memory, and how much this is going to be critical or not: it's simply code that can lead to memory corruption and whatever can follow.&lt;/P&gt;&lt;P&gt;What surprises me is that LPCOpen version 2.10 dates back to 2014, and is the one supplied with latest MCUXpresso IDE package: am I the first one to note this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Mar 2019 13:27:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPCOpen-for-LPC17xx-flaw-in-IAP-libraries/m-p/881645#M35275</guid>
      <dc:creator>lmatte</dc:creator>
      <dc:date>2019-03-22T13:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: LPCOpen for LPC17xx flaw in IAP libraries</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPCOpen-for-LPC17xx-flaw-in-IAP-libraries/m-p/881646#M35276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A _jive_internal="true" data-content-finding="Community" data-userid="319183" data-username="lmatte" href="https://community.nxp.com/people/lmatte"&gt;Luca Matteini&lt;/A&gt; ,&lt;/P&gt;&lt;P&gt;Thanks for your sharing, I agree with you.&amp;nbsp; And will report it to development team.&lt;/P&gt;&lt;P&gt;It seems only &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;Chip_IAP_ReadUID()&lt;/SPAN&gt; need 5 elements for result, so now the workaroud&lt;/P&gt;&lt;P&gt;is change result[4] under Chip_IAP_ReadPID() function, and iap_entry() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&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:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Mar 2019 07:17:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPCOpen-for-LPC17xx-flaw-in-IAP-libraries/m-p/881646#M35276</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2019-03-25T07:17:13Z</dc:date>
    </item>
  </channel>
</rss>

