日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

ESP8266 Flash

發布時間:2025/3/21 编程问答 18 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ESP8266 Flash 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

ESP8266 Flash

目錄

??[隱藏]?
  • 1?概述
    • 1.1?系統參數區 (System param)
    • 1.2?用戶參數區 (User param)
  • 2?Layout Without OTA
  • 3?Layout With OTA
    • 3.1?512 和 1024KB
    • 3.2?4096KB
  • 4?SPI Flash Format
  • 5?SPI Flash Mode
  • 6?Flash Memory Map
    • 6.1?Cache_Read_Enable
  • 7?Reference

1 概述

4KB 為一個扇區 (Sector), The last 16 sectors is the paramter area!

1MB flash is start at 0xF0000

4MB flash is start at 0x3F0000


1.1 系統參數區 (System param)

始終為 Flash 的最后 16KB

  • 4KB 為初始化射頻參數 (esp_init_data_default.bin); The last sector 12; 4MB Flash 為:0x3FC000 - 0x3FCFFF
  • 8KB 為初始化系統參數 (blank.bin); The last sector 13 and 14, 4KB + 4KB mirror; 4MB Flash 為:0x3FD000 - 0x3FEFFF
  • 4KB is bootloader parameters area; The last sector 15; 4MB flash is at: 0x3FF000

皆由 SDK 提供


For MJYUN:

  • 8KB is MJYUN parameter area; The last sector 4 and 5, 4KB + 4KB mirror; 4MB flash is: 0x3F4000 - 0x3F5FFF


1.2 用戶參數區 (User param)

指 Espressif 提供的示例 (IOT_Demo / AT) 中設定的用戶參數區

iBaihe 的參數: 0x3C * 4KB = 0x3C000

COS Platform 參數:

(0x3C + 1) * 4KB = 0x3D000 (SAVE_0) (0x3C + 2) * 4KB = 0x3E000 (SAVE_1) (0x3C + 3) * 4KB = 0x3F000 (PARAM_FLAG)



2 Layout Without OTA

Address Size Name Description 00000h 4k boot.bin Bootloader3C000h 14k Param Start Sector 3D000h 1x4k Param Saved 0 3E000h 1x4k Param Saved 1 3F000h 1x4k Param Flag40000h 240k app.v6.irom0text.bin SDK libraries 7C000h 8k esp_init_data_default.bin Default configuration 7E000h 8k blank.bin Filled with FFh. May be WiFi configuration



3 Layout With OTA

3.1 512 和 1024KB


3.2 4096KB



4 SPI Flash Format

  • http://esp8266-re.foogod.com/wiki/SPI_Flash_Format



5 SPI Flash Mode

  • QIO , for flash that support quad r/w operation(e.g. W25Q)
  • QOUT, for flash that support quad read operation(e.g. W25Q)
  • DIO, for flash that support dual r/w operation(e.g. W25Q &W25X)
  • DOUT, for flash that support dual read operation(e.g. W25Q &W25X)


經測試:

  • Winbond 25Q32B 可工作于 DIO / DOUT / QIO /QOUT (Noduino Falcon)
  • BergMicro 25Q32A 只可工作于 DIO / DOUT (NodeMCU V1.0 可能是 ESP-12E 接線的問題)
  • MXIC 25L80 (小 K mini)只可工作于 DOUT



6 Flash Memory Map

Map the flash
?
1 2 3 4 5 /* ?* Memory map first 8Mbit of flash ?* address space is: 0x4020 0000 - 0x402F FFFF ?*/ Cache_Read_Enable (0, 0, 0);


Unmap the flash
?
1 Cache_Read_Disable();



6.1 Cache_Read_Enable

void Cache_Read_Enable(uint8 odd_even, uint8 mb_count, unt8 no_idea);

Valid values for odd_even:

0 – clears bits 24 & 25 of control register 0x3FF0000C1 – clears bit 24, sets bit 25

other – clears bit 25, sets bit 24


Function of odd_even:

0 – allows access to even numbered mb1 – allow access to odd numbered mb

other – appears to do the same as 1, there must be a difference but I haven’t worked out what it it


Valid values for mb_count:

0-7 – set bits 16, 17 & 18 of control register 0x3FF0000C


Function of mb_count:

Which odd or even bank to map (according to odd_even option)

e.g. mb_count = 0, odd_even = 0 -> map first 8Mbit of flashe.g. mb_count = 0, odd_even = 1 -> map second 8Mbit of flashe.g. mb_count = 1, odd_even = 0 -> map third 8Mbit of flashe.g. mb_count = 1, odd_even = 1 -> map fourth 8Mbit of flash

Valid values for no_idea:

0 – sets bit 3 of 0x3FF000241 – sets bit 26 of 0x3FF0000C and sets bits 3 & 4 of 0x3FF00024


Function of no_idea:

The clue is in the name, I can’t work out what this does from my experiments, but the SDK always sets this to 1.


  • Reverse engineered by Richard Burton:?http://richard.burtons.org/2015/06/12/esp8266-cache_read_enable/



7 Reference

  • https://www.winbond.com/hq/product/code-storage-flash-memory/serial-nor-flash/?__locale=en&density=8Mbit(1MB)#density

總結

以上是生活随笔為你收集整理的ESP8266 Flash的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。