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

Logging Configuration Problem

Using SDK15.3.

Using the logging in deferred mode with RTT viewer.

Getting the errors below from the macro expansions but I can't identify what is missing.

Went through another sdk15.3 example with logging and it worked ok.

Copied the logging related sdk_config.h section from that working example into my project and it did not help.

Some missing flag or error but I don't see it.

Have gone through other logging examples to no avail.

The project uses BLE scanning and SPIM interface and works fine when the logging error does not break the build.

Appreciate any help.

Build errors

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Main Include
#include "nrfx_gpiote.h"
#include "sdk_config.h"
#include "boards.h"
#include "string.h"
#include "nordic_common.h"
#include "nrf_sdm.h"
#include "nrf_delay.h"
#include "nrf_sdh.h"
#include "nrf_sdh_ble.h"
#include "nrf_sdh_soc.h"
#include "nrf_drv_gpiote.h"
#include "nrfx_clock.h"
#include "nrfx_spim.h"
#include "nrfx_timer.h"
#include "app_timer.h"
#include "nrf_ble_scan.h"
#include "app_util.h"
#include "app_error.h"
#include "app_util.h"
#include "fds.h"
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
1> C:/Program Files/SEGGERSESARM 4.50/gcc/arm-none-eabi/bin/ld: Output/CC3135 Debug/Obj/cc3135.o: in function `c3x_call_back':
1> J:\Users\clark\Desktop\Development\nRF5_SDK_1530\examples\ble_central\CC3135/cc3135.c:1644: undefined reference to `m_nrf_log_app_logs_dataconst'
1> C:/Program Files/SEGGERSESARM 4.50/gcc/arm-none-eabi/bin/ld: Output/CC3135 Debug/Obj/cc3135.o: in function `ble_evt_handler':
1> J:\Users\clark\Desktop\Development\nRF5_SDK_1530\examples\ble_central\CC3135/cc3135.c:2140: undefined reference to `m_nrf_log_app_logs_dataconst'
1> C:/Program Files/SEGGERSESARM 4.50/gcc/arm-none-eabi/bin/ld: Output/CC3135 Debug/Obj/cc3135.o: in function `spim_init':
1> J:\Users\clark\Desktop\Development\nRF5_SDK_1530\examples\ble_central\CC3135/cc3135.c:2278: undefined reference to `m_nrf_log_app_logs_dataconst'
1> C:/Program Files/SEGGERSESARM 4.50/gcc/arm-none-eabi/bin/ld: Output/CC3135 Debug/Obj/cc3135.o: in function `timer_init':
1> J:\Users\clark\Desktop\Development\nRF5_SDK_1530\examples\ble_central\CC3135/cc3135.c:3138: undefined reference to `m_nrf_log_app_logs_dataconst'
1> C:/Program Files/SEGGERSESARM 4.50/gcc/arm-none-eabi/bin/ld: Output/CC3135 Debug/Obj/cc3135.o: in function `button_press_handler':
1> J:\Users\clark\Desktop\Development\nRF5_SDK_1530\examples\ble_central\CC3135/cc3135.c:2035: undefined reference to `m_nrf_log_app_logs_dataconst'
1> C:/Program Files/SEGGERSESARM 4.50/gcc/arm-none-eabi/bin/ld: Output/CC3135 Debug/Obj/cc3135.o:J:\Users\clark\Desktop\Development\nRF5_SDK_1530\examples\ble_central\CC3135/cc3135.c:3741: more undefined references to `m_nrf_log_app_logs_dataconst' follow
Build failed
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 

Error Line Example

sdk_config.h

(Logging was disabled (NRF_LOG_ENABLE 0) in this config so I could build and continue the project.)

sdk_config.h

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!DOCTYPE CrossStudio_Project_File>
<solution Name="CC3135" target="8" version="2">
<project Name="CC3135">
<configuration
Connection="USB 174505935"
Name="Common"
SEGGER2Proj="Yes"
arm_architecture="v7EM"
arm_compiler_variant="gcc"
arm_core_type="Cortex-M4"
arm_endian="Little"
arm_fp_abi="Hard"
arm_fpu_type="FPv4-SP-D16"
arm_linker_allow_multiple_definition="Yes"
arm_linker_heap_size="8192"
arm_linker_process_stack_size="0"
arm_linker_stack_size="8192"
arm_linker_treat_warnings_as_errors="No"
arm_linker_variant="GNU"
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Here is a stripped down file with debug_log issues in terms of what prints on debug console and rtt viewer.

LoggingProblem.zip