This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Error: L6218E: Undefined Symbol error

Hello,

After digging through similar questions and answers I am still unable to build my code due to compiler errors. I am receiving these 5 errors:

Error: L6218E: Undefined symbol SEGGER_RTT_printf

Error: L6218E: Undefined symbol nrf_drv_twi_rx

Error: L6218E: Undefined symbol nrf_drv_twi_tx

Error: L6218E: Undefined symbol nrf_drv_twi_enable

Error: L6218E: Undefined symbol nrf_drv_twi_init

What I have tried:

I added "SEGGER_RTT_printf.c" and "nrf_drv_twi.c" to my project. I have included their respective paths in Options for Target>C/C++>Include Paths, and I even copied the .c files to the same folder as my project source files. No luck.

I created this project from scratch in Keil (sdk 12.2), I wonder if I am missing some compiler option? Does anyone have any other ideas for me to try to fix this?

Thank you,

Levi

  • Created from scratch? If you start a new project its recommended to use one of the template projects(if you dont use BLE sdk_folder/examples/peripheral/template_project, if you use BLE: sdk_folder/examples/ble_peripheral/ble_app_template). Regarding your errors, you need to enable the different modules in `sdk_config.h. Take a look at the sdk_config.h in e.g. the template_project.

    Also take a look at what files are included in the different twi example projects

  • Thanks Daniel.

    I have decided to make a copy of the TWI example project and add my code to it instead. I was able to compile.

  • Maybe you forgot to enable the module in sdk_config.h?

  • Hi Petter,

    As it turns out I fixed the SEGGER_RTT_PRINTF error by copying the header files from the Segger folder on my hard drive directly to the external/segger file in the sdk.

    However, I believe I already had the correct TWI settings in sdk_config (defining TWI_ENABLED, TWI0_ENABLED, and TWI0_USE_EASY_DMA). I could not find any other references to nrf_drv_twi that needed altered in the sdk_config header file. I fixed this issue by copying my code to the TWI_sensor project in the sdk, and now it compiles.