cancel
Showing results for 
Search instead for 
Did you mean: 

Issues due to optimization level

Muthaiah Murugappan
Associate II
Posted on June 26, 2018 at 23:00

Hello All,

              I hope your doing good. I am working on a project based on STM32L476RG using Keil v5. I have used assert in my code. It works correctly for the compiler optimization L2 and L3. But when I change to Level 1 or 0, i get

'G3\G3.axf: Error: L6218E: Undefined symbol __aeabi_assert (referred from st_spi.o).'

 Anybody with any leads on this. Thank you all for your time.

Muthaiah Murugappan

#optimization #hal-spi #stm32l476
6 REPLIES 6
Bob S
Principal
Posted on June 26, 2018 at 23:15

See this link:

http://www.keil.com/support/man/docs/armlib/armlib_chr1358938924063.htm

Apparently with the Keil compiler the assert() macro behaves differently depending on the optimization level.  The real question is why the linker isn't finding the __atabi_assert() function that is supposed to be in a library somewhere.

Muthaiah Murugappan
Associate II
Posted on June 26, 2018 at 23:48

Hello Bob,

                Thanks for getting back to me. The link you sent describes a better picture for my issue. Thanks for the information. 

Even I'm not able to figure out, why the compiler doesn't find out the library function.

Thanks

Muthaiah Murugappan

Posted on June 27, 2018 at 00:21

>>Even I'm not able to figure out, why the compiler doesn't find out the library function.

Keil has support contact numbers for such issues.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on June 27, 2018 at 15:11

Hey Clive, thanks for responding, I will get in touch with keil support and post an update here.

Posted on June 27, 2018 at 17:49

Are there portions of the project that aren't getting rebuilt properly, or pulled in as libraries?

Have you tried Rebuild-All?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on June 27, 2018 at 19:54

Yes Clive, I have tried rebuilding all and I guess there isn't portions, not getting rebuilt properly.