过问_小白 发表于 2022-3-3 09:49

QSPI读写flash及擦除

<p style="margin-left:48px; text-indent:0cm; text-align:justify">本来是想测试一下低功耗,看到要割板子,就留后面再测试,先来跑一下外挂flash的功能。</p>

<p style="margin-left:48px; text-indent:0cm; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;">1.<span style="font-family:宋体">确定硬件部分</span></span></span></p>

<p style="margin-left:24px; text-align:justify; text-indent:21pt"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><span style="font-family:宋体">(</span>1<span style="font-family:宋体">)我们先查看</span>datasheet<span style="font-family:宋体">确定</span>SPI0<span style="font-family:宋体">接口如下</span></span></span></p>

<p style="margin-left:24px; text-align:justify; text-indent:21pt"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;">&nbsp;&nbsp;&nbsp;&nbsp; PB3<span style="font-family:宋体">:</span>SPI_SCK</span></span></p>

<p style="margin-left:24px; text-align:justify; text-indent:21pt"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;">&nbsp;&nbsp;&nbsp;&nbsp; PB4<span style="font-family:宋体">:</span>SPI0_MISO</span></span></p>

<p style="margin-left:24px; text-align:justify; text-indent:21pt"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;">&nbsp;&nbsp;&nbsp;&nbsp; PB5<span style="font-family:宋体">:</span>SPI0_MOSI</span></span></p>

<p style="margin-left:24px; text-align:justify; text-indent:21pt"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;">&nbsp;&nbsp;&nbsp;&nbsp; PB6<span style="font-family:宋体">:</span>SPI0_IO2</span></span></p>

<p style="margin-left:24px; text-align:justify; text-indent:21pt"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;">&nbsp;&nbsp;&nbsp;&nbsp; PB7<span style="font-family:宋体">:</span>SPI0_IO3</span></span></p>

<p style="margin-left:24px; text-align:justify; text-indent:21pt"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;">&nbsp;&nbsp;&nbsp;&nbsp; PB1<span style="font-family:宋体">:</span>SPI0_CS</span></span></p>

<p style="margin-left:24px; text-align:justify; text-indent:21pt"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><span style="font-family:宋体">(</span>2<span style="font-family:宋体">)查找一下</span>flash<span style="font-family:宋体">管脚图</span></span></span></p>

<p style="margin-left:24px; text-align:justify; text-indent:21pt"> &nbsp;</p>

<p style="margin-left:24px; text-align:justify; text-indent:21pt"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><span style="font-family:宋体">(</span>3<span style="font-family:宋体">)搭一个</span>flash<span style="font-family:宋体">小板,对应上面</span>IO<span style="font-family:宋体">,电源,</span>GND<span style="font-family:宋体">连到开发板。</span></span></span></p>

<p style="margin-left:24px; text-align:justify; text-indent:21pt"> &nbsp;</p>

<p style="margin-left:24px; text-align:justify; text-indent:21pt"> &nbsp;</p>

<p style="margin-left:24px; text-align:justify; text-indent:21pt"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;">2.<span style="font-family:宋体">添加软件部分</span></span></span></p>

<ol>
        <li style="margin-left:74px; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><span style="font-family:宋体">添加驱动部分</span>Soft_Drive<span style="font-family:宋体">(</span>gd25qxx.c<span style="font-family:宋体">和</span>gd25qxx.h<span style="font-family:宋体">);</span></span></span></li>
        <li style="margin-left:74px; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><span style="font-family:宋体">初始化</span><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#008200">SPI0&nbsp;GPIO and&nbsp;parameter</span></span></span></span></span></li>
</ol>

<p style="margin-left:76px; text-indent:27.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:black">spi_flash_init();&nbsp;</span></span></span></span></span></p>

<ol start="3">
        <li style="margin-left:74px; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><span style="font-family:宋体">擦除</span>flash</span></span></li>
</ol>

<p style="margin-left:114px; text-indent:0cm; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><b><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#006699">void</span></span></span></b><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:black">&nbsp;spi_flash_sector_erase(uint32_t&nbsp;sector_addr);&nbsp;&nbsp;</span></span></span></span></span></p>

<p style="margin-left:114px; text-indent:0cm; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><span style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:宋体"><span style="color:black">擦除一个</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#008200">sector</span></span></span><span style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:宋体"><span style="color:#008200">:</span></span></span>&nbsp;<span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:black"> 0x0000-0x0fff&nbsp;&nbsp;</span></span></span></span></span></p>

<p style="margin-left:114px; text-indent:0cm; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><b><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#006699">void</span></span></span></b><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:black">&nbsp;spi_flash_block_erase(uint8_t&nbsp;block_addr);&nbsp;&nbsp;</span></span></span></span></span></p>

