[转帖]如何将数据写入到SPI闪存?
我一直在测试ALU和startKIT,我想要测量别的东西,所以我认为,写和转储到内存中。然后需要一些时间的。
但是在startkit中如何使用SPI 闪存没有文档,只有为slicekit。
所以这是怎么做呢?
回答:
唯一需要修改的的事情就是改变目标STARTKIT在app_flashlib_example / Makefile文件
mba:app_flashlib_example bianco$ xmake
Creating dependencies for main.xc
No modules used.
Compiling main.xc
Creating app_flashlib_example.xe
Build Complete
Done
mba:app_flashlib_example bianco$ cd bin
mba:bin bianco$ xflash --boot-partition-size 65536 app_flashlib_example.xe
Warning: F03098 Factory image and boot loader cannot be write-protected on flash device on node "0".
Site 0 has finished.
xflash succeeded
mba:bin bianco$ xrun --io app_flashlib_example.xe
FLASH fitted : WINBOND W25X20.
FLASH size: 262144 bytes.
FLASH page size: 256 bytes.
FLASH data partition size: 196608 bytes.
FLASH number of pages in data partition: 768
FLASH number of sectors in data partition: 48
FLASH data sector size: 4096 bytes.
Data partition erased!
Data partition written!
Data partition read! Data: Hello World!
FLASH tested successfully!
回复:
makefile中已经有设定STARTKIT目标
这是什么?命令?mba:app_flashlib_example bianco$ cd bin mba:bin bianco$ xflash --boot-partition-size 65536 app_flashlib_example.xe
回答:
我使用UNIX命令行,等效于xTIMEcomposer这里也说明:下部分“写入Flash中的应用”。这将编写应用程序闪存,更重要的是它会安装一个非常原始的“文件系统”。设置在引导分区的大小是必需的,因为其余的将被用作数据分区。
尝试libflash:它本质上并没有部署它,startKIT或SliceKIT或别的东西哪个平台上无所谓。在你最需要配置需要使用的端口(如闪存芯片是不是迷上了在默认引脚)
回复:
当我看到在文件中指定的端口进行startKIT如下,MISO,CN_N,M_CK和MOSI。并且在该示例中使用的是:在stdcore [0]:fl_SPIPorts flash_ports = {PORT_SPI_MISO,PORT_SPI_SS,PORT_SPI_CLK,PORT_SPI_MOSI,XS1_CLKBLK_1}; 试图改变为DOC说的,但没有运气。
我没有得到的文档的权限,但它的运行,但它不会写任何对Flash的某些原因。
回复:
为什么它不工作。
控制台是向我写这一点;
FLASH fitted : WINBOND W25X20.
FLASH size: 262144 bytes.
FLASH page size: 256 bytes.
FLASH data partition size: 0 bytes.
FLASH number of pages in data partition: 0
FLASH number of sectors in data partition: 0
FLASH data sector size: 0 bytes.
Data partition erased!
Could not write the data partition
为什么不能把它写并从中读取,因为它应该做的事..我已经尝试从SpecMacro.h所有有多种不同的宏,并奔设置XCC_FLAGS make文件。以-lflash
回答:
你用的xflash与-boot分区大小的选择吗?
发表时间:2014年8月31日10:06:37