cancel
Showing results for 
Search instead for 
Did you mean: 

How generate hex file without link files Hal_drivers

Fredolive
Associate II

Hello,

When I builed the project, I had seen the Hal drivers files links in the end file *.HEX.

How can I change the project configuration not to put this links in file because it use flash memory unnecessarily ?

Thanks 

21 REPLIES 21
Pavel A.
Evangelist III

If you don't define USE_FULL_ASSERT these filenames are just for debug information. They do not occupy room in the flash.

 

If Debug level is different of "None" then these roots filenames are in rom flash.

The only solution is the "None" choice to have any root filename.

What do you mean by, "Debug level" ?

Yes "debug level".

I looked this on STM32G0 and stm32G4. not on STM32F0.

Ah - this:

AndrewNeil_0-1727103345486.png

 

I'll bet that 'None' causes USE_FULL_ASSERT to be not defined.

Andrew Neil
Evangelist III

@Fredolive wrote:

How can I change the project configuration not to put this links in file because it use flash memory unnecessarily ? 


Note that it's just putting the file names in as string literals - it's not linking any code.

Yes, it is rigth. But it used rom flash to anything. 

You can get rid of it by not defining USE_FULL_ASSERT .

Or you could change your assert_param definition to not use __FILE__ and, thus, not require that the filenames be stored.

Hello,

Thanks for your help.

Now, it is Ok, and I haven't the roots names in my Hex File.

Best Regards