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

undefined reference to "app_uart_init"

I'm getting an undefined reference to "app_uart_init". I've enabled the respective libraries in the sdk_config.h:


//==========================================================

// <h> nRF_Libraries

//==========================================================
// <q> APP_FIFO_ENABLED - app_fifo - Software FIFO implementation

#ifndef APP_FIFO_ENABLED
#define APP_FIFO_ENABLED 1
#endif

// <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

I've seen this issue in other posts but it seems I have everything set up correctly. I'm using the 17.0 version SDK

But the respecitve files are greyed out:

*/
#include "sdk_common.h"
#if NRF_MODULE_ENABLED(APP_UART)
#include "app_uart.h"
#include "nrf_drv_uart.h"
#include "nrf_assert.h"

#include "sdk_common.h"
#if NRF_MODULE_ENABLED(APP_FIFO)
#include "app_fifo.h"

lease let me know what is missing

Parents
  • Hello,

    I'm getting an undefined reference to "app_uart_init". I've enabled the respective libraries in the sdk_config.h:

    As you mention that you have seen in other posts, the 'undefined reference' error is most commonly generated when some files have not been included properly in the project.

    From the screenshot you have provided, the grayed out #if NRF_MODULE_ENABLED(APP_UART) line tells us that it seems that the sdk_config might be incorrectly configured.
    Which hardware are you working with? I see that you have tagged "nrf52" in your post, but I will need to know specifically.
    Are you working with the nRF52 DK, or the nRF52840 DK?

    Be advised that the nRF52832 SoC only has 1 UART instance, UART 0. It seems that you are trying to use UART instance 1 ( UART1 ) in your code - so in the case that you are using the nRF52 DK, please try to change the APP_UART_DRIVER_INSTANCE to 0, in your sdk config, and see if this resolves the problem.

    Looking forward to resolving this issue together,

    Best regards,
    Karl 

Reply
  • Hello,

    I'm getting an undefined reference to "app_uart_init". I've enabled the respective libraries in the sdk_config.h:

    As you mention that you have seen in other posts, the 'undefined reference' error is most commonly generated when some files have not been included properly in the project.

    From the screenshot you have provided, the grayed out #if NRF_MODULE_ENABLED(APP_UART) line tells us that it seems that the sdk_config might be incorrectly configured.
    Which hardware are you working with? I see that you have tagged "nrf52" in your post, but I will need to know specifically.
    Are you working with the nRF52 DK, or the nRF52840 DK?

    Be advised that the nRF52832 SoC only has 1 UART instance, UART 0. It seems that you are trying to use UART instance 1 ( UART1 ) in your code - so in the case that you are using the nRF52 DK, please try to change the APP_UART_DRIVER_INSTANCE to 0, in your sdk config, and see if this resolves the problem.

    Looking forward to resolving this issue together,

    Best regards,
    Karl 

Children
No Data
Related