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

[NRF52832][SDK 14.0][Keil] Hardware UART + Ble compilation issue

Hi,

Trying to implement a simple Hardware UART in parrallel with Ble on a custom board with mdbt42 Raytac module. I have the following compilation error:

*** Using Compiler 'V5.06 update 4 (build 422)', folder: 'C:\Program Files (x86)\Keil\ARM\ARMCC\Bin'
Build target 'nrf52832_xxaa'
compiling main.c...
linking...
.\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol app_uart_init (referred from main.o).
.\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol app_uart_put (referred from main.o).
Not enough information to list image symbols.
Finished: 1 information, 0 warning and 2 error messages.
".\_build\nrf52832_xxaa.axf" - 2 Error(s), 0 Warning(s).
Target not created.
Build Time Elapsed:  00:00:04

I tried a lot of things including to add corresponding source file to project and add folder path to compiler. Ble beacon project and UART peripheral project works well separatly. I often have difficult to merge projects using softdevice and projects without.

Does someone can help figuring out what wrong ?

Bellow the source code:

#include <stdbool.h>
#include <stdint.h>
#include "nordic_common.h"
#include "nrf_soc.h"
#include "nrf_sdh.h"
#include "nrf_sdh_ble.h"
#include "nrf_delay.h"
#include "ble_advdata.h"
#include "app_uart.h"
#include "app_timer.h"
#include "nrf_log.h"
#include "nrf_log_ctrl.h"
#include "nrf_log_default_backends.h"
#include "nrf_gpio.h"

uint32_t err_code;
uint8_t cr = 'a';

const app_uart_comm_params_t comm_params =
      {
          17,
          16,
          NULL,
          NULL,
          APP_UART_FLOW_CONTROL_DISABLED,
          false,
          UART_BAUDRATE_BAUDRATE_Baud115200
      };
			

int main(void)
{
    // Initialize.
		nrf_gpio_cfg_output(25);
		nrf_gpio_cfg_output(26);
		nrf_gpio_cfg_output(27);
	
		APP_UART_INIT(&comm_params,
                         NULL,
                         APP_IRQ_PRIORITY_LOWEST,
                         err_code);
	
    for (;; )
    {
				nrf_gpio_pin_toggle(25);
				nrf_gpio_pin_toggle(26);
				nrf_gpio_pin_toggle(27);
				app_uart_put(cr);
				nrf_delay_ms(1000);
    }
}

Alexander

  • Check the length of your path. If it has too many nested folders, the Keil linker will fail to find some of the object files.

  • Hi Doug, thank you

    Ok, I tried to reduce the Path length but the error still remain. Not sure to understand why the linker doesn't like long path File. My SDK Folder is in my Desktop and the Path to Object folder look like this:

    C:\Users\Alexander\Desktop\nRF5_SDK_14.0.0_3bcc1f7\examples\ble_peripheral\Alpha_LoRa_UART_3\pca10040\s132\arm4\_build
    

    What do you suggest ? Alexander

  • Have you enabled app_uart in sdk_config.h?

    #define APP_UART_ENABLED 1
    
  • Hi Jorgen,

    SDK configuration look like this:

    // <e> UART_ENABLED - nrf_drv_uart - UART/UARTE peripheral driver
    //==========================================================
    #ifndef UART_ENABLED
    #define UART_ENABLED 1
    #endif
    // <o> UART_DEFAULT_CONFIG_HWFC  - Hardware Flow Control
     
    // <0=> Disabled 
    // <1=> Enabled 
    
    #ifndef UART_DEFAULT_CONFIG_HWFC
    #define UART_DEFAULT_CONFIG_HWFC 0
    #endif
    
    // <o> UART_DEFAULT_CONFIG_PARITY  - Parity
     
    // <0=> Excluded 
    // <14=> Included 
    
    #ifndef UART_DEFAULT_CONFIG_PARITY
    #define UART_DEFAULT_CONFIG_PARITY 0
    #endif
    
    // <o> UART_DEFAULT_CONFIG_BAUDRATE  - Default Baudrate
     
    // <323584=> 1200 baud 
    // <643072=> 2400 baud 
    // <1290240=> 4800 baud 
    // <2576384=> 9600 baud 
    // <3862528=> 14400 baud 
    // <5152768=> 19200 baud 
    // <7716864=> 28800 baud 
    // <10289152=> 38400 baud 
    // <15400960=> 57600 baud 
    // <20615168=> 76800 baud 
    // <30801920=> 115200 baud 
    // <61865984=> 230400 baud 
    // <67108864=> 250000 baud 
    // <121634816=> 460800 baud 
    // <251658240=> 921600 baud 
    // <268435456=> 1000000 baud 
    
    #ifndef UART_DEFAULT_CONFIG_BAUDRATE
    #define UART_DEFAULT_CONFIG_BAUDRATE 30801920
    #endif
    
    // <o> UART_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 UART_DEFAULT_CONFIG_IRQ_PRIORITY
    #define UART_DEFAULT_CONFIG_IRQ_PRIORITY 7
    #endif
    
    // <q> UART_EASY_DMA_SUPPORT  - Driver supporting EasyDMA
     
    
    #ifndef UART_EASY_DMA_SUPPORT
    #define UART_EASY_DMA_SUPPORT 1
    #endif
    
    // <q> UART_LEGACY_SUPPORT  - Driver supporting Legacy mode
     
    
    #ifndef UART_LEGACY_SUPPORT
    #define UART_LEGACY_SUPPORT 0
    #endif
    
    // <e> UART0_ENABLED - Enable UART0 instance
    //==========================================================
    #ifndef UART0_ENABLED
    #define UART0_ENABLED 1
    #endif
    // <q> UART0_CONFIG_USE_EASY_DMA  - Default setting for using EasyDMA
     
    
    #ifndef UART0_CONFIG_USE_EASY_DMA
    #define UART0_CONFIG_USE_EASY_DMA 1
    #endif
    
  • You right the app_uart was not enabled, now I set app_uart_defined to 1 but the error still remain.

    Configuration:

    // <e> APP_UART_ENABLED - app_uart - UART driver
    //==========================================================
    #ifndef APP_UART_ENABLED
    #define APP_UART_ENABLED 1
    #endif
    // <o> APP_UART_DRIVER_INSTANCE  - UART instance used
     
    // <0=> 0 
    
    #ifndef APP_UART_DRIVER_INSTANCE
    #define APP_UART_DRIVER_INSTANCE 1
    #endif
    
    // </e>
    
Related