Hi, I'm trying to play around with an EFM32g starter kit and I've been struggling to get anything more than the example projects working mostly due to my confusion around linking within Keil.
I tried copying and pasting an example project folder from within Silicon Labs' installation directory into a simpler directory that I made. I brought over all of the necessary packages with it (CMSIS, BSP, emlib, etc.). And so I went through the moved project, and went through the Target Options to change the Include Paths under the C/C++ and Asm tab. However when I try and build the moved example I get the errors:
linking... .\obj\blink.axf: Error: L6218E: Undefined symbol BSP_LedsInit (referred from blink.o). .\obj\blink.axf: Error: L6218E: Undefined symbol BSP_LedsSet (referred from blink.o). Not enough information to list image symbols. Finished: 1 information, 0 warning and 2 error messages.
Comparing between the original project buried in Silicon Labs directories and the one I moved into my cleaner directory, I believe I have everything listed based on the source files used in the project and the include paths. Is there another option I am not noticing that would be directory dependent?
So use grep, or your file search tool of choice, and figure what file(s) the offending functions reside in. Determine if they require any specific define on the compiler command line, or if you simply need to include these files into the project.
The linker's complaining there are parts missing, find the parts.
Determine if they require any specific define on the compiler command line
Aha, you're right! So the functions it complains about are in a source file I've included (both in the main file and in the project include paths), however they are defined under a line:
#if defined( BSP_GPIO_LEDS )
There is a header file that defines this, bspconfig.h, and there is an #include "bspconfig.h" in the file relying on the definition, and a reference to the location of this header file in the project include paths. However, I can see comparing between the original working project and the one that this bspconfig.h is not showing up in the project tree sidebar when I expand the 'include file dependencies'. And naturally in the working project it is. Why wouldn't it be there if it is #included and its location is one of the include paths?
Okay I tracked down the issue. I have no idea why, but there was an #include line that was commented out in one of the board library files, but only in the version that was in the new directory I had made (even though it was just copied from the old one??). I have no idea why, but it's working now so I'm happy and puzzled.