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

NRF_LOG() / CLI problem - NRF_CLI_CMD_BUFF_SIZE is undefined

Hi All,

I am working on  ISP1507 which is based on NRF52832. My IDE is Keil V5.26.2.0.  I have had the following problem in the UART example (pca10040e) from SDK 15.0.0. I am fairly new working with all these. 

I was trying to amend the UART example according to my needs. However at some point, the application started to reset continuously due an error that I could not have defined. After some research I have found that I have to check the error log written to SEGGER RTT by NRF_LOG (please correct me if I am wrong). I have then tried to get the NRF_LOG working according to the instructions I have found here. However I have stuck.

I have included the necessary ".h" files and their paths. I have also added the ".c" files under "nRF_Libraries" (under "Groups" in "Manage Project Items"). The files I have added, includes some other files which were not initially found by the compiler however, I have gradually added every single missing file. However in the last file I have added, nfc_cli.h, there is a missing MACRO, NRF_CLI_CMD_BUFF_SIZE, and I could not have overcome this one. Where is it defined? What else should I include?

Thanks,

D

Parents
  • Define NRF_CLI_CMD_BUFF_SIZE shall be defined in sdk_config.h file. Please check CLI example:

    nrf5\examples\peripheral\cli

  • Hi again,

    I have added it manually. That one solved. Then I had to add NRF_CLI_PRINTF_BUFF_SIZE too, which I have. Now I am having something bigger. Please see below. 

    Is this how I should get NRF_LOG working for the uart example or am I missing something fundamental?

    Thanks,

    D

    .\_build\nrf52810_xxaa.axf: Error: L6218E: Undefined symbol nrf_atomic_flag_clear_fetch (referred from nrf_log_frontend.o).
    .\_build\nrf52810_xxaa.axf: Error: L6218E: Undefined symbol nrf_atomic_flag_set (referred from nrf_log_frontend.o).
    .\_build\nrf52810_xxaa.axf: Error: L6218E: Undefined symbol nrf_atomic_u32_add (referred from nrf_log_frontend.o).
    .\_build\nrf52810_xxaa.axf: Error: L6218E: Undefined symbol nrf_atomic_u32_fetch_store (referred from nrf_log_frontend.o).
    .\_build\nrf52810_xxaa.axf: Error: L6218E: Undefined symbol nrf_cli_fprintf (referred from nrf_log_frontend.o).
    .\_build\nrf52810_xxaa.axf: Error: L6218E: Undefined symbol nrf_cli_help_print (referred from nrf_log_frontend.o).
    .\_build\nrf52810_xxaa.axf: Error: L6218E: Undefined symbol nrf_memobj_alloc (referred from nrf_log_frontend.o).
    .\_build\nrf52810_xxaa.axf: Error: L6218E: Undefined symbol nrf_memobj_get (referred from nrf_log_frontend.o).
    .\_build\nrf52810_xxaa.axf: Error: L6218E: Undefined symbol nrf_memobj_pool_init (referred from nrf_log_frontend.o).
    .\_build\nrf52810_xxaa.axf: Error: L6218E: Undefined symbol nrf_memobj_put (referred from nrf_log_frontend.o).
    .\_build\nrf52810_xxaa.axf: Error: L6218E: Undefined symbol nrf_memobj_write (referred from nrf_log_frontend.o).

  • What I require is particularly UART. I am trying to adapt it for my application. I need NRF_LOG() to figure out the error I am suffering from. Thanks for your help anyways. 

  • To be homest I am confused now, why do you need CLI? Please let me know what do you excactly would like to have in your application?

    My current understanding is that you need UART only for logging purposes. In this case you do not need CLI.

    Or maybe I am wrong and you need UART for logging and communication with other devices?

  • Sorry if I have not been clear enough. I am developing an application by which NRF52832 will communicated with another MCU via UART. This is the primary use.

    While adapting the the UART example to my needs, I have had an error. The application started to enter "__WEAK void app_error_fault_handler" . I was trying to figure out the reason for this.

    After some research, I found that I should check the NRF_LOG() output on the RTT. This is why I am trying to get NRF_LRG() working. And while I am trying to do so, I have added NRF_LOG() files and done the necessary changes in sdk_config.h. However, the files I have added included some other files. I found and added these missing files too. This has led me to CLI files...

  •  I can share with you UART example configured to use RTT logging.

    Please let me know what DK do you use?

  • Thank you very much. I will have a look at your example and see what I am missing. I have to figure out what is going on with this even if it is solved with you example.

    I am using ISP1507 module development board, it has the same settings with PCA10040. 

