Chat freely about anything...

User avatar
By lilzz
#48375 I read about the Esptool.py code and it uses serial port to send command (AT Commands) to the device.
If the AT Command is program the flash memory then it uses the SDK function of SPI_Flash_write function.
therefore, the Flash itself need to have
1)AT command firmwares
2)SDK functions to support the AT commands.

But a blank SPI flash doesn't have those, and then Esptool.py wouldn't work.

Is this correct?
User avatar
By eduperez
#48379 esptool.py (https://github.com/themadinventor/espto ... esptool.py) does not talk to the firmware (and does not use AT commands), but the bootloader: when you boot the ESP into "upload mode", it is the bootloader who listens to the serial connection and flashes the firmware; the interpreter for the AT commands is stored in the firmware, and gets wiped out each time you upload a new firmware.
User avatar
By lilzz
#48435
eduperez wrote:esptool.py (https://github.com/themadinventor/espto ... esptool.py) does not talk to the firmware (and does not use AT commands), but the bootloader: when you boot the ESP into "upload mode", it is the bootloader who listens to the serial connection and flashes the firmware; the interpreter for the AT commands is stored in the firmware, and gets wiped out each time you upload a new firmware.


Here's snippet of esptool.py
Code: Select all""" Send a request and read the response """
    def command(self, op=None, data=None, chk=0):
        if op is not None:
            pkt = struct.pack('<BBHI', 0x00, op, len(data), chk) + data
            self.write(pkt)


esptool.py uses a serial port to write packet out to esp device based on the command op .

So, it got to have something on the esp device side to interprete what's esptool.py wanting to do. right?
So, if not the AT firmware interpreter then what is?

The function to program flash is SDK function SPI_flash_write.

My point is the flash itself cannot be empty, it got to have interpreter to figure what esptool.py wants to do. and it got to have SDK lib in flash to provide SPI_flash_write function to actually program the flash.

So, I am saying it cannot have esptool.py to program a blank flash device.