Page 1 of 1

ESP SERIAL FLASHER SPI COMMAND

Posted: Thu Jun 22, 2023 3:04 pm
by pepopi
Hello,
I have a doubt, in the ESP serial flasher protocol.h do the commands have a reason for having those precise values? If so, where can I consult that in the technical reference manual? And if not why does it skip certain values?
typedef enum __attribute__((packed))
{
FLASH_BEGIN = 0x02,
FLASH_DATA = 0x03,
FLASH_END = 0x04,
MEM_BEGIN = 0x05,
MEM_END = 0x06,
MEM_DATA = 0x07,
SYNC = 0x08,
WRITE_REG = 0x09,
READ_REG = 0x0a,

SPI_SET_PARAMS = 0x0b,
SPI_ATTACH = 0x0d,
CHANGE_BAUDRATE = 0x0f,
FLASH_DEFL_BEGIN = 0x10,
FLASH_DEFL_DATA = 0x11,
FLASH_DEFL_END = 0x12,
SPI_FLASH_MD5 = 0x13,
} command_t;
Thank you

Re: ESP SERIAL FLASHER SPI COMMAND

Posted: Fri Jun 23, 2023 2:10 am
by ESP_Sprite
They're communication parameters with the ROM baked into the ESP chips; the ROM checks for those numbers and does the thing that goes with it. Skipped numbers probably used to be there at some time but were removed without shifting the other numbers up. I don't think it's documented in any hardware docs, as ROM-defined behaviour kinda-sortta is seen as software.

Re: ESP SERIAL FLASHER SPI COMMAND

Posted: Sat Jun 24, 2023 11:01 am
by pepopi
Thank you, I have another question I'm looking up the SPI register in the technical reference manual and I can't find the flash ID register. Do you know where is it?