Reply Children
  • Please find attached configured projects (SDK15.2) for SES and GCC. Just replace folder uart in sdk examples with attached one.

    8015.uart.7z

  • I guess this project file is for SEGGER Embedded Studio. Is there a way to open it with Keil uVision?

  • Thank you very much Jakub. I will go through your project to see what I am doing wrong and share it. 

    Regards

    D

  • Thank you very much for all your efforts. However, unfortunately I have not been able get it work. I open the uart_pca10040.uvprojx and try to compile it, I get 29 errors, it cannot find some of the files. I check the Folder Setup to make sure of the paths. I have confirmed a number of them, I have even reselected some of them but I still get error for them. 

    Please see the project section in the left. I think there is problem with arm_startup_nr52.s and system_nrf32.c  under Device. 

    Am I missing a setting or something?

    *** Using Compiler 'V5.06 update 6 (build 750)', folder: 'E:\Keil_v5\ARM\ARMCC\Bin'
    Build target 'nrf52832_xxaa'
    compiling nrfx_prs.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\modules\nrfx\drivers\src\prs\nrfx_prs.c": No such file or directory
    ..\..\..\..\..\..\modules\nrfx\drivers\src\prs\nrfx_prs.c: 0 warnings, 1 error
    compiling app_error.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\components\libraries\util\app_error.c": No such file or directory
    ..\..\..\..\..\..\components\libraries\util\app_error.c: 0 warnings, 1 error
    compiling nrfx_uart.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\modules\nrfx\drivers\src\nrfx_uart.c": No such file or directory
    ..\..\..\..\..\..\modules\nrfx\drivers\src\nrfx_uart.c: 0 warnings, 1 error
    compiling nrf_drv_uart.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\integration\nrfx\legacy\nrf_drv_uart.c": No such file or directory
    ..\..\..\..\..\..\integration\nrfx\legacy\nrf_drv_uart.c: 0 warnings, 1 error
    compiling nrfx_uarte.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\modules\nrfx\drivers\src\nrfx_uarte.c": No such file or directory
    ..\..\..\..\..\..\modules\nrfx\drivers\src\nrfx_uarte.c: 0 warnings, 1 error
    compiling main.c...
    ..\..\..\main.c(53): error: #5: cannot open source input file "app_uart.h": No such file or directory
    #include "app_uart.h"
    ..\..\..\main.c: 0 warnings, 1 error
    compiling boards.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\components\boards\boards.c": No such file or directory
    ..\..\..\..\..\..\components\boards\boards.c: 0 warnings, 1 error
    compiling app_error_handler_keil.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\components\libraries\util\app_error_handler_keil.c": No such file or directory
    ..\..\..\..\..\..\components\libraries\util\app_error_handler_keil.c: 0 warnings, 1 error
    compiling app_uart_fifo.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\components\libraries\uart\app_uart_fifo.c": No such file or directory
    ..\..\..\..\..\..\components\libraries\uart\app_uart_fifo.c: 0 warnings, 1 error
    compiling app_util_platform.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\components\libraries\util\app_util_platform.c": No such file or directory
    ..\..\..\..\..\..\components\libraries\util\app_util_platform.c: 0 warnings, 1 error
    compiling nrf_assert.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\components\libraries\util\nrf_assert.c": No such file or directory
    ..\..\..\..\..\..\components\libraries\util\nrf_assert.c: 0 warnings, 1 error
    compiling app_error_weak.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\components\libraries\util\app_error_weak.c": No such file or directory
    ..\..\..\..\..\..\components\libraries\util\app_error_weak.c: 0 warnings, 1 error
    compiling app_fifo.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\components\libraries\fifo\app_fifo.c": No such file or directory
    ..\..\..\..\..\..\components\libraries\fifo\app_fifo.c: 0 warnings, 1 error
    compiling nrf_atomic.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\components\libraries\atomic\nrf_atomic.c": No such file or directory
    ..\..\..\..\..\..\components\libraries\atomic\nrf_atomic.c: 0 warnings, 1 error
    compiling nrf_balloc.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\components\libraries\balloc\nrf_balloc.c": No such file or directory
    ..\..\..\..\..\..\components\libraries\balloc\nrf_balloc.c: 0 warnings, 1 error
    compiling nrf_fprintf_format.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\external\fprintf\nrf_fprintf_format.c": No such file or directory
    ..\..\..\..\..\..\external\fprintf\nrf_fprintf_format.c: 0 warnings, 1 error
    compiling nrf_ringbuf.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\components\libraries\ringbuf\nrf_ringbuf.c": No such file or directory
    ..\..\..\..\..\..\components\libraries\ringbuf\nrf_ringbuf.c: 0 warnings, 1 error
    compiling nrf_strerror.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\components\libraries\strerror\nrf_strerror.c": No such file or directory
    ..\..\..\..\..\..\components\libraries\strerror\nrf_strerror.c: 0 warnings, 1 error
    compiling nrf_memobj.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\components\libraries\memobj\nrf_memobj.c": No such file or directory
    ..\..\..\..\..\..\components\libraries\memobj\nrf_memobj.c: 0 warnings, 1 error
    compiling nrf_fprintf.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\external\fprintf\nrf_fprintf.c": No such file or directory
    ..\..\..\..\..\..\external\fprintf\nrf_fprintf.c: 0 warnings, 1 error
    compiling nrf_log_backend_rtt.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\components\libraries\log\src\nrf_log_backend_rtt.c": No such file or directory
    ..\..\..\..\..\..\components\libraries\log\src\nrf_log_backend_rtt.c: 0 warnings, 1 error
    compiling retarget.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\components\libraries\uart\retarget.c": No such file or directory
    ..\..\..\..\..\..\components\libraries\uart\retarget.c: 0 warnings, 1 error
    compiling nrf_log_default_backends.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\components\libraries\log\src\nrf_log_default_backends.c": No such file or directory
    ..\..\..\..\..\..\components\libraries\log\src\nrf_log_default_backends.c: 0 warnings, 1 error
    compiling nrf_log_backend_serial.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\components\libraries\log\src\nrf_log_backend_serial.c": No such file or directory
    ..\..\..\..\..\..\components\libraries\log\src\nrf_log_backend_serial.c: 0 warnings, 1 error
    compiling nrf_log_str_formatter.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\components\libraries\log\src\nrf_log_str_formatter.c": No such file or directory
    ..\..\..\..\..\..\components\libraries\log\src\nrf_log_str_formatter.c: 0 warnings, 1 error
    compiling SEGGER_RTT.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\external\segger_rtt\SEGGER_RTT.c": No such file or directory
    ..\..\..\..\..\..\external\segger_rtt\SEGGER_RTT.c: 0 warnings, 1 error
    compiling nrf_log_frontend.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\components\libraries\log\src\nrf_log_frontend.c": No such file or directory
    ..\..\..\..\..\..\components\libraries\log\src\nrf_log_frontend.c: 0 warnings, 1 error
    compiling SEGGER_RTT_Syscalls_KEIL.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\external\segger_rtt\SEGGER_RTT_Syscalls_KEIL.c": No such file or directory
    ..\..\..\..\..\..\external\segger_rtt\SEGGER_RTT_Syscalls_KEIL.c: 0 warnings, 1 error
    compiling SEGGER_RTT_printf.c...
    "no source": Error: #5: cannot open source input file "..\..\..\..\..\..\external\segger_rtt\SEGGER_RTT_printf.c": No such file or directory
    ..\..\..\..\..\..\external\segger_rtt\SEGGER_RTT_printf.c: 0 warnings, 1 error
    assembling arm_startup_nrf52.s...
    compiling system_nrf52.c...
    ".\_build\nrf52832_xxaa.axf" - 29 Error(s), 0 Warning(s).
    Target not created.
    Build Time Elapsed: 00:00:02

Related