maximkulkin / esp-homekit-demo

Demo of Apple HomeKit accessory server library
MIT License
809 stars 233 forks source link

Combine rboot.bin blank_config.bin and firmware.bin to a single full binary #277

Closed mgoeller closed 4 years ago

mgoeller commented 4 years ago

I would like to use Tuya Convert (link) to flash a Tuya module based ESP8266 device without soldering / opening it.

The requirements for upload a third party firmware state:

Binary requirements:

  • full binary including first-stage bootloader
  • maximum filesize 512KB for first flash

How can I combine the rboot, blank_config and my compiled esp-homekit.bin file to a single binary? And what is the blank_config.bin used for in general?

Thanks!

maximkulkin commented 4 years ago

Here is Make target I use to do that:

$(FIRMWARE_DIR)firmware_full.bin: $(FIRMWARE_DIR)firmware.bin
    cp $(RBOOT_BIN) $(BUILD_DIR)rboot.bin
    truncate -s 4096 $(BUILD_DIR)rboot.bin

    cp $(RBOOT_CONF) $(BUILD_DIR)rboot_config.bin
    truncate -s 4096 $(BUILD_DIR)rboot_config.bin

    cat $(BUILD_DIR)rboot.bin $(BUILD_DIR)rboot_config.bin $< > $@

    rm $(BUILD_DIR)rboot.bin $(BUILD_DIR)rboot_config.bin
mgoeller commented 4 years ago

Thank you!