Embed binary file in a way that is not loaded into memory

StridingDragon
Posts: 46
Joined: Fri Aug 02, 2019 11:59 pm

Embed binary file in a way that is not loaded into memory

Postby StridingDragon » Sat May 15, 2021 9:58 pm

I would like to embed certain system files in my `firmware.bin` file to make sure the firmware and the files are always in sync. However, I do not want these files to be a part of the program code itself, meaning, I do not want them to be loaded into RAM, using up valuable memory. Instead, I would like to access them from the Flash partition when I need access to them.

I could not find anything in the documentation, so I am wondering if there actually is a way to do this.

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

Re: Embed binary file in a way that is not loaded into memory

Postby WiFive » Sat May 15, 2021 11:47 pm

Most of the program code is not loaded into RAM.
https://docs.espressif.com/projects/esp ... inary-data

StridingDragon
Posts: 46
Joined: Fri Aug 02, 2019 11:59 pm

Re: Embed binary file in a way that is not loaded into memory

Postby StridingDragon » Sun May 16, 2021 1:37 am

Thanks for the link. I saw that before but was not sure if all the code is actually loaded into memory or not.My assumption was that it is, but I'll have to look into it some more, I suppose.

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

Re: Embed binary file in a way that is not loaded into memory

Postby ESP_Angus » Tue May 18, 2021 12:11 am

Files included this way are available in the address space, but they don't use any RAM - they're mapped in DROM.

StridingDragon
Posts: 46
Joined: Fri Aug 02, 2019 11:59 pm

Re: Embed binary file in a way that is not loaded into memory

Postby StridingDragon » Tue May 18, 2021 12:27 am

Yes, I ran some tests the other day and noticed that, which was very good news. Thank you.

Who is online

Users browsing this forum: Bing [Bot] and 137 guests