marcmerlin / AnimatedGIFs

Animated GIFs on Teensy, ESP8266, ESP32 on top of FastLED::NeoMatrix, SmartMatrix::GFX, and SmartMatrix, using Sdcard, SPIFFS, and FatFS (FFAT)
MIT License
68 stars 12 forks source link

ESP32FFat Failed #7

Closed harissutanrafiq closed 4 years ago

harissutanrafiq commented 4 years ago

i try upload image but failed

first in the arduino IDE iam choose ESP32 Dev module board with partition schemee No OTA 1MB APP/ 3MG FFATS

this is output of ffats.ino rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:1 load:0x3fff0018,len:4 load:0x3fff001c,len:1216 ho 0 tail 12 room 4 load:0x40078000,len:9720 ho 0 tail 12 room 4 load:0x40080400,len:6352 entry 0x400806b8 Partition list: partition addr: 0x010000; size: 0x100000; label: app0 partition addr: 0x009000; size: 0x005000; label: nvs partition addr: 0x00e000; size: 0x002000; label: otadata partition addr: 0x110000; size: 0x2f0000; label: ffat

Trying to mount ffat partition if present [E][FFat.cpp:60] begin(): Mounting FFat partition failed! Error: -1 FFat Mount Failed

build a image ./fatfsimage -l5 img.ffat 3008 gifs64/

C:\Users\haris\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\tools>python esptool.py --chip esp32 --port COM3 --baud 921600 write_flash 0x111000 img.ffat esptool.py v2.8-dev Serial port COM3 Connecting........__ Chip is ESP32D0WDQ6 (revision 0) Features: WiFi, BT, Dual Core, Coding Scheme None Crystal is 40MHz MAC: 24:0a:c4:03:6e:28 Uploading stub... Running stub... Stub running... Changing baud rate to 921600 Changed. Configuring flash size... Auto-detected Flash size: 4MB

A fatal error occurred: File img.ffat (length 3080192) at offset 1118208 will not fit in 4194304 bytes of flash. Use --flash-size argument, or change flashing address.

marcmerlin commented 4 years ago

Ok, so to be honest, I can't really support FFAT for you, it's unfortunately not supported natively by the ardruino environment as you know, and while I got it working for me, I can't claim it works for everyone. https://github.com/marcmerlin/esp32_fatfsimage would have been a better place to file this so that I could @lbernstone, the upstream author, which I can't do here.

I can't think of a good reason why it wouldn''t work on windows, but I sure didn't test it there. Let's look at partitions first, my partitions in the arduino env, look close enough to yours:

# Name,   Type, SubType, Offset,  Size, Flags
nvs,      data, nvs,     0x9000,  0x5000,
otadata,  data, ota,     0xe000,  0x2000,
app0,     app,  ota_0,   0x10000, 0x100000,
ffat,     data, fat,     0x110000,0x2F0000,

The important part is that the ffat partition has the corect offset and size between you and me.

Now let's look at the numbers in your error: 1118208+3080192 4198400 4198400-4194304 4096

Ok, the image is exactly 4KB too big. Why does it work for me on linux and not for you on windows? I'd guess there is a subtle bug on either fatfsimage or esptool between linux and windows. The bug could be on linux in a way that image works when it shouldn't or of course windows could be wrong.

If you are inspired, see if you find the problem and file a problem with more details in https://github.com/marcmerlin/esp32_fatfsimage . If you just want to get it working, make your image 3004 instead of 3008 and it should hopefully fit.