Page 3 of 3

Re: Best way to store large objects on flash?

Posted: Sat Dec 15, 2018 12:13 pm
by burkulesomesh43
Yes, they effectively count as 'code size'.
but i dont want to increase code size. I am using ota also. so my code size could not go above 1Mb.
here is my partition table->>

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, 1M,
storage,  data, fat,     ,  0x19000,
ota_0,0, ota_0,     0x200000, 1M,
ota_1,0, ota_1,     0x300000, 1M,
now my code size is about to 899kB and I want to store upto 350Kb of files in flash.
so it cannot be possible in my case if i will use Component embed files.
now what can i do?

Re: Best way to store large objects on flash?

Posted: Sun Dec 16, 2018 6:36 am
by Sprite
Edit your partition table so the factory and OTA partitions can fit your new binary, I'd say. If you don't have the room to store these things three-fold, you probably want to figure out some other way to store them (in the spiffs, or perhaps raw on a separate partition)

Re: Best way to store large objects on flash?

Posted: Sun Dec 16, 2018 7:10 am
by burkulesomesh43
Edit your partition table so the factory and OTA partitions can fit your new binary, I'd say. If you don't have the room to store these things three-fold, you probably want to figure out some other way to store them (in the spiffs, or perhaps raw on a separate partition)
yes, I can store it in spiff or fatfs but I want to access this files for webserver.
and I dont know how to use that files for webserver.
for example in "netconn_write();" api. this api only access to pointers or arrays not files.
thats why I used component embed files.

Re: Best way to store large objects on flash?

Posted: Mon Dec 17, 2018 4:30 am
by Sprite
Well, if you store the data in a raw partition, one of the options is to mmap it to a pointer with esp_partition_mmap . This does imply that you either need a partition per file, or need to implement some manual logic where you concatenate all files into one partition and then somehow figure out what the offset of each file is.