Need help to overrite one of file from component into ESP32

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Need help to overrite one of file from component into ESP32

Postby Ritesh » Fri Apr 19, 2019 1:37 pm

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?
Regards,
Ritesh Prajapati

ESP_michael
Posts: 37
Joined: Mon Aug 28, 2017 10:25 am

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

Postby ESP_michael » 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

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

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

Postby Ritesh » Fri Apr 19, 2019 5:28 pm

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.
Regards,
Ritesh Prajapati

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

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

Postby ESP_Sprite » 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.

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

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

Postby Ritesh » 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.
Regards,
Ritesh Prajapati

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

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

Postby WiFive » 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.

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

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

Postby Ritesh » Sat Apr 20, 2019 5:15 am

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.
Regards,
Ritesh Prajapati

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

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

Postby WiFive » 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.

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

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

Postby Ritesh » Sat Apr 20, 2019 8:18 am

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.
Regards,
Ritesh Prajapati

ESP_michael
Posts: 37
Joined: Mon Aug 28, 2017 10:25 am

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

Postby ESP_michael » Mon Apr 22, 2019 5:23 am

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.

Who is online

Users browsing this forum: Google [Bot] and 133 guests