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

Error: L6218E

I am running into these 3 errors while compiling my program. I tried fixing sdk_config.h.

.\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol app_uart_init (referred from main.o).
.\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol nrfx_twim_enable (referred from main.o).
.\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol nrfx_twim_rx (referred from main.o).

Am I still missing anything else in sdk_config.h to make it work?

Parents Reply
  • Hi,

    Your first screenshot, for some reason, is zoomed out to the point where it is impossible to read the contents, but I suppose that it shows what header files you are including.

    Please note that you need to add the c files of the added libraries to the project as well, if you have not done so already.

    What are your sdk_config.h settings for the TWI/TWIM peripheral driver legacy layer (TWI_ENABLED, etc.)? See the sdk_config.h of TWI peripheral examples for reference.

    Regards,
    Terje

Children
  • Hi Terje,

    Sorry for the quality of the uploaded image. Hopefully this one is better. I am trying to show that in my app_uart.c in the project, it seems like "NRF_MODULE_ENABLED" is not enabled and so everything else is grayed out. 

    I followed the example given in \examples\ble_peripheral\ble_app_hrs_freertos

    The TWI_ENABLED are defined as shown,

    #ifndef NRFX_TWI_ENABLED
    #define NRFX_TWI_ENABLED 1
    #endif
    // <q> NRFX_TWI0_ENABLED  - Enable TWI0 instance
     
    
    #ifndef NRFX_TWI0_ENABLED
    #define NRFX_TWI0_ENABLED 1
    #endif
    
    // <q> NRFX_TWI1_ENABLED  - Enable TWI1 instance
     
    
    #ifndef NRFX_TWI1_ENABLED
    #define NRFX_TWI1_ENABLED 0
    #endif

    And the TWI1_ENABLED are defined as

    #ifndef NRFX_TWIM_ENABLED
    #define NRFX_TWIM_ENABLED 1
    #endif
    // <q> NRFX_TWIM0_ENABLED  - Enable TWIM0 instance
     
    
    #ifndef NRFX_TWIM0_ENABLED
    #define NRFX_TWIM0_ENABLED 1
    #endif
    
    // <q> NRFX_TWIM1_ENABLED  - Enable TWIM1 instance
     
    
    #ifndef NRFX_TWIM1_ENABLED
    #define NRFX_TWIM1_ENABLED 0
    #endif
    

    Thank you!

  • So have you added the required .c source files files to your Project?

  • Hi,

    I was not talking about the NRFX_TWI* defines, but the set of legacy layer TWI* defines. Have a look at the sdk_config.h file from a twi example in the SDK (you find them under <sdk folder>/examples/peripheral). There are many defines, such as TWI_ENABLED, TWI0_ENABLED, TWIM_ENABLED, TWIM0_ENABLED, TWIM1_ENABLED, etc. You may need to set both the NRFX_TWI* define and the corresponding TWI* define in sdk_config.h, in order not to get any trouble. If those defines are missing from your sdk_config.h file then you need to copy them (for instance from the sdk_config.h file of one of the twi examples.)

    Please also have a look at the comment from regarding .c source files. Are they all added to the project?

    Regards,
    Terje

  • I have added these defines but it did not help with the "Undefined symbol nrfx_twim_enable" error.

    // <e> TWI_ENABLED - nrf_drv_twi - TWI/TWIM peripheral driver - legacy layer
    //==========================================================
    #ifndef TWI_ENABLED
    #define TWI_ENABLED 1
    #endif
    // <o> TWI_DEFAULT_CONFIG_FREQUENCY  - Frequency
     
    // <26738688=> 100k 
    // <67108864=> 250k 
    // <104857600=> 400k 
    
    #ifndef TWI_DEFAULT_CONFIG_FREQUENCY
    #define TWI_DEFAULT_CONFIG_FREQUENCY 26738688
    #endif
    
    // <q> TWI_DEFAULT_CONFIG_CLR_BUS_INIT  - Enables bus clearing procedure during init
     
    
    #ifndef TWI_DEFAULT_CONFIG_CLR_BUS_INIT
    #define TWI_DEFAULT_CONFIG_CLR_BUS_INIT 0
    #endif
    
    // <q> TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT  - Enables bus holding after uninit
     
    
    #ifndef TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT
    #define TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT 0
    #endif
    
    // <o> TWI_DEFAULT_CONFIG_IRQ_PRIORITY  - Interrupt priority
     
    
    // <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
    // <0=> 0 (highest) 
    // <1=> 1 
    // <2=> 2 
    // <3=> 3 
    // <4=> 4 
    // <5=> 5 
    // <6=> 6 
    // <7=> 7 
    
    #ifndef TWI_DEFAULT_CONFIG_IRQ_PRIORITY
    #define TWI_DEFAULT_CONFIG_IRQ_PRIORITY 6
    #endif
    
    // <e> TWI0_ENABLED - Enable TWI0 instance
    //==========================================================
    #ifndef TWI0_ENABLED
    #define TWI0_ENABLED 1
    #endif
    // <q> TWI0_USE_EASY_DMA  - Use EasyDMA (if present)
     
    
    #ifndef TWI0_USE_EASY_DMA
    #define TWI0_USE_EASY_DMA 1
    #endif
    
    // </e>
    
    // <e> TWI1_ENABLED - Enable TWI1 instance
    //==========================================================
    #ifndef TWI1_ENABLED
    #define TWI1_ENABLED 0
    #endif
    // <q> TWI1_USE_EASY_DMA  - Use EasyDMA (if present)
     
    
    #ifndef TWI1_USE_EASY_DMA
    #define TWI1_USE_EASY_DMA 0
    #endif
    

    I have also added the .c files but did not solve the "app_uart_init" error.

    Thank you!

  • Hi,

    Sorry for the delay.

    In your screenshot I do not see the file nrfx_twim.c in the project. That file is where nrfx_twim_enable is implemented.

    What error messages (if any) do you get now? (After adding nrfx_twim.c if missing.)

    Regards,
    Terje

Related