hardware/espressif/esp32/tools/esptool.py
def _update_image_flash_params(esp, address, flash_params, image):
    """ Modify the flash mode & size bytes if this looks like an executable image """
    if address == esp.FLASH_HEADER_OFFSET and (image[0] == '\xe9' or image[0] == 0xE9):  # python 2/3 compat:
        print('Flash params set to 0x%04x' % struct.unpack(">H", flash_params))
        image = image[0:2] + flash_params + image[4:]
    return image
 Modify the flash mode & size bytes if this looks like an executable image 
Modify the flash mode & size bytes if this looks like an executable image
Modify the flash mode & size bytes if this looks like an executable image
def _update_image_flash_params(esp, address, flash_params, image):
    if address == esp.FLASH_HEADER_OFFSET and (image[0] == '\xe9' or image[0] == 0xE9):  
        print('Flash params set to 0x%04x' % struct.unpack(">H", flash_params))
        image = image[0:2] + flash_params + image[4:]
    return image
def _update_image_flash_params ( esp , address , flash_params , image ) : if address == esp . FLASH_HEADER_OFFSET and ( image [ 0 ] == '\xe9' or image [ 0 ] == 0xE9 ) : print ( 'Flash params set to 0x%04x' % struct . unpack ( ">H" , flash_params ) ) image = image [ 0 : 2 ] + flash_params + image [ 4 : ] return image
Modify the flash mode & size bytes if this looks like an executable image
Modify the flash mode & size bytes if this looks like an executable image
""" Modify the flash mode & size bytes if this looks like an executable image """ # python 2/3 compat:
esp
address
flash_params
image