• PUDN用户
  • Others
  • 104KB
  • zip
  • 0
  • 1 积分
  • 64
  • 2008-03-21 10:31
  • write_erase_secure.h
  • www.pudn.com.txt
  • securing_sectors_against_erase_and_write.pdf
  • write_erase_secure_2_00_LPC_23xx_24xx_gcc_3_4_2.a
  • write_erase_secure_gnu.h
  • write_erase_secure_2_00_LPC_23xx_24xx_ADS_1_2.a
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> <meta name="generator" content="pdf2htmlEX"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css"> <link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css"> <link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/622b388aff7f9c46a6eb306b/raw.css"> <script src="https://static.pudn.com/base/js/compatibility.min.js"></script> <script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script> <script> try{ pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({}); }catch(e){} </script> <title></title> </head> <body> <div id="sidebar" style="display: none"> <div id="outline"> </div> </div> <div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/622b388aff7f9c46a6eb306b/bg1.jpg"><div class="t m0 x1 h2 y1 ff1 fs0 fc0 sc0 ls0 ws0">1 <span class="_ _0"></span> <span class="_ _0"></span> <span class="_ _0"></span> <span class="_ _0"></span> <span class="_ _0"></span> <span class="_ _0"></span> <span class="_ _0"></span> A<span class="_ _0"></span>pr<span class="_ _0"></span>i<span class="_ _0"></span>l 1<span class="_ _0"></span>9<span class="_ _0"></span>,<span class="_ _0"></span> 20<span class="_ _0"></span>0<span class="_ _0"></span>7<span class="_ _0"></span> </div><div class="t m0 x2 h3 y2 ff1 fs1 fc0 sc0 ls1 ws1">NXP Semiconductor<span class="_ _1"></span>s</div><div class="t m0 x3 h4 y3 ff1 fs2 fc0 sc0 ls2 ws2">ARM-based Microcontroller</div><div class="t m0 x4 h5 y4 ff2 fs2 fc0 sc0 ls3 ws3">WRITE/ERASE SECURITY</div><div class="t m0 x4 h6 y5 ff1 fs3 fc0 sc0 ls4 ws4">In the NXP ARM based microcon<span class="_ _0"></span>troller, each flash sector <span class="_ _0"></span>can be secured against write/<span class="_ _0"></span><span class="ls5 ws5">erase operation. <span class="_ _0"></span>This<span class="ls6 ws6"> feature allows the </span></span></div><div class="t m0 x4 h6 y6 ff1 fs3 fc0 sc0 ls7 ws7">application to secure the sensitive code/da<span class="_ _0"></span>t<span class="ls8 ws8">a against tempering<span class="_ _0"></span>. If the Code Read Prot<span class="ls9 ws9">ection feature is <span class="_ _0"></span>ena<span class="lsa wsa">bled then the sensi<span class="_ _0"></span>t<span class="lsb ws0">ive </span></span></span></span></div><div class="t m0 x4 h6 y7 ff1 fs3 fc0 sc0 lsc wsb">code/data is also protected agai<span class="_ _0"></span>nst unauthorized reads. Please <span class="lsd wsc">refer to th<span class="_ _0"></span>e appropriate user manual for a description of the Co<span class="_ _0"></span><span class="lse ws0">de </span></span></div><div class="t m0 x4 h6 y8 ff1 fs3 fc0 sc0 lsf wsd">Read Prote<span class="_ _1"></span>ction feature<span class="_ _1"></span>.</div><div class="t m0 x4 h6 y9 ff1 fs3 fc0 sc0 ls9 wse">Altering the contents of a secured sector is not possible. The write or erase operation (via ISP or IAP) on a secured sector wi<span class="ls7 ws0">ll </span></div><div class="t m0 x4 h6 ya ff1 fs3 fc0 sc0 lsd wsf">succeed but the internal erase/programming <span class="lsc ws10">voltag<span class="_ _0"></span>es to alter the flash sector cont<span class="ls7 ws11">ents a<span class="_ _0"></span>re not generate<span class="_ _0"></span><span class="ls10 ws12">d. The write/erase </span></span></span></div><div class="t m0 x4 h6 yb ff1 fs3 fc0 sc0 ls11 ws13">security feature is irreversible. It should only be activated <span class="_ _0"></span><span class="ls12 ws14">in the final design pha<span class="_ _0"></span>se to av<span class="ls5 ws15">oid u<span class="_ _0"></span>nusable parts/application boa<span class="ls13 ws16">rds. If </span></span></span></div><div class="t m0 x4 h6 yc ff1 fs3 fc0 sc0 ls5 ws17">the Code Read <span class="_ _0"></span>Protection is enabled a<span class="_ _0"></span>long with the write/era<span class="_ _0"></span>se se<span class="lsc ws10">curity on sector 0 th<span class="_ _0"></span>en the Code<span class="ls4 ws18"> Read Protection feature is </span></span></div><div class="t m0 x4 h6 yd ff1 fs3 fc0 sc0 ls4 ws18">also irreversible. Howe<span class="_ _0"></span>ver an application exec<span class="_ _0"></span>uting from the in<span class="ws19">te<span class="_ _0"></span>rnal memory will still be able <span class="ws1a">to communicate with the externa<span class="ls14 ws0">l </span></span></span></div><div class="t m0 x4 h6 ye ff1 fs3 fc0 sc0 ls15 ws1b">world, if implemented by the system desi<span class="ls11 ws1c">gner. The flash sect<span class="_ _0"></span><span class="ls16 ws1d">ors which are not secured agai<span class="ls17 ws1e">nst write/erase can be er<span class="_ _1"></span>ased/</span></span></span></div><div class="t m0 x4 h6 yf ff1 fs3 fc0 sc0 lsd wsf">reprogrammed by such application. A write/erase operation s<span class="_ _0"></span><span class="lsc ws10">panning across a secured and an unsecured sectors will no<span class="_ _0"></span>t alter </span></div><div class="t m0 x4 h6 y10 ff1 fs3 fc0 sc0 lsa ws10">the contents of either secured or unsecu<span class="_ _0"></span>red sectors.</div><div class="t m0 x4 h6 y11 ff1 fs3 fc0 sc0 ls7 ws1f">The write/erase security is enabled by calli<span class="_ _0"></span>ng the <span class="ff3 lsd ws0">write_erase_secure<span class="_ _0"></span>_user_sector() <span class="ff1 wsf">function. This function is availa<span class="_ _0"></span>ble in the</span><span class="ls18"> </span></span></div><div class="t m0 x4 h6 y12 ff1 fs3 fc0 sc0 ls19 ws20">library file. A &#8217;<span class="_ _0"></span>C&#8217; header <span class="ff3 ls10 ws19">fi<span class="_ _0"></span>le (write_erase_secure.h) <span class="ff1 ws1a">is also provided. While<span class="_ _0"></span> sectors are being secured the flash memory is not </span></span></div><div class="t m0 x4 h6 y13 ff1 fs3 fc0 sc0 ls5 ws17">available for code<span class="_ _0"></span> execution hence it i<span class="_ _0"></span>s ve<span class="ws21">ry important to relocate functions in<span class="_ _0"></span> RAM during run time. Please refe<span class="_ _0"></span>r to the linke<span class="ls1a ws0">r </span></span></div><div class="t m0 x4 h6 y14 ff1 fs3 fc0 sc0 ls4 ws1a">documentation for details. The following section describes the<span class="_ _0"></span> func<span class="ls11 ws22">tions available in the<span class="_ _0"></span> library. The function return cod<span class="_ _0"></span>es ar<span class="lse ws0">e </span></span></div><div class="t m0 x4 h6 y15 ff1 fs3 fc0 sc0 lsc ws10">described in </div><div class="t m0 x5 h6 y16 ff1 fs3 fc0 sc0 ls1b ws23">Table 4<span class="ls18 ws0">.</span></div><div class="t m0 x4 h7 y17 ff2 fs4 fc0 sc0 ls1c ws24">Current Release</div><div class="t m0 x4 h8 y18 ff3 fs3 fc0 sc0 ls1d ws0">write_erase_secure_<span class="ff4 fc1 lse">2_<span class="_ _0"></span>00</span><span class="lse">_LPC_23xx_24xx_AD<span class="_ _0"></span>S_1_2.a</span></div><div class="t m0 x4 h8 y19 ff3 fs3 fc0 sc0 ls1d ws0">write_erase_secure_<span class="ff4 fc1 lse">2_<span class="_ _0"></span>00</span><span class="ls5">_LPC_23xx_24xx_gcc_3_4<span class="_ _0"></span>_2.a</span></div><div class="t m0 x4 h7 y1a ff2 fs4 fc0 sc0 ls1e ws25">write_erase_secure Library Functions</div><div class="t m0 x4 h8 y1b ff2 fs3 fc0 sc0 ls1d ws21">write_erase_secu<span class="_ _0"></span>re_user_sector(unsigned<span class="_ _0"></span> start, unsigned end, unsigned cclk)</div><div class="t m0 x4 h8 y1c ff2 fs3 fc0 sc0 ls8 ws26">Table 1: write_erase_secure<span class="_ _0"></span>_user_sector function<span class="_ _0"></span> description </div><div class="t m0 x6 h6 y1d ff2 fs3 fc0 sc0 ls1f ws0">Function<span class="_ _2"> </span><span class="ff1 lsc ws10">write_erase_secure_user_sector(un<span class="_ _0"></span>signed start, unsigned end, unsigne<span class="_ _0"></span>d cclk)</span></div><div class="t m0 x7 h8 y1e ff2 fs3 fc0 sc0 ls5 ws17">Input Parameters</div><div class="t m0 x8 h6 y1f ff1 fs3 fc0 sc0 ls20 ws27">start: Start Sector Number</div><div class="t m0 x8 h6 y1e ff1 fs3 fc0 sc0 lsb ws28">end: End Sector Number: Should<span class="_ _0"></span> be greater<span class="ls6 ws29"> than or equal to start sector number.</span></div><div class="t m0 x8 h6 y20 ff1 fs3 fc0 sc0 ls21 ws2a">cclk: System Clock Frequency <span class="_ _1"></span>(cclk) in kHz.</div><div class="t m0 x9 h8 y21 ff2 fs3 fc0 sc0 ls17 ws2b">Return Code</div><div class="t m0 x8 h6 y22 ff1 fs3 fc0 sc0 ls17 ws2b">SUCCESS |</div><div class="t m0 x8 h6 y23 ff1 fs3 fc0 sc0 ls22 ws2c">INVALID_SECTOR | </div><div class="t m0 x8 h6 y21 ff1 fs3 fc0 sc0 ls15 ws2d">SECTOR_ALREADY_SECURED |</div><div class="t m0 x8 h6 y24 ff1 fs3 fc0 sc0 ls17 ws1e">NOT_EXECUTING_IN_RAM |</div><div class="t m0 x8 h6 y25 ff1 fs3 fc0 sc0 ls23 ws0">WRONG_PART</div><div class="t m0 xa h8 y26 ff2 fs3 fc0 sc0 ls24 ws0">Description</div><div class="t m0 x8 h6 y27 ff1 fs3 fc0 sc0 ls4 ws18">This function is used <span class="_ _0"></span>to enable the wri<span class="_ _0"></span>te/erase se<span class="lsc ws10">curity on one or more sectors of on-chip Flash<span class="_ _0"></span> </span></div><div class="t m0 x8 h6 y28 ff1 fs3 fc0 sc0 lsc ws2e">memory. A write/erase <span class="lsa">operatio<span class="_ _0"></span>n spanning across a secured and an u<span class="_ _0"></span>nsecured sectors will <span class="ff2 ls25 ws0">not<span class="_ _0"></span></span><span class="ls1f ws2f"> alter </span></span></div><div class="t m0 x8 h6 y29 ff1 fs3 fc0 sc0 ls26 ws30">the contents of either secured or<span class="ls27 ws31"> unsecured sectors. Sector securi<span class="ls16 ws32">ty is effective after a reset cycle.</span></span></div><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a></div><div class="pi" data-data='{"ctm":[1.568627,0.000000,0.000000,1.568627,0.000000,0.000000]}'></div></div> </body> </html>