All Projects → nopnop2002 → esp-idf-w25q64

nopnop2002 / esp-idf-w25q64

Licence: MIT License
SPI Flash Memory W25Q64 Access Library for esp-idf

Programming Languages

c
50402 projects - #5 most used programming language
Makefile
30231 projects
CMake
9771 projects

Projects that are alternatives of or similar to esp-idf-w25q64

Raspberry-W25Q64
SPI Flash Memory W25Q64 Access Library for RaspberryPi
Stars: ✭ 37 (+208.33%)
Mutual labels:  spiflash, w25q80, w25q16, w25q32, w25q64, w25q128
w25qxx
w25qxx full function driver
Stars: ✭ 440 (+3566.67%)
Mutual labels:  w25q80, w25q16, w25q32, w25q64, w25q128
ESP32-USB-Soft-Host
An Arduino wrapper to @sdima1357's usb_soft_host esp-idf example
Stars: ✭ 119 (+891.67%)
Mutual labels:  esp32, esp-idf, esp32s2
gfx demo
GFX Demo for Arduino and the ESP-IDF
Stars: ✭ 63 (+425%)
Mutual labels:  esp32, esp-idf
esp32-freqcount
ESP32 Frequency Counter using Pulse Counter and Remote Control modules
Stars: ✭ 48 (+300%)
Mutual labels:  esp32, esp-idf
esp-idf-parallel-tft
8bit parallel TFT & 4-line resistance touch screen Driver for esp-idf using i2s paralell mode
Stars: ✭ 45 (+275%)
Mutual labels:  esp32, esp-idf
wireless-esp8266-dap
ESP8266 Wireless Debugger. Based on CMSIS-DAP v2.0.0. Optional 40MHz SPI acceleration, etc. ESP8266 无线调试器
Stars: ✭ 154 (+1183.33%)
Mutual labels:  esp32, esp-idf
esp32-e-paper-weatherdisplay
An ESP32 and 4.2" ePaper Display reads Dark Sky weather API and displays the weather using ESP-IDF
Stars: ✭ 110 (+816.67%)
Mutual labels:  esp32, esp-idf
esp32-xbee
ESP32 XBee UART Interface
Stars: ✭ 48 (+300%)
Mutual labels:  esp32, esp-idf
esp-idf-json
Example of JSON Serialize and Deserialize in ESP-IDF
Stars: ✭ 29 (+141.67%)
Mutual labels:  esp32, esp-idf
esp32-ds18b20
ESP32-compatible C library for Maxim Integrated DS18B20 Programmable Resolution 1-Wire Digital Thermometer.
Stars: ✭ 61 (+408.33%)
Mutual labels:  esp32, esp-idf
PyDOS
DOS-like OS for microcontroller boards running Micropython or Circuitpython
Stars: ✭ 40 (+233.33%)
Mutual labels:  esp32, esp32s2
MQTT VPN
IP over MQTT for ESP controllers and Linux
Stars: ✭ 95 (+691.67%)
Mutual labels:  esp32, esp-idf
esp32-epaper-display
Server and software to use an ESP32 as a connected display
Stars: ✭ 73 (+508.33%)
Mutual labels:  esp32, esp-idf
opcua-esp32
Embedded OPC UA Server on ESP32 based on open62541 stack
Stars: ✭ 82 (+583.33%)
Mutual labels:  esp32, esp-idf
lis3dh-esp-idf
LIS3DH driver for ESP-IDF (ESP32)
Stars: ✭ 27 (+125%)
Mutual labels:  esp32, esp-idf
esp32-ota
ESP32 OTA based on ThingsBoard Open-source IoT Platform
Stars: ✭ 45 (+275%)
Mutual labels:  esp32, esp-idf
Homekit
Homekit for ESP32 with Arduino framework
Stars: ✭ 80 (+566.67%)
Mutual labels:  esp32, esp-idf
ESP32-LCD-I2S
Espressif ESP32 driving a controller-less monochrome lcd with parallel I2S bus
Stars: ✭ 54 (+350%)
Mutual labels:  esp32, esp-idf
esp-idf-vscode-boilerplate
Boilerplate for developing ESP-IDF applications using VS Code
Stars: ✭ 26 (+116.67%)
Mutual labels:  esp32, esp-idf

esp-idf-w25q64

SPI Flash Memory W25Q64 Access Library for esp-idf.
I ported from here.

Software requirements

esp-idf v4.4 or later.
This is because this version supports ESP32-C3.

Installation for ESP32

git clone https://github.com/nopnop2002/esp-idf-w25q64
cd esp-idf-w25q64
idf.py set-target esp32
idf.py menuconfig
idf.py flash

Installation for ESP32-S2

git clone https://github.com/nopnop2002/esp-idf-w25q64
cd esp-idf-w25q64
idf.py set-target esp32s2
idf.py menuconfig
idf.py flash

Installation for ESP32-C3

git clone https://github.com/nopnop2002/esp-idf-w25q64
cd esp-idf-w25q64
idf.py set-target esp32c3
idf.py menuconfig
idf.py flash

Note
For some reason, there are development boards that cannot use GPIO06, GPIO08, GPIO09, GPIO19 for SPI clock pins.
According to the ESP32C3 specifications, these pins can also be used as SPI clocks.
I used a raw ESP-C3-13 to verify that these pins could be used as SPI clocks.