<p style="margin-left:114px; text-indent:0cm; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><span style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:宋体"><span style="color:black">擦除一个</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#008200">block</span></span></span><span style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:宋体"><span style="color:#008200">:</span></span></span>&nbsp;<span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:black"> 0x000000-0x00ffff&nbsp;</span></span></span></span></span></p>

<p style="margin-left:114px; text-indent:0cm; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><b><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#006699">void</span></span></span></b><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:black">&nbsp;spi_flash_bulk_erase(</span></span></span><b><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#006699">void</span></span></span></b><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:black">);&nbsp;&nbsp;</span></span></span></span></span></p>

<p style="margin-left:114px; text-indent:0cm; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><span style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:宋体"><span style="color:black">擦除整个</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#008200">chip</span></span></span></span></span></p>

<ol start="4">
        <li style="margin-left:74px; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><span style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:宋体"><span style="color:#008200">读写</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#008200">flash</span></span></span></span></span></li>
</ol>

<p style="margin-left:66px; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#008200">/*&nbsp;write&nbsp;block&nbsp;of&nbsp;data&nbsp;to&nbsp;the&nbsp;flash&nbsp;using&nbsp;qspi&nbsp;*/</span></span></span>&nbsp;&nbsp;</span></span></p>

<p style="margin-left:28px; text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><b><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#006699">void</span></span></span></b><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:black">&nbsp;qspi_flash_buffer_write(uint8_t&nbsp;*pbuffer,&nbsp;uint32_t&nbsp;write_addr,&nbsp;uint16_t&nbsp;num_byte_to_write);&nbsp;</span></span></span></span></span></p>

<p style="margin-left:28px; text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;">&nbsp;<span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#008200">/*&nbsp;read&nbsp;a&nbsp;block&nbsp;of&nbsp;data&nbsp;from&nbsp;the&nbsp;flash&nbsp;using&nbsp;qspi&nbsp;*/</span></span></span>&nbsp;&nbsp;</span></span></p>

<p style="margin-left:28px; text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><b><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#006699">void</span></span></span></b><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:black">&nbsp;qspi_flash_buffer_read(uint8_t&nbsp;*pbuffer,&nbsp;uint32_t&nbsp;read_addr,&nbsp;uint16_t&nbsp;num_byte_to_read);</span></span></span></span></span></p>

<p style="margin-left:28px; text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><b><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#006699">(5)</span></span></span></b><b><span style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:宋体"><span style="color:#006699">下载程序,打印结果</span></span></span></b></span></span></p>

<p style="margin-left:28px; text-indent:21.0pt; text-align:justify"> &nbsp;</p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><b><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#006699">3.</span></span></span></b><b><span style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:宋体"><span style="color:#006699">关于不同</span></span></span></b><b><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#006699">flash,quad</span></span></span></b><b><span style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:宋体"><span style="color:#006699">模式的设置</span></span></span></b></span></span></p>

