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

In nrfx_power_clock.h, NRFX_IRQ_IS_ENABLED(POWER_CLOCK_IRQn) gives the error: expected expression before ')' token

The build environment is a clean install of SEGGER Embedded Studio for ARM Release 3.50  Build 2018081000.36713 Windows x64

The nRF5_SDK_15.2.0_9412b96 version SDK is used, targeting the nRF52840 processor

The idea being to be as up-to-date as possible, with no legacy code being included in the project.

A new SEGGER project was created (i.e. not starting from an example project*), which then has all the NFRX Modules added to it, as configured by nfrx_config.h.

nrfx_glue.h and nrfx_log.h were copied into the project from the sdk directory modules\nrfx\templates

The only change made to them so far is to un-comment the line #include <soc/nrfx_irqs.h> inside nrfx_glue.h

I have found that all the NFRX Modules compile OK, with the sole exceptions of nfrx_power.c, and nfrx_power_clock.c and nfrx_clock.c

Those files all fail because they include nfrx_power_clock.h, which gives an error.

On line 68 they encounter   if (!NRFX_IRQ_IS_ENABLED(POWER_CLOCK_IRQn)), in which POWER_CLOCK_IRQn seems to be undefined.


[*None of the example projects seem to use the new NFRX modules, and so they are not appropriate starting points for a fresh new project]

