Page 1 of 2

Need help to overrite one of file from component into ESP32

Posted: Fri Apr 19, 2019 1:37 pm
by Ritesh
Hi

We are using ESP32 IDF as sub module into our existing application and we have one requirement to update existing ESP32 IDF component file.

We know that whole component can be override but our requirement it to override only one from which is spiram_psram.c file as per our requirement.

So, Would you please suggest us like is there any way to do it?

Re: Need help to overrite one of file from component into ESP32

Posted: Fri Apr 19, 2019 3:30 pm
by ESP_michael
Hi, Ritesh

You can locally change one IDF file by:

1. modify the files you want
2. goes into the IDF submodule directory.
3. commit all the changes
4. go back to your own repository
5. commit the submodule update (git add [submodule path]; git commit -m "submodule update: ..."), its actually an one-line change to the submodule

You have to notice that if you want to update the IDF later, you have to fetch the latest IDF master or release tag, and rebase the commits you've just made onto the master/release tag in the IDF submodule, and commit a submodule update in your own repo.

After this, if you think your changes is useful and general to other users, pull requests is welcome. Please see https://help.github.com/en/articles/about-pull-requests

Re: Need help to overrite one of file from component into ESP32

Posted: Fri Apr 19, 2019 5:28 pm
by Ritesh
xiaoxufeng wrote:
Fri Apr 19, 2019 3:30 pm
Hi, Ritesh

You can locally change one IDF file by:

1. modify the files you want
2. goes into the IDF submodule directory.
3. commit all the changes
4. go back to your own repository
5. commit the submodule update (git add [submodule path]; git commit -m "submodule update: ..."), its actually an one-line change to the submodule

You have to notice that if you want to update the IDF later, you have to fetch the latest IDF master or release tag, and rebase the commits you've just made onto the master/release tag in the IDF submodule, and commit a submodule update in your own repo.

After this, if you think your changes is useful and general to other users, pull requests is welcome. Please see https://help.github.com/en/articles/about-pull-requests
Hi,

I know those changes which we can do if we have access of IDF. Here, We are directly downloading ESP32 IDF from Internet and storing it as submodule into our project.

So, We can not directly change into submodule as it will create dirty change after that.

That is why I want steps or procedure to override that file into my component.

Hope now you will clear my requirement for same.

Re: Need help to overrite one of file from component into ESP32

Posted: Sat Apr 20, 2019 12:46 am
by ESP_Sprite
Sorry, we don't really have a way to override just one file... overrides happen on component levels only.

Re: Need help to overrite one of file from component into ESP32

Posted: Sat Apr 20, 2019 4:03 am
by Ritesh
ESP_Sprite wrote:
Sat Apr 20, 2019 12:46 am
Sorry, we don't really have a way to override just one file... overrides happen on component levels only.
Thanks for your quick response regarding same.

Do you have any suggestion or solution to override single file because we need to include that support into existing SDK. Also, It is little bit risky to override whole component in which there are almost core libraries and other source files are present.

Just check from your end if possible otherwise I need to find any alternative solution for same.

Re: Need help to overrite one of file from component into ESP32

Posted: Sat Apr 20, 2019 5:09 am
by WiFive
As part of your build script, reset the esp-idf submodule and then apply your patch to the file. If the patch fails, abort the build.

Re: Need help to overrite one of file from component into ESP32

Posted: Sat Apr 20, 2019 5:15 am
by Ritesh
WiFive wrote:
Sat Apr 20, 2019 5:09 am
As part of your build script, reset the esp-idf submodule and then apply your patch to the file. If the patch fails, abort the build.
Sorry. I didn't get your point for same.

Would you please clarify steps into details? Let me give my steps which we are following into our case.

1) We have our own SDK in which we are using ESP32 IDF as submodule
2) We are not doing any changes into ESP32 IDF but just using that IDF into our SDK

So, If we change anything into ESP32 IDF then it will show dirty changes into ESP32 IDF as we have adopted it as submodule directly from external IDF Link.

How I can reset ESP32 IDF submodule and Apply patch for same? I just want to clarify that we just need to update only one file into spiram_psram.c file as per our requirement.

Let me know if need any more details regarding same.

Re: Need help to overrite one of file from component into ESP32

Posted: Sat Apr 20, 2019 5:29 am
by WiFive
How I can reset ESP32 IDF submodule

Using git commands
and Apply patch for same?
Using patch command
So, If we change anything into ESP32 IDF then it will show dirty changes
If you really want it to show clean then you should maintain your own fork of esp-idf.

Re: Need help to overrite one of file from component into ESP32

Posted: Sat Apr 20, 2019 8:18 am
by Ritesh
WiFive wrote:
Sat Apr 20, 2019 5:29 am
How I can reset ESP32 IDF submodule

Using git commands
and Apply patch for same?
Using patch command
So, If we change anything into ESP32 IDF then it will show dirty changes
If you really want it to show clean then you should maintain your own fork of esp-idf.
Hi,

Yes. That is the last option to clone our own fork but we need to think for that as we are also providing our SDK to outside to develop their application.

Re: Need help to overrite one of file from component into ESP32

Posted: Mon Apr 22, 2019 5:23 am
by ESP_michael
Each component is treated as an individual part when maintaining the component. Back compatible are only ensured at the component level.

I'm afraid that overriding a single file may make you more risky when you update the IDF.
Ritesh wrote:
Sat Apr 20, 2019 4:03 am
ESP_Sprite wrote:
Sat Apr 20, 2019 12:46 am
Sorry, we don't really have a way to override just one file... overrides happen on component levels only.
Thanks for your quick response regarding same.

Do you have any suggestion or solution to override single file because we need to include that support into existing SDK. Also, It is little bit risky to override whole component in which there are almost core libraries and other source files are present.

Just check from your end if possible otherwise I need to find any alternative solution for same.