<?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: [solved]Protecting SPI flash sectors using lib (spifi_drv_m4) LPC43 in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/solved-Protecting-SPI-flash-sectors-using-lib-spifi-drv-m4-LPC43/m-p/521918#M4554</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by cyrilfougeray on Fri May 31 07:58:20 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;P&gt;For further information,&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;opers.protect is two bytes long : the most significant byte determines the configuration register of the SPI flash and the least determines the status register.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;You can configure these SPI Flash registers using the spifi_program function with source = dest, length = 0 and no option.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;After each operation, these two registers are accessible in obj.stat.hw.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 16:37:53 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T16:37:53Z</dc:date>
    <item>
      <title>[solved]Protecting SPI flash sectors using lib (spifi_drv_m4) LPC43</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/solved-Protecting-SPI-flash-sectors-using-lib-spifi-drv-m4-LPC43/m-p/521916#M4552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by cyrilfougeray on Tue May 28 07:57:12 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I'm porting U-Boot on SPI Flash and I'd like to protect sectors. I'm working on the Hitex LPC4350. My SPI Flash is the S25FL064P.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;As I understood, there is no function provided to do this in the spifi lib.&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I try to send commands one by one but without success, here how I proceed :&lt;/P&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;ol&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;li&amp;gt;Switch to commande mode (cancel_mem_mode())&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;li&amp;gt;pSpifi-&amp;amp;gt;cmd(0x06, 0, 0, 0); // WREN&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;li&amp;gt;pSpifi-&amp;amp;gt;cmd(0x01,0, 0, (*data_buf)); // write registers &amp;nbsp; /!\ Here, data is 8 bits long but cmd() use&amp;nbsp;uint16_t as data. Maybe I'm configuring the config register instead of the status register...&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;li&amp;gt;Wait operation is complete&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;li&amp;gt;Write Disable&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/ol&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;P&gt;Reading the SPIFI command register after WREN returns&amp;nbsp;0xEBD30001. The most significant byte (0xEB) stands for : &amp;nbsp;Quad I/O High Performance Read. I think the pSpifi-&amp;amp;gt;cmd doesn't work because the cancel_mem_mode is working (I'm not able to read data then).&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Is there anyone who succeed to protect sectors ? Or maybe I'm missing something ?&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Thanks in advance,&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Cyril&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 16:37:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/solved-Protecting-SPI-flash-sectors-using-lib-spifi-drv-m4-LPC43/m-p/521916#M4552</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T16:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: [solved]Protecting SPI flash sectors using lib (spifi_drv_m4) LPC43</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/solved-Protecting-SPI-flash-sectors-using-lib-spifi-drv-m4-LPC43/m-p/521917#M4553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by cyrilfougeray on Wed May 29 06:01:33 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;P&gt;I found needed information for protecting my SPI flash using high level functions :&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;First :&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;p style="padding-left: 30px;"&amp;gt;Serial flash devices provide write-protection in several ways. Most devices simply have 2 to 5 bits in their status registers that specify what fraction of the device is write protected, possibly in conjunction with a bit that specifies whether the fraction is at top or bottom and/or a bit that specifies whether the fraction is protected or unprotected. For such devices, at the start of spifi_program or spifi_erase the driver simply saves the status byte, then clears all of the 2 to 5 bits, so that the whole device is write-enabled. The opers.protect value of a spifi_program or spifi_erase on such a device can be 0 to leave the device fully write-enabled, -1 to restore the protection status saved at the start of the call, or any other non-zero value to set the protection status to that value. (Consult the device data sheet for the content of the latter value.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;div&amp;gt;And :&amp;nbsp;&amp;lt;/div&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;div&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;div style="padding-left: 30px;"&amp;gt;A spifi_program call with source equal to opers.dest and opers.options not including S_FORCE_ERASE will not do any erasing nor programming, since the data at opers.dest is equal to the data at source. Such a call can be used to protect or unprotect sector(s) depending on the value of opers.protect.&amp;lt;/div&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/div&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;div&amp;gt;More information about how to use the lib are in the PDF.&amp;lt;/div&amp;gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 16:37:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/solved-Protecting-SPI-flash-sectors-using-lib-spifi-drv-m4-LPC43/m-p/521917#M4553</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T16:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: [solved]Protecting SPI flash sectors using lib (spifi_drv_m4) LPC43</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/solved-Protecting-SPI-flash-sectors-using-lib-spifi-drv-m4-LPC43/m-p/521918#M4554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by cyrilfougeray on Fri May 31 07:58:20 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;P&gt;For further information,&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;opers.protect is two bytes long : the most significant byte determines the configuration register of the SPI flash and the least determines the status register.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;You can configure these SPI Flash registers using the spifi_program function with source = dest, length = 0 and no option.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;After each operation, these two registers are accessible in obj.stat.hw.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 16:37:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/solved-Protecting-SPI-flash-sectors-using-lib-spifi-drv-m4-LPC43/m-p/521918#M4554</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T16:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: [solved]Protecting SPI flash sectors using lib (spifi_drv_m4) LPC43</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/solved-Protecting-SPI-flash-sectors-using-lib-spifi-drv-m4-LPC43/m-p/521919#M4555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by cyrilfougeray on Wed Jun 05 02:09:55 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;P&gt;Some information here (see Drivers/lib/spifi_reportv0.1) :&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.lpcware.com%2Fsystem%2Ffiles%2Flpc18xx-2012-12-11.zip" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/system/files/lpc18xx-2012-12-11.zip&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 16:37:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/solved-Protecting-SPI-flash-sectors-using-lib-spifi-drv-m4-LPC43/m-p/521919#M4555</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T16:37:53Z</dc:date>
    </item>
  </channel>
</rss>

