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

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

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

Postby kolban » Tue May 01, 2018 5:46 pm

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.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

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

Postby snahmad75 » Wed May 02, 2018 11:57 am

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?

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

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

Postby ESP_igrr » Wed May 02, 2018 1:47 pm

Factory partition is still 1M, and that's where the application is being flashed when you run "make flash".

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

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

Postby snahmad75 » Wed May 02, 2018 3:46 pm

Are you saying Factory partition , OTA0 and OTA1 needs to be same size?

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

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

Postby fly135 » Wed May 02, 2018 5:28 pm

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

jens.alfke
Posts: 17
Joined: Wed May 02, 2018 4:26 pm

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

Postby jens.alfke » Wed May 02, 2018 6:51 pm

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.

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

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

Postby kolban » Sat May 05, 2018 4:47 am

Please excuse my ignorance ... but what is LTO?
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

User avatar
martinayotte
Posts: 141
Joined: Fri Nov 13, 2015 4:27 pm

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

Postby martinayotte » Mon May 07, 2018 12:38 pm

kolban wrote:Please excuse my ignorance ... but what is LTO?
I presume it is "Link Time Optimisation" ...

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

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

Postby ESP_Angus » Tue May 08, 2018 3:18 am

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.

locustcox
Posts: 20
Joined: Tue Sep 04, 2018 9:36 pm

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

Postby locustcox » Sat Feb 16, 2019 3:46 pm

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.

Who is online

Users browsing this forum: No registered users and 119 guests