Ignore sdkconfig in repo, anymore?

zliudr
Posts: 357
Joined: Thu Oct 03, 2019 5:15 am

Ignore sdkconfig in repo, anymore?

Postby zliudr » Fri Apr 09, 2021 3:13 am

I started using ESP-IDF at version 3.3 so I got into a habit of keeping sdkconfig in the ignored file for my project repo, just like ESP-IDF ignores them in say example folders. It made sense back in V3.x where the COM port number is included and you have to change it if you have multiple machines that don't have the same COM port number for your dev boards and programmers.

So since I'm in V4.3 now, is there any good reason still ignoring sdkconfig for my project repos? If I un-ignore it, should I say delete it in my all other computers except for one so that version gets discovered by git and gets pushed to repo?

User avatar
ESP_krzychb
Posts: 394
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: Ignore sdkconfig in repo, anymore?

Postby ESP_krzychb » Sat Apr 10, 2021 5:38 am

Hi zliudr, sdkconfig is an automatically created compilation of default settings of individual project components and settings entered by user with menuconfig to change the defaults. I would not keep this file unless I need to preserve my specific settings. A better way to preserve the user setting is to place them in sdkconfig.defaults. Then sdkconfig is not required in repo anymore.

zliudr
Posts: 357
Joined: Thu Oct 03, 2019 5:15 am

Re: Ignore sdkconfig in repo, anymore?

Postby zliudr » Sun Apr 11, 2021 6:32 pm

Thanks for the suggestion! So after reading the reference you pointed to, I'm still a little confused. If there is no sdkconfig, the build system uses the sdkconfig.defaults. If there is sdkconfig, the build system ignores sdkconfig.defaults. What happens if say I have defaults with all necessary values and then on one machine but then I decide to change the setting, say cpu revision from 0 to 1? This won't change the corresponding value in defaults but only the one in sdkconfig. So should I manually edit the defaults, save it (or just copy sdkconfig to sdkconfig.defaults), and then on a different machine, always delete sdkconfig before building so I always get the latest defaults from git pull? I'm just trying to properly use the facilities.

User avatar
ESP_krzychb
Posts: 394
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: Ignore sdkconfig in repo, anymore?

Postby ESP_krzychb » Mon Apr 12, 2021 8:04 am

Yes, on puling the updates delete sdkconfig, so a new one is created to contain the latest defaults. As for creating sdkconfig.defaults, I put into this file only specific configuration changes I need. For example, see https://github.com/espressif/esp-idf/bl ... g.defaults.

zliudr
Posts: 357
Joined: Thu Oct 03, 2019 5:15 am

Re: Ignore sdkconfig in repo, anymore?

Postby zliudr » Mon Apr 12, 2021 10:49 pm

Thanks! So if I enable SPI RAM for instance, should I copy the whole thing to defaults then, because by default SPI RAM is not enabled? I wish there's a tool to spit out a diff between all default values and the current sdkconfig so I can save that as defaults like you did.

chegewara
Posts: 2207
Joined: Wed Jun 14, 2017 9:00 pm

Re: Ignore sdkconfig in repo, anymore?

Postby chegewara » Mon Apr 12, 2021 10:55 pm

zliudr wrote:
Mon Apr 12, 2021 10:49 pm
I wish there's a tool to spit out a diff between
https://www.diffchecker.com/

Who is online

Users browsing this forum: Bing [Bot], Slinisa and 111 guests