Reputation: 83
I'm facing a linker error. I wrote the following inline Assembly code in Keil µVision5,
_asm("NOP");
_asm("NOP");
and I got the following error:
.\RAM\STM32F439_Template.axf: Error: L6218E: Undefined symbol _asm (referred from main.o).
I included the header file "stm325439xx.h" in the program.
Could anyone help me fix this error? Thank you.
Upvotes: 0
Views: 2294
Reputation: 5470
To make this code work, you either need to include the header where a macro _asm
is defined, or else if it is built in to some compiler then select the correct compiler in the project settings (Keil tools support multiple different compilers).
However, the portable solution is to not use this code but rather to include "stm32f4xx.h"
and then use __NOP()
, which is correct for many compilers.
Upvotes: 1