Skip to main content
SBACO
Associate III
April 4, 2019
Question

touchgfx : binary contains debug infos

  • April 4, 2019
  • 13 replies
  • 2596 views

Hello,

When building my project using touchgfx, I generate a specific binary file for some images. So for the testing purpose I create a section with only one image of one black pixel. So basically this image in binary format should be around 2 bytes in 16BPP. However the binary seems to include in addition to this image some debug information like "GCC: (GNU Tools for ARM Embedded Processors 6-2017-q2-update) 6.3.1 20170620 (release) [ARM/embedded-6-branch revision 249437]" etc.

It does not seems to have a specific release or debug configuration in the makefile. the overhead in the in quite unlikely and in some of the other binary, I also have some absolute path of my own computer. Is there any way to remove all those information ?

Regards,

This topic has been closed for replies.

13 replies

After Forever
Senior III
April 4, 2019

The GNU toolchain should contain this tool - arm-none-eabi-strip

It can "strip" the debug (and other) symbols from the binary.

Docs: https://www.mankier.com/1/strip

Tesla DeLorean
Guru
April 4, 2019

The object file (.ELF/.AXF) or the binary (.BIN) written to the device memory?

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
SBACO
SBACOAuthor
Associate III
April 4, 2019

@After Forever​ I have tried strip as objcopy parameter or directly within the tools. It does not change anything :\ I tried strip-all or just the debug, does not change anything. I precise that each time I clean/rebuild my whole program for the testing.

@Community member​ I generate the binary using objcopy with --only-section parameter with the hex file as input. the image itself i generated with the touchgfx tools imageconverter.out.

Tesla DeLorean
Guru
April 4, 2019

Ok, so sounds like it is embedded in the code coming from some other libraries or objects. Your options there would be to check if it is using release versions of those objects/libraries, or if any command line settings into the compiler and/or linker are causing these things to appear.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
SBACO
SBACOAuthor
Associate III
April 5, 2019

Thanks for your reply.

I am using the default Makefile of touchgfx sample projects with just light modification to create stecific binaries for the images.

basically the options are :

linker_options += -g -Wl,-static -specs=nosys.specs -specs=nano.specs \

                 -mno-thumb-interwork \

                 -fno-exceptions \

                 -O0 -fno-strict-aliasing -Wl,--gc-sections

linker_options += -mcpu=cortex-m7 -Wno-psabi $(float_options)

c_compiler_options += -g \

                   -nostartfiles -mthumb -fno-exceptions \

                   -mno-thumb-interwork -std=c99 \

                   -O0 -fno-strict-aliasing -fdata-sections -ffunction-sections

c_compiler_options += -mthumb -mcpu=cortex-m7 -Wno-psabi $(float_options) -DCORE_M7 -D__irq=""

cpp_compiler_options += -g -mthumb \

                   -nostartfiles \

                   -mno-thumb-interwork -fno-rtti -fno-exceptions \

                   -O0 -fno-strict-aliasing -fdata-sections -ffunction-sections

cpp_compiler_options += -mthumb -mcpu=cortex-m7 -Wno-psabi $(float_options) -DCORE_M7 -D__irq=""

I tried to remove the -g option (not so sure about the meaning) but does not change anything. I also try to remove the "-fdata-sections -ffunction-sections" options.

As the imageconverter.out binary is provided by touchgfx, I am not sure about the way it is build.

What I can tell is that the .o of my 1 pixel image already include those "useless?" data. There is no real specs on the imageconverter options except the one in the project example which concerns only image format as I can understand.

SBACO
SBACOAuthor
Associate III
April 5, 2019

My bad, imageconverter.out has nothing to do with the problem as it generates only one C++ file for each image.

SBACO
SBACOAuthor
Associate III
April 8, 2019

sorry for pushing, but any other idea ?

Martin KJELDSEN
Principal III
April 10, 2019

Can you show us some examples of what you're experiencing? By default we use arm-none-eabi-strip to strip libtouchgfx.a when building the core library with arm-gcc (And equivalent for gcc).

Martin KJELDSEN
Principal III
May 14, 2019

Any update on this @SBACO​ ?

SBACO
SBACOAuthor
Associate III
May 27, 2019

Sorry for late reply, I was off for a few days. I am sorry to say that I do not find any solutions... I am afraid I will have to deal with it. It is just disapointing to lose so much memory for nothing.

SGold
Associate II
July 13, 2020

Hello, I know this post it a little bit old, but I'm seeing a lot of code information from the touchgfx library in the microcontroller's binary. I checked optimization, also I stripped debug info, unneeded and other flags, and the same. 

Any idea what can be happening?

Here is a picture of what I'm seeing in the binary. I don't think this was compiled as a debug info.

0693W000001slKKQAY.png

Thank you in advance.