Page 2 of 3

Re: [Answered] How to build a subset of the possible components in ESP-IDF?

Posted: Tue May 01, 2018 5:46 pm
by kolban
To work in this space, I recommend you read the Partition Tables documentation found here:

http://esp-idf.readthedocs.io/en/latest ... ables.html

Have a good read at that and let it sink in for a bit.

While an ESP32 flash memory is typically 4MB, you will find that some portion is reserved for ESP32 usage for areas like NVS and bootloader. I also hear stories that the 4MByte of flash is only the common story ... but we can go as high as 16MByte (from memory) in flash.

Re: [Answered] How to build a subset of the possible components in ESP-IDF?

Posted: Wed May 02, 2018 11:57 am
by snahmad75
Hi,

I tried out my custom partition.

# Name, Type, SubType, Offset, Size
nvs, data, nvs, 0x9000, 0x4000
otadata, data, ota, 0xd000, 0x2000
phy_init, data, phy, 0xf000, 0x1000
factory, app, factory, 0x10000, 1M
ota_0, app, ota_0,0x110000 , 0x140000
ota_1, app, ota_1,0x250000 , 0x140000


because my main application is more than 1MB.

Still total size is within 4MB Flash.

No luck. my application does not start.


Any idea?

Re: [Answered] How to build a subset of the possible components in ESP-IDF?

Posted: Wed May 02, 2018 1:47 pm
by ESP_igrr
Factory partition is still 1M, and that's where the application is being flashed when you run "make flash".

Re: [Answered] How to build a subset of the possible components in ESP-IDF?

Posted: Wed May 02, 2018 3:46 pm
by snahmad75
Are you saying Factory partition , OTA0 and OTA1 needs to be same size?

Re: [Answered] How to build a subset of the possible components in ESP-IDF?

Posted: Wed May 02, 2018 5:28 pm
by fly135
snahmad75 wrote:Are you saying Factory partition , OTA0 and OTA1 needs to be same size?
No, he's asking where you are flashing your app because your factory partition is 1M and you claim your app is bigger. A "make flash" will by default burn the factory partition, so your app needs to fit. You say the app won't start, but you provide no log that would give the info needed to even begin to answer why. Is it booting from the factory partition that is too small for your app? Or is it booting from one of the OTA partitions?

Your factory partition can be smaller than your OTA if you only plan to burn an app small enough to fit it in and then OTA a bigger app.

John A

Re: [Answered] How to build a subset of the possible components in ESP-IDF?

Posted: Wed May 02, 2018 6:51 pm
by jens.alfke
Sorry to hijack this thread back to something closer to its original topic ... but has there been any progress with LTO support in the past year? I use (Clang's) LTO in my iOS projects and it helps quite a bit with performance as well as code size.

Re: [Answered] How to build a subset of the possible components in ESP-IDF?

Posted: Sat May 05, 2018 4:47 am
by kolban
Please excuse my ignorance ... but what is LTO?

Re: [Answered] How to build a subset of the possible components in ESP-IDF?

Posted: Mon May 07, 2018 12:38 pm
by martinayotte
kolban wrote:Please excuse my ignorance ... but what is LTO?
I presume it is "Link Time Optimisation" ...

Re: [Answered] How to build a subset of the possible components in ESP-IDF?

Posted: Tue May 08, 2018 3:18 am
by ESP_Angus
No support for LTO yet, unfortunately.

Regarding the original post's question of building with a subset of components, doing this is a lot smoother in the new CMake preview branch. You can supply a minimal list of components you need in your build (as little as one or two) in the COMPONENTS, and the build system will automatically expend prerequisites to produce a working binary.

Re: [Answered] How to build a subset of the possible components in ESP-IDF?

Posted: Sat Feb 16, 2019 3:46 pm
by locustcox
Any chance -flto will ever be implemented? It's not like you all don't have enough on your place, but in our internal projects, we've found up to a 40% reduction in binary size when link-time optimizations are added.