Best way to store large objects on flash?

burkulesomesh43
Posts: 132
Joined: Tue Aug 14, 2018 6:21 am
Location: India

Re: Best way to store large objects on flash?

Postby burkulesomesh43 » Sat Dec 15, 2018 12:13 pm

ESP_Sprite wrote:
Sat Dec 15, 2018 12:05 pm
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?
--
Somesh Burkule

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

Re: Best way to store large objects on flash?

Postby ESP_Sprite » Sun Dec 16, 2018 6:36 am

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)

burkulesomesh43
Posts: 132
Joined: Tue Aug 14, 2018 6:21 am
Location: India

Re: Best way to store large objects on flash?

Postby burkulesomesh43 » Sun Dec 16, 2018 7:10 am

ESP_Sprite wrote:
Sun Dec 16, 2018 6:36 am
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.
--
Somesh Burkule

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

Re: Best way to store large objects on flash?

Postby ESP_Sprite » Mon Dec 17, 2018 4:30 am

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.

Who is online

Users browsing this forum: selec1 and 127 guests