This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C6743 SPI接FLASH,自己写的程序一直运行在写程序里面,有没有测试Flash的具体例子??????

C6743 SPI接FLASH,自己写的程序一直运行在写程序里面,有没有测试Flash的具体例子??????

  • 你可以参考一下这里的例程:

    EVMOMAPL137 Test Code
    EVMOMAPL137 test code and board support library
    ZIP - 10/10/12

    下载后,路径\revg_EVMOMAPL137_BSL\evmc6747_v1\dsp\tests\spiflash下。

  • 谢谢,能否解释下

    if ((eraseaddr & spiflash_SECTORSIZE) != ((eraseaddr + bytes_to_erase) & spiflash_SECTORMASK))
    bytes_to_erase -= (eraseaddr + bytes_to_erase) - ((eraseaddr + bytes_to_erase) & spiflash_SECTORMASK);

    是什么意思? 程序中的SECTORMASK是怎么来的?

    实在看不懂,看了好多天啦,麻烦解释一下,谢谢啦!!!

  • SECTORMASK是根据spiflash_SECTORSIZE计算得来的,在spiflash.h中定义好的。如下

    #define spiflash_PAGESIZE 256
    #define spiflash_PAGEMASK 0xffffff00
    #define spiflash_SECTORSIZE 4096
    #define spiflash_SECTORMASK 0xfffff000

    这个算法主要就是计算出实际需要擦除的总字节数。你可以自己假设一个字节数,然后套在这个公式里算一下,就明白了。


  • 还是不太明白 if ((eraseaddr & spiflash_SECTORSIZE) != ((eraseaddr + bytes_to_erase) & spiflash_SECTORMASK))这个判断的用意,不太懂,能否举个例子说明,谢谢啦

  • 您好,还想请教一下您, i

    f(i==len)
        SPI_SPIDAT1=(spidat1&0xffcffff)|buf[i];

    这句话作用是把CS拉低吗?但看手册上说The CS# must go high exactly at the byte boundary (the latest eighth of address byte been latched-in);
    otherwise, the instruction will be rejected and not executed.   是在写命令的最后一个字节的最后一位时把CS拉高,这两者冲突吗?  实在是搞不懂,谢谢啦,麻烦你拉!!!

x 出现错误。请重试或与管理员联系。