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

What is causing the error "Undefined symbol app_error_handler"?

I'm using nRF51822 to communicate with nRF24L01+ without SoftDevice, and it is working fine.

But when I add app_timer.c to the project and compile, it will show the following error:

._build\radio_tx_example_arm.axf: Error: L6218E: Undefined symbol app_error_handler (referred from app_timer.o).

I have added #include "app_error.h" and #include "nrf_error.h", and the include path is included.

I'm working with the radio_example found in nrf51822\Board\nrf6310\radio_example.

Does anyone know what is causing the error?

  • Have you defined the app_error_handler function in main.c?

    void app_error_handler(uint32_t error_code, uint32_t line_num, const uint8_t * p_file_name) {...}

    It should be defined in the top of main.c in all examples that are handling errors.

    For more information, please examine one of the examples in the S110 folder, for example ble_app_hrs.

  • the above function is already defined in app_error.c and still getting error as

    *** Using Compiler 'V5.06 update 3 (build 300)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin' Rebuild target 'nrf51422_xxac' compiling nrf_delay.c... compiling app_error.c... compiling main.c... assembling arm_startup_nrf51.s... compiling nrf_drv_common.c... compiling system_nrf51.c... compiling nrf_drv_twi.c... linking... ._build\nrf51422_xxac.axf: Error: L6200E: Symbol app_error_handler multiply defined (by app_error.o and main.o). Not enough information to list image symbols. Not enough information to list the image map. Finished: 2 information, 0 warning and 1 error messages. "._build\nrf51422_xxac.axf" - 1 Error(s), 0 Warning(s). Target not created. Build Time Elapsed: 00:00:03

Related