Parents Reply Children
  • Hi.

    I used your paths and to make sure nothing was missing I also used my paths from the blinky project. Its not really clean but it works. My Headphone folder have the following path: nRF5_SDK_15.2.0_9412b96\examples\Headphones

    ./
    ../../components
    ../../components/ble/ble_advertising
    ../../components/ble/ble_dtm
    ../../components/ble/ble_racp
    ../../components/ble/ble_services/ble_ancs_c
    ../../components/ble/ble_services/ble_ans_c
    ../../components/ble/ble_services/ble_bas
    ../../components/ble/ble_services/ble_bas_c
    ../../components/ble/ble_services/ble_cscs
    ../../components/ble/ble_services/ble_cts_c
    ../../components/ble/ble_services/ble_dfu
    ../../components/ble/ble_services/ble_dis
    ../../components/ble/ble_services/ble_gls
    ../../components/ble/ble_services/ble_hids
    ../../components/ble/ble_services/ble_hrs
    ../../components/ble/ble_services/ble_hrs_c
    ../../components/ble/ble_services/ble_hts
    ../../components/ble/ble_services/ble_ias
    ../../components/ble/ble_services/ble_ias_c
    ../../components/ble/ble_services/ble_lbs
    ../../components/ble/ble_services/ble_lbs_c
    ../../components/ble/ble_services/ble_lls
    ../../components/ble/ble_services/ble_nus
    ../../components/ble/ble_services/ble_nus_c
    ../../components/ble/ble_services/ble_rscs
    ../../components/ble/ble_services/ble_rscs_c
    ../../components/ble/ble_services/ble_tps
    ../../components/ble/common
    ../../components/ble/nrf_ble_gatt
    ../../components/ble/nrf_ble_qwr
    ../../components/ble/peer_manager
    ../../components/boards
    ../../components/drivers_nrf/usbd
    ../../components/libraries/atomic
    ../../components/libraries/atomic_fifo
    ../../components/libraries/atomic_flags
    ../../components/libraries/balloc
    ../../components/libraries/bootloader/ble_dfu
    ../../components/libraries/button
    ../../components/libraries/cli
    ../../components/libraries/crc16
    ../../components/libraries/crc32
    ../../components/libraries/crypto
    ../../components/libraries/csense
    ../../components/libraries/csense_drv
    ../../components/libraries/delay
    ../../components/libraries/ecc
    ../../components/libraries/experimental_section_vars
    ../../components/libraries/experimental_task_manager
    ../../components/libraries/fds
    ../../components/libraries/fstorage
    ../../components/libraries/gfx
    ../../components/libraries/gpiote
    ../../components/libraries/hardfault
    ../../components/libraries/hci
    ../../components/libraries/led_softblink
    ../../components/libraries/log
    ../../components/libraries/log/src
    ../../components/libraries/low_power_pwm
    ../../components/libraries/mem_manager
    ../../components/libraries/memobj
    ../../components/libraries/mpu
    ../../components/libraries/mutex
    ../../components/libraries/pwm
    ../../components/libraries/pwr_mgmt
    ../../components/libraries/queue
    ../../components/libraries/ringbuf
    ../../components/libraries/scheduler
    ../../components/libraries/sdcard
    ../../components/libraries/slip
    ../../components/libraries/sortlist
    ../../components/libraries/spi_mngr
    ../../components/libraries/stack_guard
    ../../components/libraries/strerror
    ../../components/libraries/svc
    ../../components/libraries/timer
    ../../components/libraries/twi_mngr
    ../../components/libraries/twi_sensor
    ../../components/libraries/usbd
    ../../components/libraries/usbd/class/audio
    ../../components/libraries/usbd/class/cdc
    ../../components/libraries/usbd/class/cdc/acm
    ../../components/libraries/usbd/class/hid
    ../../components/libraries/usbd/class/hid/generic
    ../../components/libraries/usbd/class/hid/kbd
    ../../components/libraries/usbd/class/hid/mouse
    ../../components/libraries/usbd/class/msc
    ../../components/libraries/util
    ../../components/nfc/ndef/conn_hand_parser
    ../../components/nfc/ndef/conn_hand_parser/ac_rec_parser
    ../../components/nfc/ndef/conn_hand_parser/ble_oob_advdata_parser
    ../../components/nfc/ndef/conn_hand_parser/le_oob_rec_parser
    ../../components/nfc/ndef/connection_handover/ac_rec
    ../../components/nfc/ndef/connection_handover/ble_oob_advdata
    ../../components/nfc/ndef/connection_handover/ble_pair_lib
    ../../components/nfc/ndef/connection_handover/ble_pair_msg
    ../../components/nfc/ndef/connection_handover/common
    ../../components/nfc/ndef/connection_handover/ep_oob_rec
    ../../components/nfc/ndef/connection_handover/hs_rec
    ../../components/nfc/ndef/connection_handover/le_oob_rec
    ../../components/nfc/ndef/generic/message
    ../../components/nfc/ndef/generic/record
    ../../components/nfc/ndef/launchapp
    ../../components/nfc/ndef/parser/message
    ../../components/nfc/ndef/parser/record
    ../../components/nfc/ndef/text
    ../../components/nfc/ndef/uri
    ../../components/nfc/t2t_lib
    ../../components/nfc/t2t_lib/hal_t2t
    ../../components/nfc/t2t_parser
    ../../components/nfc/t4t_lib
    ../../components/nfc/t4t_lib/hal_t4t
    ../../components/nfc/t4t_parser/apdu
    ../../components/nfc/t4t_parser/cc_file
    ../../components/nfc/t4t_parser/hl_detection_procedure
    ../../components/nfc/t4t_parser/tlv
    ../../components/softdevice/common
    ../../components/softdevice/s132/headers
    ../../components/softdevice/s132/headers/nrf52
    ../../components/toolchain/cmsis/include
    ../../external/fprintf
    ../../external/segger_rtt
    ../../external/utf_converter
    ../../integration/nrfx
    ../../integration/nrfx/legacy
    ../../modules/nrfx
    ../../modules/nrfx/drivers/include
    ../../modules/nrfx/hal
    ../../modules/nrfx/mdk
    ../config
    .
    ./CMSIS_4/CMSIS/Include
    ./nRF/CMSIS/Device/Include
    ./OPUS
    ./OPUS/arm
    ../../components
    ../../config
    ../../external
    ../../modules
    ../../components/802_15_4
    ../../components/ant
    ../../components/ble
    ../../components/boards
    ../../components/drivers_ext
    ../../components/drivers_nrf
    ../../components/iot
    ../../components/libraries
    ../../components/nfc
    ../../components/proprietary_rf
    ../../components/serialization
    ../../components/softdevice
    ../../components/toolchain
    ../../components/802_15_4/api
    ../../components/802_15_4/raw
    ../../components/802_15_4/secure
    ../../components/802_15_4/src
    ../../components/802_15_4/api/HAL
    ../../components/802_15_4/api/MAC
    ../../components/802_15_4/api/PHY
    ../../components/802_15_4/api/RAL
    ../../components/802_15_4/api/SecAL
    ../../components/802_15_4/api/SysAL
    ../../components/802_15_4/api/HAL/nrf52_soc
    ../../components/802_15_4/api/RAL/nrf52_soc
    ../../components/ant/ant_channel_config
    ../../components/ant/ant_encryption
    ../../components/ant/ant_fs
    ../../components/ant/ant_key_manager
    ../../components/ant/ant_profiles
    ../../components/ant/ant_search_config
    ../../components/ant/ant_state_indicator
    ../../components/ant/ant_key_manager/config
    ../../components/ant/ant_profiles/ant_bpwr
    ../../components/ant/ant_profiles/ant_bsc
    ../../components/ant/ant_profiles/ant_common
    ../../components/ant/ant_profiles/ant_hrm
    ../../components/ant/ant_profiles/ant_sdm
    ../../components/ant/ant_profiles/ant_bpwr/pages
    ../../components/ant/ant_profiles/ant_bpwr/simulator
    ../../components/ant/ant_profiles/ant_bpwr/utils
    ../../components/ant/ant_profiles/ant_bsc/pages
    ../../components/ant/ant_profiles/ant_bsc/simulator
    ../../components/ant/ant_profiles/ant_bsc/utils
    ../../components/ant/ant_profiles/ant_common/ant_request_controller
    ../../components/ant/ant_profiles/ant_common/pages
    ../../components/ant/ant_profiles/ant_hrm/pages
    ../../components/ant/ant_profiles/ant_hrm/simulator
    ../../components/ant/ant_profiles/ant_hrm/utils
    ../../components/ant/ant_profiles/ant_sdm/pages
    ../../components/ant/ant_profiles/ant_sdm/simulator
    ../../components/ant/ant_profiles/ant_sdm/utils
    ../../components/ble/ble_advertising
    ../../components/ble/ble_db_discovery
    ../../components/ble/ble_dtm
    ../../components/ble/ble_link_ctx_manager
    ../../components/ble/ble_racp
    ../../components/ble/ble_radio_notification
    ../../components/ble/ble_services
    ../../components/ble/common
    ../../components/ble/nrf_ble_gatt
    ../../components/ble/nrf_ble_qwr
    ../../components/ble/nrf_ble_scan
    ../../components/ble/peer_manager
    ../../components/ble/ble_services/ble_ancs_c
    ../../components/ble/ble_services/ble_ans_c
    ../../components/ble/ble_services/ble_bas
    ../../components/ble/ble_services/ble_bas_c
    ../../components/ble/ble_services/ble_bps
    ../../components/ble/ble_services/ble_cscs
    ../../components/ble/ble_services/ble_cts_c
    ../../components/ble/ble_services/ble_dfu
    ../../components/ble/ble_services/ble_dis
    ../../components/ble/ble_services/ble_dis_c
    ../../components/ble/ble_services/ble_escs
    ../../components/ble/ble_services/ble_gls
    ../../components/ble/ble_services/ble_hids
    ../../components/ble/ble_services/ble_hrs
    ../../components/ble/ble_services/ble_hrs_c
    ../../components/ble/ble_services/ble_hts
    ../../components/ble/ble_services/ble_ias
    ../../components/ble/ble_services/ble_ias_c
    ../../components/ble/ble_services/ble_ipsp
    ../../components/ble/ble_services/ble_lbs
    ../../components/ble/ble_services/ble_lbs_c
    ../../components/ble/ble_services/ble_lls
    ../../components/ble/ble_services/ble_nus
    ../../components/ble/ble_services/ble_nus_c
    ../../components/ble/ble_services/ble_rscs
    ../../components/ble/ble_services/ble_rscs_c
    ../../components/ble/ble_services/ble_tps
    ../../components/ble/ble_services/eddystone
    ../../components/ble/ble_services/experimental_ble_lns
    ../../components/ble/ble_services/experimental_ble_ots
    ../../components/ble/ble_services/experimental_gatts_c
    ../../components/ble/ble_services/experimental_nrf_ble_cgms
    ../../components/ble/ble_services/experimental_nrf_ble_ots_c
    ../../components/ble/ble_services/nrf_ble_bms
    ../../components/drivers_ext/adns2080
    ../../components/drivers_ext/bh1745
    ../../components/drivers_ext/ccs811
    ../../components/drivers_ext/cherry8x16
    ../../components/drivers_ext/ds1624
    ../../components/drivers_ext/hts221
    ../../components/drivers_ext/ili9341
    ../../components/drivers_ext/lis2dh12
    ../../components/drivers_ext/lps22hb
    ../../components/drivers_ext/max9850
    ../../components/drivers_ext/mcp4725
    ../../components/drivers_ext/mpu6050
    ../../components/drivers_ext/nrf6350
    ../../components/drivers_ext/st7735
    ../../components/drivers_ext/sx1509b
    ../../components/drivers_ext/synaptics_touchpad
    ../../components/drivers_ext/uda1380
    ../../components/drivers_nrf/nrf_soc_nosd
    ../../components/drivers_nrf/radio_config
    ../../components/drivers_nrf/sdio
    ../../components/drivers_nrf/spi_master
    ../../components/drivers_nrf/twi_master
    ../../components/drivers_nrf/usbd
    ../../components/drivers_nrf/sdio/config
    ../../components/drivers_nrf/twi_master/deprecated
    ../../components/drivers_nrf/twi_master/deprecated/config
    ../../components/libraries/atomic
    ../../components/libraries/atomic_fifo
    ../../components/libraries/atomic_flags
    ../../components/libraries/balloc
    ../../components/libraries/block_dev
    ../../components/libraries/bootloader
    ../../components/libraries/bsp
    ../../components/libraries/button
    ../../components/libraries/cli
    ../../components/libraries/crc16
    ../../components/libraries/crc32
    ../../components/libraries/crypto
    ../../components/libraries/csense
    ../../components/libraries/csense_drv
    ../../components/libraries/delay
    ../../components/libraries/ecc
    ../../components/libraries/experimental_libuarte
    ../../components/libraries/experimental_section_vars
    ../../components/libraries/experimental_task_manager
    ../../components/libraries/fds
    ../../components/libraries/fifo
    ../../components/libraries/fstorage
    ../../components/libraries/gfx
    ../../components/libraries/gpiote
    ../../components/libraries/hardfault
    ../../components/libraries/hci
    ../../components/libraries/led_softblink
    ../../components/libraries/log
    ../../components/libraries/low_power_pwm
    ../../components/libraries/memobj
    ../../components/libraries/mem_manager
    ../../components/libraries/mpu
    ../../components/libraries/mutex
    ../../components/libraries/pwm
    ../../components/libraries/pwr_mgmt
    ../../components/libraries/queue
    ../../components/libraries/ringbuf
    ../../components/libraries/scheduler
    ../../components/libraries/sdcard
    ../../components/libraries/sensorsim
    ../../components/libraries/serial
    ../../components/libraries/sha256
    ../../components/libraries/simple_timer
    ../../components/libraries/slip
    ../../components/libraries/sortlist
    ../../components/libraries/spi_mngr
    ../../components/libraries/stack_guard
    ../../components/libraries/stack_info
    ../../components/libraries/strerror
    ../../components/libraries/svc
    ../../components/libraries/timer
    ../../components/libraries/twi_mngr
    ../../components/libraries/twi_sensor
    ../../components/libraries/uart
    ../../components/libraries/usbd
    ../../components/libraries/util
    ../../components/libraries/block_dev/empty
    ../../components/libraries/block_dev/qspi
    ../../components/libraries/block_dev/ram
    ../../components/libraries/block_dev/sdc
    ../../components/libraries/bootloader/ble_dfu
    ../../components/libraries/bootloader/dfu
    ../../components/libraries/bootloader/serial_dfu
    ../../components/libraries/cli/ble_uart
    ../../components/libraries/cli/cdc_acm
    ../../components/libraries/cli/libuarte
    ../../components/libraries/cli/rtt
    ../../components/libraries/cli/uart
    ../../components/libraries/crypto/backend
    ../../components/libraries/crypto/backend/cc310
    ../../components/libraries/crypto/backend/cc310_bl
    ../../components/libraries/crypto/backend/cifra
    ../../components/libraries/crypto/backend/mbedtls
    ../../components/libraries/crypto/backend/micro_ecc
    ../../components/libraries/crypto/backend/nrf_hw
    ../../components/libraries/crypto/backend/nrf_sw
    ../../components/libraries/crypto/backend/oberon
    ../../components/libraries/hardfault/nrf52
    ../../components/libraries/hardfault/nrf52/handler
    ../../components/libraries/log/src
    ../../components/libraries/timer/experimental
    ../../components/libraries/usbd/class
    ../../components/libraries/usbd/class/audio
    ../../components/libraries/usbd/class/cdc
    ../../components/libraries/usbd/class/dummy
    ../../components/libraries/usbd/class/hid
    ../../components/libraries/usbd/class/msc
    ../../components/libraries/usbd/class/nrf_dfu_trigger
    ../../components/libraries/usbd/class/cdc/acm
    ../../components/libraries/usbd/class/hid/generic
    ../../components/libraries/usbd/class/hid/kbd
    ../../components/libraries/usbd/class/hid/mouse
    ../../components/nfc/ndef
    ../../components/nfc/t2t_lib
    ../../components/nfc/t2t_parser
    ../../components/nfc/t4t_lib
    ../../components/nfc/t4t_parser
    ../../components/nfc/ndef/connection_handover
    ../../components/nfc/ndef/conn_hand_parser
    ../../components/nfc/ndef/generic
    ../../components/nfc/ndef/launchapp
    ../../components/nfc/ndef/parser
    ../../components/nfc/ndef/text
    ../../components/nfc/ndef/uri
    ../../components/nfc/ndef/connection_handover/ac_rec
    ../../components/nfc/ndef/connection_handover/ble_oob_advdata
    ../../components/nfc/ndef/connection_handover/ble_pair_lib
    ../../components/nfc/ndef/connection_handover/ble_pair_msg
    ../../components/nfc/ndef/connection_handover/common
    ../../components/nfc/ndef/connection_handover/ep_oob_rec
    ../../components/nfc/ndef/connection_handover/hs_rec
    ../../components/nfc/ndef/connection_handover/le_oob_rec
    ../../components/nfc/ndef/conn_hand_parser/ac_rec_parser
    ../../components/nfc/ndef/conn_hand_parser/ble_oob_advdata_parser
    ../../components/nfc/ndef/conn_hand_parser/le_oob_rec_parser
    ../../components/nfc/ndef/generic/message
    ../../components/nfc/ndef/generic/record
    ../../components/nfc/ndef/parser/message
    ../../components/nfc/ndef/parser/record
    ../../components/nfc/t2t_lib/hal_t2t
    ../../components/nfc/t4t_lib/hal_t4t
    ../../components/nfc/t4t_parser/apdu
    ../../components/nfc/t4t_parser/cc_file
    ../../components/nfc/t4t_parser/hl_detection_procedure
    ../../components/nfc/t4t_parser/tlv
    ../../components/proprietary_rf/esb
    ../../components/proprietary_rf/gzll
    ../../components/proprietary_rf/gzll/arm
    ../../components/proprietary_rf/gzll/config
    ../../components/proprietary_rf/gzll/gcc
    ../../components/proprietary_rf/gzll/iar
    ../../components/serialization/application
    ../../components/serialization/common
    ../../components/serialization/connectivity
    ../../components/serialization/application/codecs
    ../../components/serialization/application/hal
    ../../components/serialization/application/transport
    ../../components/serialization/application/codecs/ant
    ../../components/serialization/application/codecs/ble
    ../../components/serialization/application/codecs/common
    ../../components/serialization/application/codecs/ant/middleware
    ../../components/serialization/application/codecs/ant/serializers
    ../../components/serialization/application/codecs/ble/middleware
    ../../components/serialization/application/codecs/ble/serializers
    ../../components/serialization/common/struct_ser
    ../../components/serialization/common/transport
    ../../components/serialization/common/struct_ser/ant
    ../../components/serialization/common/struct_ser/ble
    ../../components/serialization/common/transport/ser_phy
    ../../components/serialization/common/transport/ser_phy/config
    ../../components/serialization/connectivity/codecs
    ../../components/serialization/connectivity/hal
    ../../components/serialization/connectivity/codecs/ant
    ../../components/serialization/connectivity/codecs/ble
    ../../components/serialization/connectivity/codecs/common
    ../../components/serialization/connectivity/codecs/ant/middleware
    ../../components/serialization/connectivity/codecs/ant/serializers
    ../../components/serialization/connectivity/codecs/ble/middleware
    ../../components/serialization/connectivity/codecs/ble/serializers
    ../../components/softdevice/common
    ../../components/softdevice/mbr
    ../../components/softdevice/s140
    ../../components/softdevice/mbr/nrf52840
    ../../components/softdevice/mbr/nrf52840/headers
    ../../components/softdevice/mbr/nrf52840/hex
    ../../components/softdevice/s140/doc
    ../../components/softdevice/s140/headers
    ../../components/softdevice/s140/hex
    ../../components/softdevice/s140/headers/nrf52
    ../../modules/nrfx
    ../../modules/nrfx/drivers
    ../../modules/nrfx/hal
    ../../modules/nrfx/mdk
    ../../modules/nrfx/soc
    ../../modules/nrfx/drivers/include
    ../../modules/nrfx/drivers/src
    ../../modules/nrfx/drivers/src/prs

    - Andreas

  • Hi,
    Ok, of all the additional include directories you added, only one matters, and that was ../../integration/nrfx

    This has the effect of including the legacy-integration version of nfrx_glue.h, thereby overriding the version I have in my project's directory.
    The one in my project's directory is a copy of the template nfrx_glue.h file from modules\nrfx\templates.
    In In this file it has the following comment:

    // THIS IS A TEMPLATE FILE.
    // It should be copied to a suitable location within the host environment into
    // which nrfx is integrated, and the following macros should be provided with
    // appropriate implementations.

    Unfortunately there seems to be no documentation saying how the user is supposed to do this task.

    The problem macro that was preventing the NFRX Modules from building was NRFX_IRQ_IS_ENABLED, which has a blank definition in this file.

    I replaced the blank template definition with the following definition taken from the nfrx_glue.h file located in ../../integration.nfrx and now everything builds ok.
    Caveat: There's no documentation or even any in-line comments for this Nordic code, so I have no idea what this code does or if it is correct. 

    /**
     * @brief Macro for checking if a specific IRQ is enabled.
     *
     * @param irq_number  IRQ number.
     *
     * @retval true  If the IRQ is enabled.
     * @retval false Otherwise.
     */
    #define NRFX_IRQ_IS_ENABLED(irq_number)  _NRFX_IRQ_IS_ENABLED(irq_number)
    static inline bool _NRFX_IRQ_IS_ENABLED(IRQn_Type irq_number)
    {
        return 0 != (NVIC->ISER[irq_number / 32] & (1UL << (irq_number % 32)));
    }


    Hopefully this issue is solved for now. (until I need another of these macros to be defined)

  • Hi,

    I am having the same issue. Is there any comment on how to define the macros in nrfx_glue.h to get rid of all the compilation errors. 

  • Okay I've just found it that there is one template and one integeration header with the same name. Sorry but this is a confusing.

  • It is likely that the glue file in `nrfx` is defining the Macro first and then the integration attempts to define it after and fails.

    #ifndef NRFX_GLUE_H__
    #define NRFX_GLUE_H__
    
    // glue here...
    
    #endif

    Make sure your include order is correct.  Include the glue file you want to use before the one you want it to override.

Related