How to compress esp32 bin files before flashing it through other chip

Rosen_BK
Posts: 1
Joined: Thu Feb 18, 2021 12:10 pm

How to compress esp32 bin files before flashing it through other chip

Postby Rosen_BK » Wed Jun 16, 2021 11:22 am

Hello! Im currently follow the example at https://github.com/espressif/esp-serial-flasher. And if Possible i want to know how to compress my .bins (firmware, bootloader, partition table) before flashing it. I saw log on Eclipse IDE saying that esptool compressed the bin files before flashing them to ESP32.
Im new to esp universe and im not experienced at all in embedded, so detailed explanation would be appreciated.

ESP_Sprite
Posts: 9050
Joined: Thu Nov 26, 2015 4:08 am

Re: How to compress esp32 bin files before flashing it through other chip

Postby ESP_Sprite » Thu Jun 17, 2021 2:21 am

I don't think it's included in that project, but you could try to hack it in. Effectively, the loader flashes chunks of flash using FLASH_BEGIN/FLASH_DATA/FLASH_END commands. To flash compressed data, you take the chunk you want to send, compress it using zlib deflate, then use FLASH_DEFL_BEGIN/FLASH_DEFL_DATA/FLASH_DEFL_END commands to send it. Note that all this only works on ESP32-type chips, the ESP8266 ROM does not have the logic for this (and esp-serial-flasher does not have a stub to add it in.)

Who is online

Users browsing this forum: No registered users and 222 guests