Unique build id for esp32

tkvjkl
Posts: 3
Joined: Fri Dec 23, 2022 1:27 am

Unique build id for esp32

Postby tkvjkl » Fri Dec 23, 2022 1:35 am

Hello I am trying to add a GNU build id to esp32. I added the option to the cmakelist and to .ld.in file I see the id in the els file but not the bin file. Is there a way to add the build id so that it shows up in the bin.

Code: Select all

set (CMAKE_EXE_LINKER_FLAGS "-Wl,--build-id=sha1")
in the cmakelists

Code: Select all

 .gnu_build_id :
  {
    _gnu_build_id_start = ABSOLUTE(.);
    . = ALIGN(8);
    *(.note.gnu.build-id)
    _gnu_build_id_end = ABSOLUTE(.);
  } > flash_text
in the esp32.project.ld.in

User avatar
mbratch
Posts: 303
Joined: Fri Jun 11, 2021 1:51 pm

Re: Unique build id for esp32

Postby mbratch » Fri Dec 23, 2022 3:14 pm

You could use target_add_binary_data.

tkvjkl
Posts: 3
Joined: Fri Dec 23, 2022 1:27 am

Re: Unique build id for esp32

Postby tkvjkl » Fri Dec 23, 2022 7:49 pm

That didn't work
I tried adding the following set(ESPTOOLPY_ELF2BIN "objcopy --only-keep-debug -O binary") to the cmakelist and I still do not see the GNU build id in the .bin file but I see it in the .elf file

User avatar
mbratch
Posts: 303
Joined: Fri Jun 11, 2021 1:51 pm

Re: Unique build id for esp32

Postby mbratch » Sat Dec 24, 2022 1:48 pm

I'm not sure exactly what you tried, but the method I showed is exactly how I do it in my project to add data to a bin file. You do need to modify what I showed more specifically for your situation. Did you check the documentation on the usage of those functions?

tkvjkl
Posts: 3
Joined: Fri Dec 23, 2022 1:27 am

Re: Unique build id for esp32

Postby tkvjkl » Mon Dec 26, 2022 7:57 pm

The link you shared above take me to this page https://docs.espressif.com/projects/esp ... embed-data

Do you have a github page where I can see how you add data to the bin file ?

User avatar
mbratch
Posts: 303
Joined: Fri Jun 11, 2021 1:51 pm

Re: Unique build id for esp32

Postby mbratch » Wed Dec 28, 2022 10:42 pm

tkvjkl wrote:
Mon Dec 26, 2022 7:57 pm
The link you shared above take me to this page https://docs.espressif.com/projects/esp ... embed-data

Do you have a github page where I can see how you add data to the bin file ?
There's a section in that document called "Embedding Binary Data". If you read through that section, it explains how it works and it has a link to an example CMakeList.txt.

Who is online

Users browsing this forum: ok-home and 85 guests