Page 1 of 1

Error for component registration javascript files.

Posted: Wed Jan 20, 2021 2:05 pm
by Thanyasit
I am trying to component registration "Plotly JavaScript Open Source Graphing Library"
file name = plotly_latest_min.js

but it's not working
There is an error shown
A fatal error occurred: File simple.bin (length 4197680) at offset 65536 will not fit in 2097152 bytes of flash. Use --flash-size argument, or change flashing address.
esptool.py failed with exit code 2

Code: Select all

    extern const unsigned char plotly_latest_min_js_start[] asm("_binary_plotly_latest_min_js_start");
    extern const unsigned char plotly_latest_min_js_end[]   asm("_binary_plotly_latest_min_js_end");
    const size_t plotly_latest_min_js_size = (plotly_latest_min_js_end - plotly_latest_min_js_start);
    httpd_resp_send_chunk(req, (const char *)plotly_latest_min_js_start, plotly_latest_min_js_size);
Please guide me.
Thanks you.

Re: Error for component registration javascript files.

Posted: Thu Jan 21, 2021 3:46 am
by ESP_Sprite
Your file is too big. Even disregarding other issues you may run into (wrt partitions, size of your flash memory etc) the memory aperture for flash data is only 4MiB and your file is larger than that. Suggest putting it on a fat or spiffs partition and serving it that way instead.

Re: Error for component registration javascript files.

Posted: Thu Jan 21, 2021 5:37 am
by Thanyasit
ESP_Sprite wrote:
Thu Jan 21, 2021 3:46 am
Your file is too big. Even disregarding other issues you may run into (wrt partitions, size of your flash memory etc) the memory aperture for flash data is only 4MiB and your file is larger than that. Suggest putting it on a fat or spiffs partition and serving it that way instead.
Please advise the IDF docs for me.
Thank you

Re: Error for component registration javascript files.

Posted: Sun Jan 24, 2021 1:32 pm
by Thanyasit
ESP_Sprite wrote:
Thu Jan 21, 2021 3:46 am
Your file is too big. Even disregarding other issues you may run into (wrt partitions, size of your flash memory etc) the memory aperture for flash data is only 4MiB and your file is larger than that. Suggest putting it on a fat or spiffs partition and serving it that way instead.

I increased the flash size to 8MB.
there is an error shown

esptool.py v2.8
Serial port com14
Connecting........_
Detecting chip type... ESP32
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: cc:50:e3:95: de:ac
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Compressed 3072 bytes to 103...
Wrote 3072 bytes (103 compressed) at 0x00008000 in 0.0 seconds (effective 1723.1 kbit/s)...
Hash of data verified.
Compressed 25360 bytes to 14967...
Wrote 25360 bytes (14967 compressed) at 0x00001000 in 0.3 seconds (effective 592.2 kbit/s)...
Hash of data verified.
Compressed 4197664 bytes to 1482328...
Wrote 4197664 bytes (1482328 compressed) at 0x00010000 in 37.2 seconds (effective 901.5 kbit/s)...
File md5: 25e572ea22e5ff0ef89217471e4c86c6
Flash md5: 517e074670384901a70242c32d89848c
MD5 of 0xFF is 6b609ca27098ec8ff3756d9f79173380

A fatal error occurred: MD5 of file does not match data in flash!
esptool.py failed with exit code 2

Please guide me.
Thanks you.

Re: Error for component registration javascript files.

Posted: Mon Jan 25, 2021 1:46 am
by ESP_Sprite
Yes, as I said, your approach is not going to work. Put the file on a FatFS or SPIFFS or something instead and proceed like that.

Re: Error for component registration javascript files.

Posted: Mon Feb 01, 2021 4:14 am
by Thanyasit
ESP_Sprite wrote:
Mon Jan 25, 2021 1:46 am
Yes, as I said, your approach is not going to work. Put the file on a FatFS or SPIFFS or something instead and proceed like that.

I use spiffsgen
there is an error shown
Leaving...
Hard resetting via RTS pin...
Done

C:\Users\Mr.Emag\Desktop\esp-idf\examples\work\softAPWeb>idf.py monitor
Checking Python dependencies...
Python requirements from C:\Users\Mr.Emag\Desktop\esp-idf\requirements.txt are satisfied.
Executing action: monitor
Choosing default port b'COM14' (use '-p PORT' option to set a specific serial port)
Running idf_monitor in directory c:\users\mr.emag\desktop\esp-idf\examples\work\softapweb
Executing "C:\Users\Mr.Emag\.espressif\python_env\idf4.0_py3.9_env\Scripts\python.exe C:\Users\Mr.Emag\Desktop\esp-idf\tools/idf_monitor.py -p COM14 -b 115200 c:\users\mr.emag\desktop\esp-idf\examples\work\softapweb\build\softAPWeb.elf -m 'C:\Users\Mr.Emag\.espressif\python_env\idf4.0_py3.9_env\Scripts\python.exe' 'C:\Users\Mr.Emag\Desktop\esp-idf\tools\idf.py'"...
--- idf_monitor on COM14 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57
Please guide me.
Thanks you.

Re: Error for component registration javascript files.

Posted: Mon Feb 01, 2021 11:15 am
by Thanyasit
Thanyasit wrote:
Mon Feb 01, 2021 4:14 am
ESP_Sprite wrote:
Mon Jan 25, 2021 1:46 am
Yes, as I said, your approach is not going to work. Put the file on a FatFS or SPIFFS or something instead and proceed like that.

I use spiffsgen
there is an error shown
Leaving...
Hard resetting via RTS pin...
Done

C:\Users\Mr.Emag\Desktop\esp-idf\examples\work\softAPWeb>idf.py monitor
Checking Python dependencies...
Python requirements from C:\Users\Mr.Emag\Desktop\esp-idf\requirements.txt are satisfied.
Executing action: monitor
Choosing default port b'COM14' (use '-p PORT' option to set a specific serial port)
Running idf_monitor in directory c:\users\mr.emag\desktop\esp-idf\examples\work\softapweb
Executing "C:\Users\Mr.Emag\.espressif\python_env\idf4.0_py3.9_env\Scripts\python.exe C:\Users\Mr.Emag\Desktop\esp-idf\tools/idf_monitor.py -p COM14 -b 115200 c:\users\mr.emag\desktop\esp-idf\examples\work\softapweb\build\softAPWeb.elf -m 'C:\Users\Mr.Emag\.espressif\python_env\idf4.0_py3.9_env\Scripts\python.exe' 'C:\Users\Mr.Emag\Desktop\esp-idf\tools\idf.py'"...
--- idf_monitor on COM14 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57
Please guide me.
Thanks you.


I use Flash size 8MB

partitions_example
ggg.PNG
ggg.PNG (6.64 KiB) Viewed 4827 times

there is an error shown
E (526) spi_flash: Detected size(4096k) smaller than the size in the binary image header(8192k). Probe failed.

Please guide me.
Thanks you.

Re: Error for component registration javascript files.

Posted: Tue Feb 02, 2021 1:34 am
by ESP_Sprite
Well, the base problem (aside from all other problems that are overcome'able) is that you're trying to push a 4MiB file, plus your actual firmware, for a total of 4.5MiB or so, into a 4MiB flash chip (as detected by esp-idf). That ain't gonna fit.