Configuration

You have to set this config value with menuconfig.

  • CONFIG_MISO_GPIO
    GPIO number(IOxx) to MISO.
  • CONFIG_MOSI_GPIO
    GPIO number(IOxx) to MOSI.
  • CONFIG_SCLK_GPIO
    GPIO number(IOxx) to SCLK.
  • CONFIG_CS_GPIO
    GPIO number(IOxx) to CS.

config-main

config-esp32

Wireing

# W25Q64 ESP32 ESP32-S2 ESP32-C3
1 /CS -- GPIO5 GPIO34 GPIO9
2 MISO -- GPIO19 GPIO33 GPIO18
3 /WP -- 3.3V 3.3V 3.3V
4 GND -- GND GND GND
5 MOSI -- GPIO23 GPIO35 GPIO19
6 SCK -- GPIO18 GPIO36 GPIO10
7 /HOLD -- 3.3V 3.3V 3.3V
8 VCC -- 3.3V 3.3V 3.3V

You can change it to any pin using menuconfig.
But it may not work with other GPIOs.

API

// Start Flash
void spi_master_init(W25Q64_t * dev, int GPIO_CS);

// Get status register1
esp_err_t W25Q64_readStatusReg1(W25Q64_t * dev, uint8_t * reg1);

// Get status register2(Winbond only)
esp_err_t W25Q64_readStatusReg2(W25Q64_t * dev, uint8_t * reg2);

// Get Unique ID(Winbond only)
esp_err_t W25Q64_readUniqieID(W25Q64_t * dev, uint8_t * id);

// Get JEDEC ID(Manufacture, Memory Type,Capacity)
esp_err_t W25Q64_readManufacturer(W25Q64_t * dev, uint8_t * id);

// Check busy
bool W25Q64_IsBusy(W25Q64_t * dev);

// Set power down mode
esp_err_t W25Q64_powerDown(W25Q64_t * dev);;

// Set write enable
esp_err_t W25Q64_WriteEnable(W25Q64_t * dev);

// Set write disable
esp_err_t W25Q64_WriteDisable(W25Q64_t * dev);

// Read data from memory
uint16_t W25Q64_read(W25Q64_t * dev, uint32_t addr, uint8_t *buf, uint16_t n);

// First read data from memory
uint16_t W25Q64_fastread(W25Q64_t * dev, uint32_t addr, uint8_t *buf, uint16_t n);

// Erase data by Sector
bool W25Q64_eraseSector(W25Q64_t * dev, uint16_t sect_no, bool flgwait);

// Erase data by block(64KB)
bool W25Q64_erase64Block(W25Q64_t * dev, uint16_t blk_no, bool flgwait);

// Erase data by Block(32KB)
bool W25Q64_erase32Block(W25Q64_t * dev, uint16_t blk_no, bool flgwait);

// Erase all data
bool W25Q64_eraseAll(W25Q64_t * dev, bool flgwait);

// Write data to memory
int16_t W25Q64_pageWrite(W25Q64_t * dev, uint16_t sect_no, uint16_t inaddr, uint8_t* buf, int16_t n);

Winbond

Device # of Bytes Address range # of 4K-Sectors # of 32K-Blocks # of 64K-Blocks JEDEC ID
W25Q80 1M 0x0FFFFF 256 32 16 EF-40-14
W25Q16 2M 0x1FFFFF 512 64 32 EF-40-15
W25Q32 4M 0x3FFFFF 1024 128 64 EF-40-16
W25Q64 8M 0x7FFFFF 2048 256 128 EF-40-17
W25Q128 16M 0xFFFFFF 4096 512 256 EF-40-18

W25Q80

W25Q80

  • Manufacturer:
    Byte1 : ManufacturerID(0xef=Winbond)
    Byte2 : MemoryType(0x40=SPI/0x60=QPI)
    Byte3 : Capacity(2^0x14=2^20=0x100000=1M Byte=8M Bit)
  • First 10Byte : ASCII 0-9
  • Next 32Byte : ASCII A-Z

W25Q16

W25Q16

W25Q32

W25Q32

W24Q64

W25Q64

W25Q128

W25Q128


MACRONIX

Device # of Bytes Address range # of 4K-Sectors # of 32K-Blocks # of 64K-Blocks JEDEC ID
MX25L3206E 4M 0x3FFFFF 1024 128 64 C2-20-16
MX25L6473E 8M 0x7FFFFF 2048 256 128 C2-20-17
MX25L12835F 16M 0xFFFFFF 4096 512 256 C2-20-18

MX25L3206E

MX25L3206E

  • Manufacturer:
    Byte1 : ManufacturerID(0xc2=Macronix)
    Byte2 : MemoryType(0x20)
    Byte3 : Capacity(2^0x16=2^22=0x400000=4M Byte=32M Bit)

MX25L6473E

MX25L6473E

MX25L12835F

MX25L12835F


Note

I tested these.
But I couldn't get it working.

  • GD25Q64
  • SST25VF016B
  • SST25VF032B

Note

There is a example to build a FAT file system on External SPI FLSAH Memory is available here.
The ESP32's onboard FLASH is 4MByte, and you can reserve up to about 3MByte of storage on the onboard FLASH.
With the large capacity SPI FLSAH Memory, you can add a large amount of storage.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].