Hi all -
Our first product based on the ESP32 is nearing an end. Unfortunately, so is the amount of available flash memory. My program has grown to over 1MB, and as such, I don't have room to keep copies in factory, ota_0 and ota_1. In fact, when I add syslog functionality, I'll probably have to eliminate one of these.
I've been reading the docs on the bootloader and OTA, and I get the gist of how this works, but I have some questions:
1. do I absolutely need a factory app? Could I just flash my app to one of the OTA partitions instead? If so, how do I inform the bootloader which partition to use?
2. If I do need a factory app, can I make it a very small one that essentially just jumps to one of the OTA partitions? If so, where do I get the information that tells me which one to use?
I'm hoping that perhaps someone else has run into this problem, and has already addressed it. But I welcome any ideas on how best to take care of this.
Currently using V3.3, but could easily migrate if necessary.
Thanks...
(answered) Questions about OTA/bootloader
(answered) Questions about OTA/bootloader
Last edited by mzimmers on Fri Nov 15, 2019 4:03 pm, edited 1 time in total.
Re: Questions about OTA/bootloader
1. No, you don't need factory partition; it's useful in case of bricking device and may have flashed simple app to download and re-flash device app.
You don't need to do any special preparations, bootloader will start from first valid partition.
You don't need to do any special preparations, bootloader will start from first valid partition.
Re: Questions about OTA/bootloader
Hi Chegewara -
Thanks for the reply. I'm not sure I understand your answer about the factory partition -- are you saying that it's possible to install a minimal application in the factory partition that just accepts a flash download to go to one of the OTA partitions?
Thanks for the reply. I'm not sure I understand your answer about the factory partition -- are you saying that it's possible to install a minimal application in the factory partition that just accepts a flash download to go to one of the OTA partitions?
Re: Questions about OTA/bootloader
Yes, that's the idea.
In esp-idf v3.3 or v4.x it's been introduced factory rest with button. Having simple http client on factory partition let you do OTA flash and start your regular app.
In esp-idf v3.3 or v4.x it's been introduced factory rest with button. Having simple http client on factory partition let you do OTA flash and start your regular app.
Re: Questions about OTA/bootloader
OK, so is there a write-up that shows how to code a branch from a factory partition into an OTA partition?
Thanks...
Thanks...
Re: Questions about OTA/bootloader
https://docs.espressif.com/projects/esp ... ables.html
There is the information you are looking for
There is the information you are looking for
Re: (answered) Questions about OTA/bootloader
Hi,mzimmers wrote: ↑Thu Oct 31, 2019 8:15 pmHi all -
Our first product based on the ESP32 is nearing an end. Unfortunately, so is the amount of available flash memory. My program has grown to over 1MB, and as such, I don't have room to keep copies in factory, ota_0 and ota_1. In fact, when I add syslog functionality, I'll probably have to eliminate one of these.
Just curious if you do syslog to a spiffs, fatfs, or raw partition?
Is it stable to do frequently write on the filesystem (or raw partition) on flash?
Thanks,
Axel
Re: (answered) Questions about OTA/bootloader
Hi Alex - in my case, I just used the NVS. My app maintains a circular buffer of 1024 entries of the following format:
The need for a timestamp AND an entry ID is due to the fact that some logs are generated before the system acquires NTP, so I can't use the timestamp for finding the head of the queue.
Code: Select all
typedef int32_t ENTRY_INDEX;
struct LogEntry
{
ENTRY_ID id; // unique number to identify entry.
time_t timestamp; // unix time.
uint8_t msgLength; // 0-255 bytes
char msg[MAX_LOGMSG_LEN]; // null-terminated C string.
};
Who is online
Users browsing this forum: No registered users and 111 guests