Burning module through flash pins

User avatar
Vader_Mester
Posts: 300
Joined: Tue Dec 05, 2017 8:28 pm
Location: Hungary
Contact:

Burning module through flash pins

Postby Vader_Mester » Thu Feb 04, 2021 10:13 am

Hi All,

It's been a long while since I posted, but I got to a point where it became inevitable.

Anyways, I wanna know, if it's possible to flash an ESP32 module (In this case WROVER) via the exposed flash pins, and flash it directly, instead of through the ESP32.
This is obviously for production purposes to make burning units faster, in burning jigs.

The only thing I'm not sure about is how to power the flash chips inside the module. For a good reason, VDD_SDIO is not exposed on the module pins, so I need the ESP32 itself to supply that power, but the question is how can I do that without the ESP32 interfering with the process, as it needs the ROM bootloader to check the strapping pins or eFuse for the correct SDIO voltage, and power up the flash.

I guess, I can just put it into Download mode, which will for sure give power for the flash, but instead of sending data on UART, I instead burn the flash directly, while the ESP32 sits there waiting?
I read somewhere that there is a timeout in download mode, if I can recall, which I should not exceed outherwise the write is not finished properly.

Also, isn't this also a valid way for someone to read out the flash contents, without breaking into the module itself?

So can this be done, had anyone done it before?

Code: Select all

task_t coffeeTask()
{
	while(atWork){
		if(!xStreamBufferIsEmpty(mug)){
			coffeeDrink(mug);
		} else {
			xTaskCreate(sBrew, "brew", 9000, &mug, 1, NULL);
			xSemaphoreTake(sCoffeeRdy, portMAX_DELAY);
		}
	}
	vTaskDelete(NULL);
}

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

Re: Burning module through flash pins

Postby ESP_Sprite » Thu Feb 04, 2021 10:47 am

I don't think this is possible... as you stated, VDD_SIO is not available when the module is held in reset, and if the module is not held in reset, the flash pins are controlled by the ESP32.

And yes, bad guys can read out your flash if they want to. That is why we have secureboot and flash encryption; that way what they read from flash is useless garbage to them.

(Also note that from a certain MOQ (650 iirc) we can sell you modules pre-flashed with firmware of your choice. Suggest you contact sales@espressif.com for that. Possibly that can solve your production issues.)

User avatar
Vader_Mester
Posts: 300
Joined: Tue Dec 05, 2017 8:28 pm
Location: Hungary
Contact:

Re: Burning module through flash pins

Postby Vader_Mester » Thu Feb 04, 2021 12:06 pm

ESP_Sprite wrote:
Thu Feb 04, 2021 10:47 am
I don't think this is possible... as you stated, VDD_SIO is not available when the module is held in reset, and if the module is not held in reset, the flash pins are controlled by the ESP32.

And yes, bad guys can read out your flash if they want to. That is why we have secureboot and flash encryption; that way what they read from flash is useless garbage to them.

(Also note that from a certain MOQ (650 iirc) we can sell you modules pre-flashed with firmware of your choice. Suggest you contact sales@espressif.com for that. Possibly that can solve your production issues.)
Thanks for the definitive answer!

Code: Select all

task_t coffeeTask()
{
	while(atWork){
		if(!xStreamBufferIsEmpty(mug)){
			coffeeDrink(mug);
		} else {
			xTaskCreate(sBrew, "brew", 9000, &mug, 1, NULL);
			xSemaphoreTake(sCoffeeRdy, portMAX_DELAY);
		}
	}
	vTaskDelete(NULL);
}

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 87 guests