<div style="border-left:solid #6ce26c 2.25pt; padding:0cm 0cm 0cm 0cm; margin-left:24px">
<ol>
        <li align="left" style="border:none; text-align:left; padding:0cm"><span style="background:white"><span style="font-size:10.5pt"><span style="background:white"><span style="10.5pt"><span style="tab-stops:list 36.0pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><b><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#006699">void</span></span></span></b><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:black">&nbsp;qspi_flash_quad_enable(</span></span></span><b><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#006699">void</span></span></span></b><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:black">)&nbsp;&nbsp;</span></span></span></span></span></span></span></span></span></li>
        <li align="left" style="border:none; text-align:left; padding:0cm"><span style="background:white"><span style="font-size:10.5pt"><span style="background:#f8f8f8"><span style="10.5pt"><span style="tab-stops:list 36.0pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:black">{&nbsp;&nbsp;</span></span></span></span></span></span></span></span></span></li>
        <li align="left" style="border:none; text-align:left; padding:0cm"><span style="background:white"><span style="font-size:10.5pt"><span style="background:white"><span style="10.5pt"><span style="tab-stops:list 36.0pt"><span style="font-family:Calibri,&quot;sans-serif&quot;">&nbsp;&nbsp;&nbsp;&nbsp;<span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#008200">/*&nbsp;enable&nbsp;the&nbsp;write&nbsp;access&nbsp;to&nbsp;the&nbsp;flash&nbsp;*/</span></span></span>&nbsp;&nbsp;</span></span></span></span></span></span></li>
        <li align="left" style="border:none; text-align:left; padding:0cm"><span style="background:white"><span style="font-size:10.5pt"><span style="background:#f8f8f8"><span style="10.5pt"><span style="tab-stops:list 36.0pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:black">&nbsp;&nbsp;&nbsp;&nbsp;spi_flash_write_enable();&nbsp;&nbsp;</span></span></span></span></span></span></span></span></span></li>
        <li align="left" style="border:none; text-align:left; padding:0cm"><span style="background:white"><span style="font-size:10.5pt"><span style="background:white"><span style="10.5pt"><span style="tab-stops:list 36.0pt"><span style="font-family:Calibri,&quot;sans-serif&quot;">&nbsp;&nbsp;&nbsp;&nbsp;<span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#008200">/*&nbsp;select&nbsp;the&nbsp;flash:&nbsp;chip&nbsp;select&nbsp;low&nbsp;*/</span></span></span>&nbsp;&nbsp;</span></span></span></span></span></span></li>
        <li align="left" style="border:none; text-align:left; padding:0cm"><span style="background:white"><span style="font-size:10.5pt"><span style="background:#f8f8f8"><span style="10.5pt"><span style="tab-stops:list 36.0pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:black">&nbsp;&nbsp;&nbsp;&nbsp;SPI_FLASH_CS_LOW();&nbsp;&nbsp;</span></span></span></span></span></span></span></span></span></li>
        <li align="left" style="border:none; text-align:left; padding:0cm"><span style="background:white"><span style="font-size:10.5pt"><span style="background:white"><span style="10.5pt"><span style="tab-stops:list 36.0pt"><span style="font-family:Calibri,&quot;sans-serif&quot;">&nbsp;&nbsp;&nbsp;&nbsp;<span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#008200">/*&nbsp;send&nbsp;&quot;write&nbsp;status&nbsp;register&quot;&nbsp;instruction&nbsp;*/</span></span></span>&nbsp;&nbsp;</span></span></span></span></span></span></li>
        <li align="left" style="border:none; text-align:left; padding:0cm"><span style="background:white"><span style="font-size:10.5pt"><span style="background:#f8f8f8"><span style="10.5pt"><span style="tab-stops:list 36.0pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:black">&nbsp;&nbsp;&nbsp;&nbsp;spi_flash_send_byte(WRSR);&nbsp;&nbsp;</span></span></span></span></span></span></span></span></span></li>
        <li align="left" style="border:none; text-align:left; padding:0cm">&nbsp;</li>
        <li align="left" style="border:none; text-align:left; padding:0cm"><span style="background:white"><span style="font-size:10.5pt"><span style="background:#f8f8f8"><span style="10.5pt"><span style="tab-stops:list 36.0pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:black">&nbsp;&nbsp;&nbsp;&nbsp;spi_flash_send_byte(0x00);&nbsp;&nbsp;</span></span></span></span></span></span></span></span></span></li>
        <li align="left" style="border:none; text-align:left; padding:0cm"><span style="background:white"><span style="font-size:10.5pt"><span style="background:white"><span style="10.5pt"><span style="tab-stops:list 36.0pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:black">&nbsp;&nbsp;&nbsp;&nbsp;spi_flash_send_byte(0x20);&nbsp;&nbsp;</span></span></span></span></span></span></span></span></span></li>
        <li align="left" style="border:none; text-align:left; padding:0cm">&nbsp;</li>
        <li align="left" style="border:none; text-align:left; padding:0cm"><span style="background:white"><span style="font-size:10.5pt"><span style="background:white"><span style="10.5pt"><span style="tab-stops:list 36.0pt"><span style="font-family:Calibri,&quot;sans-serif&quot;">&nbsp;&nbsp;&nbsp;&nbsp;<span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#008200">/*&nbsp;deselect&nbsp;the&nbsp;flash:&nbsp;chip&nbsp;select&nbsp;high&nbsp;*/</span></span></span>&nbsp;&nbsp;</span></span></span></span></span></span></li>
        <li align="left" style="border:none; text-align:left; padding:0cm"><span style="background:white"><span style="font-size:10.5pt"><span style="background:#f8f8f8"><span style="10.5pt"><span style="tab-stops:list 36.0pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:black">&nbsp;&nbsp;&nbsp;&nbsp;SPI_FLASH_CS_HIGH();&nbsp;&nbsp;</span></span></span></span></span></span></span></span></span></li>
        <li align="left" style="border:none; text-align:left; padding:0cm"><span style="background:white"><span style="font-size:10.5pt"><span style="background:white"><span style="10.5pt"><span style="tab-stops:list 36.0pt"><span style="font-family:Calibri,&quot;sans-serif&quot;">&nbsp;&nbsp;&nbsp;&nbsp;<span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#008200">/*&nbsp;wait&nbsp;the&nbsp;end&nbsp;of&nbsp;flash&nbsp;writing&nbsp;*/</span></span></span>&nbsp;&nbsp;</span></span></span></span></span></span></li>
        <li align="left" style="border:none; text-align:left; padding:0cm"><span style="background:white"><span style="font-size:10.5pt"><span style="background:#f8f8f8"><span style="10.5pt"><span style="tab-stops:list 36.0pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:black">&nbsp;&nbsp;&nbsp;&nbsp;spi_flash_wait_for_write_end();&nbsp;&nbsp;</span></span></span></span></span></span></span></span></span></li>
        <li align="left" style="border:none; text-align:left; padding:0cm"><span style="background:white"><span style="font-size:10.5pt"><span style="background:white"><span style="10.5pt"><span style="tab-stops:list 36.0pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:black">}&nbsp;</span></span></span></span></span></span></span></span></span></li>
