OTA on ESP32-WROVER Module

llewellyn
Posts: 33
Joined: Fri May 05, 2017 8:22 am

OTA on ESP32-WROVER Module

Postby llewellyn » Sun Aug 06, 2017 2:10 pm

While performing an OTA update on ESP32-WROVER module does the data for OTA need to be in internal RAM?

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

Re: OTA on ESP32-WROVER Module

Postby ESP_Sprite » Sun Aug 06, 2017 8:49 pm

Not entirely; you can 'stream' an OTA. (Essentially read a few K, write a few K to flash, read a few K, etc.)

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: OTA on ESP32-WROVER Module

Postby WiFive » Sun Aug 06, 2017 10:28 pm

But the buffer needs to be in internal ram since cache will be disabled during flash write, right?

llewellyn
Posts: 33
Joined: Fri May 05, 2017 8:22 am

Re: OTA on ESP32-WROVER Module

Postby llewellyn » Mon Aug 07, 2017 8:41 am

WiFive wrote:But the buffer needs to be in internal ram since cache will be disabled during flash write, right?
That's what I wanted to know . since the cache is disabled I need to have the buffer for OTA data to be on the internal ram.
How do allocate the buffer to internal RAM?

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: OTA on ESP32-WROVER Module

Postby kolban » Fri Aug 11, 2017 11:34 pm

Howdy @llewellyn,
My understanding is that you can force a memory allocation into ESP32 internal RAM using:

void* heap_caps_malloc(size_t size, uint32_t caps)

for example:

Code: Select all

uint8_t* pMyRam = heap_caps_malloc(4*1024, MALLOC_CAP_DMA);
You can release the storage with either free() or heap_caps_free().
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

f.h-f.s.
Posts: 215
Joined: Thu Dec 08, 2016 2:53 pm

Re: OTA on ESP32-WROVER Module

Postby f.h-f.s. » Sat Aug 12, 2017 7:14 am

or like the ota example:

Code: Select all

/*an ota data write buffer ready to write to the flash*/
static unsigned char ota_write_data[BUFFSIZE + 1] = {0};
/*an packet receive buffer*/
static unsigned char text[BUFFSIZE + 1] = {0};
As a array in global.

Who is online

Users browsing this forum: ElectricThanhTung and 112 guests