Category:Flash

From ElectroDragon Wiki

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);


SPI Flash

  • SST - SST25VF016B-50-4C-S2AF
  • Winbond - W25Q64FVSSIG
25Q128FVSG.png
  • 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

W25Q SPI Flash.jpeg

Programming

Programming by CH341

Spi flash prog.png
  • 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

  • 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

Pages in category "Flash"

The following 5 pages are in this category, out of 5 total.