</ol>
</div>

<p style="text-indent:13.3pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><b><span style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:宋体"><span style="color:#006699">查阅</span></span></span></b><b><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#006699">GD</span></span></span></b><b><span style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:宋体"><span style="color:#006699">的</span></span></span></b><b><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#006699">datasheet</span></span></span></b><b><span style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:宋体"><span style="color:#006699">,可以看到</span></span></span></b><b><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#006699">QE</span></span></span></b><b><span style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:宋体"><span style="color:#006699">的设置</span></span></span></b></span></span></p>

<div style="border-left:solid #6ce26c 2.25pt; padding:0cm 0cm 0cm 0cm; margin-left:24px">
<ol start="18">
        <li align="left" style="border:none; text-align:left; padding:0cm"><span style="background:#f8f8f8"><span style="font-size:10.5pt"><span style="background:#f8f8f8"><span style="10.5pt"><span style="tab-stops:list 36.0pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:black">&nbsp;&nbsp;&nbsp;&nbsp;spi_flash_send_byte(0x00);&nbsp;&nbsp;</span></span></span></span></span></span></span></span></span></li>
        <li align="left" style="border:none; text-align:left; padding:0cm"><span style="background:#f8f8f8"><span style="font-size:10.5pt"><span style="background:white"><span style="10.5pt"><span style="tab-stops:list 36.0pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:black">&nbsp;&nbsp;&nbsp;&nbsp;spi_flash_send_byte(0x20);&nbsp;&nbsp;</span></span></span></span></span></span></span></span></span></li>
</ol>
</div>

<p style="text-indent:13.3pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><b><span style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:宋体"><span style="color:#006699">查阅</span></span></span></b><b><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#006699">KH</span></span></span></b><b><span style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:宋体"><span style="color:#006699">的</span></span></span></b><b><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#006699">datasheet</span></span></span></b><b><span style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:宋体"><span style="color:#006699">,可以看到</span></span></span></b><b><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:#006699">QE</span></span></span></b><b><span style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:宋体"><span style="color:#006699">的设置</span></span></span></b></span></span></p>

<div style="border-left:solid #6ce26c 2.25pt; padding:0cm 0cm 0cm 0cm; margin-left:24px">
<ol>
        <li align="left" style="border:none; text-align:left; padding:0cm"><span style="background:#f8f8f8"><span style="font-size:10.5pt"><span style="background:#f8f8f8"><span style="10.5pt"><span style="tab-stops:list 36.0pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:black">&nbsp;&nbsp;&nbsp;&nbsp;spi_flash_send_byte(0x40);&nbsp;&nbsp;</span></span></span></span></span></span></span></span></span></li>
        <li align="left" style="border:none; text-align:left; padding:0cm"><span style="background:#f8f8f8"><span style="font-size:10.5pt"><span style="background:white"><span style="10.5pt"><span style="tab-stops:list 36.0pt"><span style="font-family:Calibri,&quot;sans-serif&quot;"><span lang="EN-US" style="border:none windowtext 1.0pt; font-size:9.0pt; padding:0cm"><span style="font-family:Consolas"><span style="color:black">&nbsp;&nbsp;&nbsp;&nbsp;spi_flash_send_byte(0x00);&nbsp;&nbsp;</span></span></span></span></span></span></span></span></span></li>
</ol>
</div>

huo_hu 发表于 2022-3-3 11:47

<p>还差挺多的呢</p>

<p>&nbsp;</p>

过问_小白 发表于 2022-3-3 21:46

huo_hu 发表于 2022-3-3 11:47
还差挺多的呢

&nbsp;

<p>什么差挺多?</p>

huo_hu 发表于 2022-3-10 17:00

<p>qspi不用dma会很吃力</p>

wq186 发表于 2022-6-9 10:33

<p>能分享一下原历程吗</p>
页: [1]
查看完整版本: QSPI读写flash及擦除