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

Can't get logs to work and compile successfully.

Been stuck for a few days on error related to logging. Have tried SDK 15.0 to 15.3 and get same error. Have deadline tomorrow and can't work on code. Ran out of ideas.  Seems to be related to macros expansion but not sure of anything anymore. Is Segger SES 4.12. 

Original problem occurred when I tried to enable logging. Logging had worked in the past so not sure what happened. Was stuck in cycle where when logging was enabled, during link phase there was an error that m_nrf_log_app_log_dataconst was not defined. Could not resolve that or find any reference to indicate a missing setting in sdk_config. So days later out of desperation i tried to define it to see if I would learn something else about the problem. All I learned is that you can waste a great deal of time chasing problems. Need help please. Have demo on Monday and just needed to add finishing touches to custom board that is doing active scanning of beacons and sending data via wifi soc to backend. Was needing logging to debug the wifi interface but have not added that code to the project yet. Using S132 and scan module only to gather the beacon info. Will be up in a few hours trying to complete this so I hope there is some guidance/wisdom when I wake up.

Parents
  • Hello, 

    Please upload your project and output in a .zip file. This will make it easier to help locate the issue you are having.

    Kind regards,
    Oeyvind

  • OK will do. FYI I started over using the ble_app_uart example from sdk 15.2 and running oble_app_uart.7zn dk pca10056. That compiled fine and the logging worked so I then added the scan module. With that added, the compiled failed in the same logging area as before. Very odd that just adding the scanner module breaks the logging.  The error when adding the scanner module to the ble_app_uart example is expected identifier before ')' token in nrf_log_internal.h around line 144 

    #define LOG_INTERNAL_1(type , str , arg0 ) \
    /*lint -save -e571*/nrf_log_frontend_std_1(type , str , (uint32_t) ( arg0 ) )/*lint -restore*/  
    #define LOG_INTERNAL_2(type, str, arg0, arg1) \

    So perhaps on my real app, using the scanner module, it is related to this same issue as in the ble_app_uart.

Reply
  • OK will do. FYI I started over using the ble_app_uart example from sdk 15.2 and running oble_app_uart.7zn dk pca10056. That compiled fine and the logging worked so I then added the scan module. With that added, the compiled failed in the same logging area as before. Very odd that just adding the scanner module breaks the logging.  The error when adding the scanner module to the ble_app_uart example is expected identifier before ')' token in nrf_log_internal.h around line 144 

    #define LOG_INTERNAL_1(type , str , arg0 ) \
    /*lint -save -e571*/nrf_log_frontend_std_1(type , str , (uint32_t) ( arg0 ) )/*lint -restore*/  
    #define LOG_INTERNAL_2(type, str, arg0, arg1) \

    So perhaps on my real app, using the scanner module, it is related to this same issue as in the ble_app_uart.

