(resolved) OTA and the otadata partition
Re: OTA and the otadata partition
OK, thanks. So if I wanted to give the user a (short) menu of partition options, how do I tell which have been programmed? Is there an ESP facility for this, or do I just make something up myself (like a string in the image that my utility searches for)?
PS: the OTA is actually working...I'm impressed.
PS: the OTA is actually working...I'm impressed.
Re: OTA and the otadata partition
Every partition have label, you can store in NVS which partition has been OTA updated lately. In addition factory partition and you have menu.
Re: OTA and the otadata partition
A label doesn't tell me whether that partition has been programmed with a valid image. Is there a way to take a closer look?
I want to provide my user with a menu of the *programmed* partitions. No point in offering him an invalid choice.
I want to provide my user with a menu of the *programmed* partitions. No point in offering him an invalid choice.
Re: OTA and the otadata partition
It surely does tell you that. When you do OTA you know what partition you are flashing and for sure you know that OTA has been succeeded or not. So when you know that you OTA flash ends with success you can retrieve label from that partition and store it in NVS. But of course its only theory.
Re: OTA and the otadata partition
Hi Chegewara - I don't think we're talking about the same thing. Here's my scenario: I create the following partitions:
nvs,data,nvs,0x9000,16K,
otadata,data,ota,0xd000,8K,
phy_init,data,phy,0xf000,4K,
factory,app,factory,0x10000,1M,
ota_0,app,ota_0,0x110000,1M,
ota_1,app,ota_1,0x210000,1M,
As you can see, I have three app partitions. At this time, all have labels, but none are necessarily flashed with anything. I could write all 0s to any of those partitions and it would still have its label.
I'm hoping for a way to quickly examine each app partition to see whether it has been validly programmed or not. Like looking for an identifier at some known offset or something. But I don't know of a way to do that.
nvs,data,nvs,0x9000,16K,
otadata,data,ota,0xd000,8K,
phy_init,data,phy,0xf000,4K,
factory,app,factory,0x10000,1M,
ota_0,app,ota_0,0x110000,1M,
ota_1,app,ota_1,0x210000,1M,
As you can see, I have three app partitions. At this time, all have labels, but none are necessarily flashed with anything. I could write all 0s to any of those partitions and it would still have its label.
I'm hoping for a way to quickly examine each app partition to see whether it has been validly programmed or not. Like looking for an identifier at some known offset or something. But I don't know of a way to do that.
Re: OTA and the otadata partition
If your factory partition has nothing and previous OTAs have not been done then you don't have anything. So if your app is running you know that the factory has been programmed. Not sure why you need to know about OTAs because when you perform an OTA that is handled in the code. WRT NVS, just read a parameter that you expect to be there and if it isn't then it hasn't been programmed.
John A
John A
Re: OTA and the otadata partition
I hear what you're saying, but I see value in giving the user the option of selecting between various programs. Something like this:
Only with more meaningful names. As my company begins using the ESP32 for more of our product lines, I envision us programming multiple images at mfg. time. (Maybe I'm overthinking this.)
But this is no big deal. Currently I'm much more interested in serialization; I'll probably start a new thread on that this afternoon.
Only with more meaningful names. As my company begins using the ESP32 for more of our product lines, I envision us programming multiple images at mfg. time. (Maybe I'm overthinking this.)
But this is no big deal. Currently I'm much more interested in serialization; I'll probably start a new thread on that this afternoon.
Re: OTA and the otadata partition
Maybe we are just slightly on different tracks. I thinking just like John, when you have esp32 running then you have factory app flashed (lets say in manufacturing process). Now each time you perform OTA update you know exactly which ota partition you are updating, when process is done, you know that updating is successful or not. When it is successful then read label of that partition and store in NVS that partition is flashed with application and can be performed start from that partition. You can track this with bit flags, one bit for each partition and/or with partition labels. Many possibilities.mzimmers wrote:Hi Chegewara - I don't think we're talking about the same thing. Here's my scenario: I create the following partitions:
nvs,data,nvs,0x9000,16K,
otadata,data,ota,0xd000,8K,
phy_init,data,phy,0xf000,4K,
factory,app,factory,0x10000,1M,
ota_0,app,ota_0,0x110000,1M,
ota_1,app,ota_1,0x210000,1M,
As you can see, I have three app partitions. At this time, all have labels, but none are necessarily flashed with anything. I could write all 0s to any of those partitions and it would still have its label.
I'm hoping for a way to quickly examine each app partition to see whether it has been validly programmed or not. Like looking for an identifier at some known offset or something. But I don't know of a way to do that.
Re: OTA and the otadata partition
How did you get 2M of space for your app partitions? I tried that and got an error:fly135 wrote: How about OTADATA?
Code: Select all
# Name, Type, SubType, Offset, Size, Flags # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild nvs, data, nvs, 0x9000, 0x4000 otadata, data, ota, 0xd000, 0x2000 phy_init, data, phy, 0xf000, 0x1000, factory, app, factory, 0x10000, 2M, storage, data, spiffs, , 0xF0000, ota_0, 0, ota_0, 0x400000, 2M, ota_1, 0, ota_1, 0x600000, 2M,
Code: Select all
I (10) boot: ESP-IDF v3.1.1-rc2-2-gd1d2ce8c2-dirty 2nd stage bootloader
I (11) boot: compile time 11:35:13
I (39) boot: Enabling RNG early entropy source...
I (39) boot: SPI Speed : 40MHz
I (39) boot: SPI Mode : DIO
I (41) boot: SPI Flash Size : 4MB
E (45) flash_parts: partition 4 invalid - offset 0x210000 size 0x200000 exceeds flash chip size 0x400000
E (55) boot: Failed to verify partition table
E (60) boot: load partition table error!
user code done
Re: OTA and the otadata partition
I have a 16MB flash on my board. So I've still got 8MB unused.
Who is online
Users browsing this forum: No registered users and 85 guests