Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Numerous errors compiling nrf_log_frontend.c

I wasn't receiving any log messages while debugging the ble_app_uart_c example using SES so I enabled appropriate logging functions and set them to level 4 in config.h.  Still didn't get any log messages so I added NRF_LOG_INFO() after the #defines section in main.c. 

Compiler is flagging many, many errors such as:  

                #define LOG_INTERNAL_X(N, ...) CONCAT_2(LOG_INTERNAL_, N), (__VA_ARGS__)       'LOG_INTERNAL_0' undeclared (first use in this function); did you mean 'LOG_INTERNAL_2'?

and:

                #define LOG_INTERNAL_X(N, ...) CONCAT_2(LOG_INTERNAL_, N), (__VA_ARGS__)       expected expression before ')' token 

I've been able to eliminate some errors simply by retyping the code but others keep popping up with each successive run.  

Please advise.

Parents
  • Hi,

    It is difficult to know what has gone wrong without seeing your code. Also, you don't write which SDK version you are using, but SDK 15.3 use RTT logging in the ble_app_uart_c example, so you don't need to do much at all. It is already enabled, so you just have to use an RTT viewer or SES directly to observe the logs, and add NRF_LOG_INFO("some log message") wherever you need it. If you need logging in a file that does not have the required include, you just need to add "#include "nrf_log.h"" in that file.

    If that does not help, please elaborate on what you have done, preferably by sharing code.

  • I am using SDK 15.3.  A bit more info... I thought that i might have a corrupt nrf_log_internal.h file so I replaced it and commented out the NRF_LOG_INFO() line that I added at the top of main.c then rebuilt the project and it worked.  Then I reenabled the NRF_LOG_INFO() line in main.c and got tje same errors again.  I then commented out the NRF_LOG_INFO() line again but still get the errors.  I will email my project to you.  

Reply
  • I am using SDK 15.3.  A bit more info... I thought that i might have a corrupt nrf_log_internal.h file so I replaced it and commented out the NRF_LOG_INFO() line that I added at the top of main.c then rebuilt the project and it worked.  Then I reenabled the NRF_LOG_INFO() line in main.c and got tje same errors again.  I then commented out the NRF_LOG_INFO() line again but still get the errors.  I will email my project to you.  

Children
Related