Children
  • I found the reason for

    expected identifier before ')' token in nrf_log_internal.h around line 144

    When compiling in SES, the output will show what file the error was found (line 47)

    Building ‘ble_app_uart_pca10056_s140’ from solution ‘ble_app_uart_pca10056_s140’ in configuration ‘Release’
      'Output/ble_app_uart_pca10056_s140 Release/Obj/thumb_crt0.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrf_log_backend_rtt.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrf_log_backend_serial.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrf_log_default_backends.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrf_log_frontend.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrf_log_str_formatter.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/app_button.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/app_error.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/app_error_handler_gcc.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/app_error_weak.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/app_fifo.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/app_scheduler.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/app_timer.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/app_uart_fifo.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/app_util_platform.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/hardfault_implementation.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrf_assert.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrf_atfifo.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrf_atflags.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrf_atomic.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrf_balloc.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrf_fprintf.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrf_fprintf_format.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrf_memobj.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrf_pwr_mgmt.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrf_ringbuf.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrf_section_iter.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrf_strerror.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/retarget.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/ses_startup_nrf52840.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/ses_startup_nrf_common.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/system_nrf52840.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/boards.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrf_drv_clock.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrf_drv_uart.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrfx_clock.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrfx_gpiote.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrfx_power_clock.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrfx_prs.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrfx_uart.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrfx_uarte.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/bsp.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/bsp_btn_ble.o' is up to date
      ../../../scannerGW.c (19.03.2019 09:36:41) is newer than Output/ble_app_uart_pca10056_s140 Release/Obj/scannerGW.o (19.03.2019 09:27:27).
      'Output/ble_app_uart_pca10056_s140 Release/Obj/SEGGER_RTT.o' is up to date
      Compiling ‘scannerGW.c’  <-- While compiling this file, the error occured.
        "C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 4.12/gcc/arm-none-eabi/bin/cc1" -fmessage-length=0 -fno-diagnostics-show-caret -mcpu=cortex-m4 -mlittle-endian -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -mtp=soft -munaligned-access -nostdinc "-isystemC:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 4.12/include" "-isystemC:/Users/oysa/AppData/Local/SEGGER/SEGGER Embedded Studio/v3/packages/include" -I../../../config -I../../../../../../components -I../../../../../../components/ble/ble_advertising -I../../../../../../components/ble/ble_dtm -I../../../../../../components/ble/ble_link_ctx_manager -I../../../../../../components/ble/ble_racp -I../../../../../../components\ble\nrf_ble_scan -I../../../../../../components/ble/ble_services/ble_ancs_c -I../../../../../../components/ble/ble_services/ble_ans_c -I../../../../../../components/ble/ble_services/ble_bas -I../../../../../../components/ble/ble_services/ble_bas_c -I../../../../../../components/ble/ble_services/ble_cscs -I../../../../../../components/ble/ble_services/ble_cts_c -I../../../../../../components/ble/ble_services/ble_dfu -I../../../../../../components/ble/ble_services/ble_dis -I../../../../../../components/ble/ble_services/ble_gls -I../../../../../../components/ble/ble_services/ble_hids -I../../../../../../components/ble/ble_services/ble_hrs -I../../../../../../components/ble/ble_services/ble_hrs_c -I../../../../../../components/ble/ble_services/ble_hts -I../../../../../../components/ble/ble_services/ble_ias -I../../../../../../components/ble/ble_services/ble_ias_c -I../../../../../../components/ble/ble_services/ble_lbs -I../../../../../../components/ble/ble_services/ble_lbs_c -I../../../../../../components/ble/ble_services/ble_lls -I../../../../../../components/ble/ble_services/ble_nus -I../../../../../../components/ble/ble_services/ble_nus_c -I../../../../../../components/ble/ble_services/ble_rscs -I../../../../../../components/ble/ble_services/ble_rscs_c -I../../../../../../components/ble/ble_services/ble_tps -I../../../../../../components/ble/common -I../../../../../../components/ble/nrf_ble_gatt -I../../../../../../components/ble/nrf_ble_qwr -I../../../../../../components/ble/peer_manager -I../../../../../../components/boards -I../../../../../../components/drivers_nrf/usbd -I../../../../../../components/libraries/atomic -I../../../../../../components/libraries/atomic_fifo -I../../../../../../components/libraries/atomic_flags -I../../../../../../components/libraries/balloc -I../../../../../../components/libraries/bootloader/ble_dfu -I../../../../../../components/libraries/bsp -I../../../../../../components/libraries/button -I../../../../../../components/libraries/cli -I../../../../../../components/libraries/crc16 -I../../../../../../components/libraries/crc32 -I../../../../../../components/libraries/crypto -I../../../../../../components/libraries/csense -I../../../../../../components/libraries/csense_drv -I../../../../../../components/libraries/delay -I../../../../../../components/libraries/ecc -I../../../../../../components/libraries/experimental_section_vars -I../../../../../../components/libraries/experimental_task_manager -I../../../../../../components/libraries/fds -I../../../../../../components/libraries/fifo -I../../../../../../components/libraries/fstorage -I../../../../../../components/libraries/gfx -I../../../../../../components/libraries/gpiote -I../../../../../../components/libraries/hardfault -I../../../../../../components/libraries/hci -I../../../../../../components/libraries/led_softblink -I../../../../../../components/libraries/log -I../../../../../../components/libraries/log/src -I../../../../../../components/libraries/low_power_pwm -I../../../../../../components/libraries/mem_manager -I../../../../../../components/libraries/memobj -I../../../../../../components/libraries/mpu -I../../../../../../components/libraries/mutex -I../../../../../../components/libraries/pwm -I../../../../../../components/libraries/pwr_mgmt -I../../../../../../components/libraries/queue -I../../../../../../components/libraries/ringbuf -I../../../../../../components/libraries/scheduler -I../../../../../../components/libraries/sdcard -I../../../../../../components/libraries/slip -I../../../../../../components/libraries/sortlist -I../../../../../../components/libraries/spi_mngr -I../../../../../../components/libraries/stack_guard -I../../../../../../components/libraries/strerror -I../../../../../../components/libraries/svc -I../../../../../../components/libraries/timer -I../../../../../../components/libraries/twi_mngr -I../../../../../../components/libraries/twi_sensor -I../../../../../../components/libraries/uart -I../../../../../../components/libraries/usbd -I../../../../../../components/libraries/usbd/class/audio -I../../../../../../components/libraries/usbd/class/cdc -I../../../../../../components/libraries/usbd/class/cdc/acm -I../../../../../../components/libraries/usbd/class/hid -I../../../../../../components/libraries/usbd/class/hid/generic -I../../../../../../components/libraries/usbd/class/hid/kbd -I../../../../../../components/libraries/usbd/class/hid/mouse -I../../../../../../components/libraries/usbd/class/msc -I../../../../../../components/libraries/util -I../../../../../../components/nfc/ndef/conn_hand_parser -I../../../../../../components/nfc/ndef/conn_hand_parser/ac_rec_parser -I../../../../../../components/nfc/ndef/conn_hand_parser/ble_oob_advdata_parser -I../../../../../../components/nfc/ndef/conn_hand_parser/le_oob_rec_parser -I../../../../../../components/nfc/ndef/connection_handover/ac_rec -I../../../../../../components/nfc/ndef/connection_handover/ble_oob_advdata -I../../../../../../components/nfc/ndef/connection_handover/ble_pair_lib -I../../../../../../components/nfc/ndef/connection_handover/ble_pair_msg -I../../../../../../components/nfc/ndef/connection_handover/common -I../../../../../../components/nfc/ndef/connection_handover/ep_oob_rec -I../../../../../../components/nfc/ndef/connection_handover/hs_rec -I../../../../../../components/nfc/ndef/connection_handover/le_oob_rec -I../../../../../../components/nfc/ndef/generic/message -I../../../../../../components/nfc/ndef/generic/record -I../../../../../../components/nfc/ndef/launchapp -I../../../../../../components/nfc/ndef/parser/message -I../../../../../../components/nfc/ndef/parser/record -I../../../../../../components/nfc/ndef/text -I../../../../../../components/nfc/ndef/uri -I../../../../../../components/nfc/t2t_lib -I../../../../../../components/nfc/t2t_lib/hal_t2t -I../../../../../../components/nfc/t2t_parser -I../../../../../../components/nfc/t4t_lib -I../../../../../../components/nfc/t4t_lib/hal_t4t -I../../../../../../components/nfc/t4t_parser/apdu -I../../../../../../components/nfc/t4t_parser/cc_file -I../../../../../../components/nfc/t4t_parser/hl_detection_procedure -I../../../../../../components/nfc/t4t_parser/tlv -I../../../../../../components/softdevice/common -I../../../../../../components/softdevice/s140/headers -I../../../../../../components/softdevice/s140/headers/nrf52 -I../../../../../../components/toolchain/cmsis/include -I../../../../../../external/fprintf -I../../../../../../external/segger_rtt -I../../../../../../external/utf_converter -I../../../../../../integration/nrfx -I../../../../../../integration/nrfx/legacy -I../../../../../../modules/nrfx -I../../../../../../modules/nrfx/drivers/include -I../../../../../../modules/nrfx/hal -I../../../../../../modules/nrfx/mdk -I../config -D__SIZEOF_WCHAR_T=4 -D__ARM_ARCH_7EM__ -D__SES_ARM -D__ARM_ARCH_FPV4_SP_D16__ -D__SES_VERSION=41200 -DNDEBUG -DBOARD_PCA10056 -DCONFIG_GPIO_AS_PINRESET -DFLOAT_ABI_HARD -DINITIALIZE_USER_SECTIONS -DNO_VTOR_CONFIG -DNRF52840_XXAA -DNRF_SD_BLE_API_VERSION=6 -DS140 -DSOFTDEVICE_PRESENT -DSWI_DISABLE0 -MD "C:/NordicSemi/SDK/nRF5_SDK_15.2.0_9412b96/examples/TEST/ble_app_uart/pca10056/s140/ses/Output/ble_app_uart_pca10056_s140 Release/Obj/scannerGW.d" -MQ "Output/ble_app_uart_pca10056_s140 Release/Obj/scannerGW.o" -quiet -std=gnu11 -g3 -gpubnames -Os -fomit-frame-pointer -fno-dwarf2-cfi-asm -fno-builtin -ffunction-sections -fdata-sections -fshort-enums -fno-common C:\NordicSemi\SDK\nRF5_SDK_15.2.0_9412b96\examples\TEST\ble_app_uart\scannerGW.c -o "C:/NordicSemi/SDK/nRF5_SDK_15.2.0_9412b96/examples/TEST/ble_app_uart/pca10056/s140/ses/Output/ble_app_uart_pca10056_s140 Release/Obj/scannerGW.asm"
        nrf_log.h
        scannerGW.c
        expected identifier before ')' token
        in expansion of macro 'LOG_INTERNAL_1'
        in expansion of macro 'CONCAT_2_'
        in expansion of macro 'CONCAT_2'
        in expansion of macro 'LOG_INTERNAL_X'
        in expansion of macro 'LOG_INTERNAL'
        in expansion of macro 'NRF_LOG_INTERNAL_MODULE'
        in expansion of macro 'NRF_LOG_INTERNAL_INFO'
        in expansion of macro 'NRF_LOG_INFO'
      'Output/ble_app_uart_pca10056_s140 Release/Obj/SEGGER_RTT_Syscalls_SES.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/SEGGER_RTT_printf.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/ble_advdata.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/ble_advertising.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/ble_conn_params.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/ble_conn_state.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/ble_link_ctx_manager.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/ble_srv_common.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrf_ble_gatt.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrf_ble_qwr.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrf_ble_scan.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/utf.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/ble_nus.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrf_sdh.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrf_sdh_ble.o' is up to date
      'Output/ble_app_uart_pca10056_s140 Release/Obj/nrf_sdh_soc.o' is up to date
    Build failed

    The error message gives a hint that it has something to do with the NRF_LOG. 

    So, the best way to find the issue, knowing that there is a problem with the brackets ( ), is to look through all calls to NRF_LOG* in scannerCW.c

    In the first switch case, line 182:

    NRF_LOG_INFO("Report Complete Status =%i \r\n", p_ble_evt->evt.gap_evt.params.adv_report. );
                                                                                            ^
    

  • Thank you for the help. I was able to fix that and get the program to compile now. Sorry I did not see how to identify the offending code this time.  But hopefully next time I will be more prepared.

    Will close issue and move on thanks to your help !

  • Glad we could be of help! :)

    Have a nice day!

Related