<?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>Vybrid Processors中的主题 QSPI erase/program when booting XIP</title>
    <link>https://community.nxp.com/t5/Vybrid-Processors/QSPI-erase-program-when-booting-XIP/m-p/296469#M2539</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When starting manually the app from QSPI XIP (i.e. quadspi_init(); asm("b 0x20000800");) everything was working fine. However when booting instead with QSPI RCON, the app was running ok but any QSPI erase/program operations failed (erase/program routines in ram and interrupts disabled since running XIP).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Turned out it was necessary to insert a QSPI software reset during QSPI initialization. But then I found out that this would work with 1N02G but NOT with 2N02G.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the piece of code I'm now using which so far seems to be working fine in both cases (CA5):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; unsigned int *version = (unsigned int *)0x80; // read Vybrid chip version&lt;BR /&gt;&amp;nbsp; switch (*version) {&lt;BR /&gt;&amp;nbsp; case 0x11:&amp;nbsp; // 1N02G&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; QuadSPI0-&amp;gt;MCR = QuadSPI_MCR_SWRSTSD_MASK | QuadSPI_MCR_SWRSTHD_MASK; // QSPI software reset&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; QuadSPI0-&amp;gt;MCR = QuadSPI_MCR_DDR_EN_MASK | QuadSPI_MCR_MDIS_MASK;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;/P&gt;&lt;P&gt;&amp;nbsp; case 0x13:&amp;nbsp; // 2N02G&lt;BR /&gt;&amp;nbsp; default:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; QuadSPI0-&amp;gt;MCR |= QuadSPI_MCR_DDR_EN_MASK | QuadSPI_MCR_MDIS_MASK;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;BR /&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tested with both flash parallel and single mode&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 May 2014 08:57:54 GMT</pubDate>
    <dc:creator>pato3</dc:creator>
    <dc:date>2014-05-13T08:57:54Z</dc:date>
    <item>
      <title>QSPI erase/program when booting XIP</title>
      <link>https://community.nxp.com/t5/Vybrid-Processors/QSPI-erase-program-when-booting-XIP/m-p/296469#M2539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When starting manually the app from QSPI XIP (i.e. quadspi_init(); asm("b 0x20000800");) everything was working fine. However when booting instead with QSPI RCON, the app was running ok but any QSPI erase/program operations failed (erase/program routines in ram and interrupts disabled since running XIP).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Turned out it was necessary to insert a QSPI software reset during QSPI initialization. But then I found out that this would work with 1N02G but NOT with 2N02G.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the piece of code I'm now using which so far seems to be working fine in both cases (CA5):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; unsigned int *version = (unsigned int *)0x80; // read Vybrid chip version&lt;BR /&gt;&amp;nbsp; switch (*version) {&lt;BR /&gt;&amp;nbsp; case 0x11:&amp;nbsp; // 1N02G&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; QuadSPI0-&amp;gt;MCR = QuadSPI_MCR_SWRSTSD_MASK | QuadSPI_MCR_SWRSTHD_MASK; // QSPI software reset&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; QuadSPI0-&amp;gt;MCR = QuadSPI_MCR_DDR_EN_MASK | QuadSPI_MCR_MDIS_MASK;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;/P&gt;&lt;P&gt;&amp;nbsp; case 0x13:&amp;nbsp; // 2N02G&lt;BR /&gt;&amp;nbsp; default:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; QuadSPI0-&amp;gt;MCR |= QuadSPI_MCR_DDR_EN_MASK | QuadSPI_MCR_MDIS_MASK;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;BR /&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tested with both flash parallel and single mode&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 May 2014 08:57:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Vybrid-Processors/QSPI-erase-program-when-booting-XIP/m-p/296469#M2539</guid>
      <dc:creator>pato3</dc:creator>
      <dc:date>2014-05-13T08:57:54Z</dc:date>
    </item>
  </channel>
</rss>

