大学生
最后登录1970-1-1
在线时间 小时
注册时间2016-7-18
|
- int main(void)
- {
- /* ÅäÖÃ′®¿ú1Îa£o115200 8-N-1 */
- USART1_Config();
- printf("\r\n ÕaêÇò»¸ö8M′®DDflash(W25X64)êμÑé \r\n");
-
- /* 8M′®DDflash W25Q643õê¼»ˉ */
- SPI_FLASH_Init();
-
- /* Get SPI Flash Device ID */
- <font color="#ff0000"> DeviceID = SPI_FLASH_ReadDeviceID();</font>
-
- Delay( 200 );
-
- /* Get SPI Flash ID */
- //FlashID = SPI_FLASH_ReadID();
-
- printf("\r\n FlashID is 0x%X, Manufacturer Device ID is 0x%X\r\n", FlashID, DeviceID);
-
- /* Check the SPI Flash ID */
- if (1) /* #define sFLASH_ID 0XEF4017 */
- {
- printf("\r\n ¼ì2aμ½»a°î′®DDflash W25X64 !\r\n");
-
- /* Erase SPI FLASH Sector to write on */
- SPI_FLASH_SectorErase(FLASH_SectorToErase);
-
- /* ½«·¢Ëí»o3åÇøμÄêy¾YD′μ½flashÖD */
- SPI_FLASH_BufferWrite(Tx_Buffer, FLASH_WriteAddress, BufferSize);
- printf("\r\n D′èëμÄêy¾YÎa£o%s \r\t", Tx_Buffer);
-
- /* ½«¸Õ¸ÕD′èëμÄêy¾Y¶á3öà′·Åμ½½óêÕ»o3åÇøÖD */
- SPI_FLASH_BufferRead(Rx_Buffer, FLASH_ReadAddress, BufferSize);
- printf("\r\n ¶á3öμÄêy¾YÎa£o%s \r\n", Tx_Buffer);
-
- /* ¼ì2éD′èëμÄêy¾Yóë¶á3öμÄêy¾YêÇ·ñÏàμè */
- TransferStatus1 = Buffercmp(Tx_Buffer, Rx_Buffer, BufferSize);
-
- if( PASSED == TransferStatus1 )
- {
- printf("\r\n 8M′®DDflash(W25X64)2aêÔ3é1|!\n\r");
- }
- else
- {
- printf("\r\n 8M′®DDflash(W25X64)2aêÔ꧰ü!\n\r");
- }
- }// if (FlashID == sFLASH_ID)
- else
- {
- printf("\r\n »ñè¡2»μ½ W25X64 ID!\n\r");
- }
-
- SPI_Flash_PowerDown();
- while(1);
- }
复制代码 请问一下为啥注释掉红色的字后,不能把数据写入flash,难道flash操作必须读取设备地址一次??
|
|