Difference between revisions of "Flash"

From ElectroDragon
Jump to navigation Jump to search
(Programming by CH341)
(Changed redirect target from Category:SPI Flash to Category:Flash)
(Tag: Redirect target changed)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
== Flash ==
+
#redirect [[category: Flash ]]
{| class="wikitable sortable"
 
|-
 
! Model !! Package !! Size !! Type !! Price
 
|-
 
| W25Q16JVSSIG || SOIC-8 || 2MB || SPI FLASH || 1
 
|-
 
| - || SOIC-8 || 4MB || SPI FLASH || 1.5
 
|-
 
| W25Q64JVSSIQ || SOIC-8 || 8MB || SPI FLASH || 1.5
 
|-
 
| W25Q128JVSSIQ || SOIC-8 || 16MB (128Mbit) || SPI FLASH || 3.5
 
|-
 
| W25Q256JVEIQ || WSON8 || 32MB || SPI FLASH || 8
 
 
 
|-
 
| MX25L25645 || SOIC-8 || 32MB || SPI FLASH || 7.5
 
|-
 
| MX30LF1G08AA-TI || 48-TSOP || 128MB || NAND FLASH || 5
 
|}
 
== Pin Wiring ==
 
* Programming guide using CH341 please see [[CH341 SDK]] page
 
* CLK - CLK
 
* IO0 = DI - MOSI
 
* IO1 = DO - MISO
 
* CS - CS
 
* 3V3 / GND - 3V3 / GND
 
 
 
== Knowlege ==
 
* 绝大多数的单片机和微控制器(ARM,x86),地址空间都是以字节为单位的,也就是说一个地址是一个字节。
 
* Flash存储器有个特点,就是只能写0,不能写1。所以如果原来的地址有数据了,意味着有一些位为0,这些位就相当于无效了。所以必须写之前确保他们都为1,只有擦除才可以。另外每次擦除都必须擦除一个4K大小的扇区,这是flash的特性所决定的。
 
* 对Flash操作前必需打开内部振荡器。
 
 
 
== STM32 Code ==
 
Read, notice address should be 0x08006900 ... 0x08006910 ... 0x08006920
 
uint8_t dat1 = *(__IO uint32_t *)(0x08006900);
 
uint8_t dat2 = *(__IO uint32_t *)(0x08006910);
 
uint8_t dat3 = *(__IO uint32_t *)(0x08006920);
 
<gallery>
 
File:Flash_address_map.png | address map of STM32F030
 
</gallery>
 
 
 
 
 
== SPI Flash ==
 
* SST - SST25VF016B-50-4C-S2AF
 
* Winbond - W25Q64FVSSIG
 
[[File:25Q128FVSG.png|thumbnail]]
 
* Simple wiring
 
D13, D12, D11, D10 of arduino to SPI flash - CLK, DO, DI and CS,
 
3V3 arduino to 3v3, wp, hold, and GND of arduino to GND
 
* Data need to be erased before write again.
 
* flash winbond W25Q SPI Flash
 
[[File:W25Q SPI Flash.jpeg|400px]]
 
* [https://github.com/Marzogh/SPIFlash Arduino SPIFlash library]
 
== Programming ==
 
=== Programming by CH341 ===
 
[[File:Spi flash prog.png|thumb|right]]
 
* Use tool CH341 Programmer from github, download below
 
* wiring please refer to page [[Flash#Pin_Wiring]], use CE0 for this board
 
* Switch board power supply to 3V3, and MODE to others
 
* press "detect" in tools and you should see like this.
 
 
 
=== (Obsolete) Update on-board SPI-Flash ===
 
Here is an example of our MT7688AN board, flash uboot or firmware
 
<gallery>
 
File:Update_spi_flash.png | 01 wire up
 
File:Update_spi_flash_02.png | 02 connect to programmer
 
File:Update_spi_flash_03.png | Click program to upload
 
</gallery>
 
* No need to connect anymore, use programmer power supply
 
* Connect pin VDD, MOSI, CLK, MISO, CS, GND
 
* Detect on board SPI Flash size 16Mb, which is W25Q128FVSSIG
 
* Upload you file, uboot or firmware
 
 
 
== Documents ==
 
* [[:File:W25Q64.pdf | Winbond W25Q64]]
 
 
 
 
 
 
 
[[category: Memory]]
 

Latest revision as of 03:00, 30 April 2021

Redirect to: