Please enable GPIOTE instance for used GPIO port!

Hi there,

I've just noticed that the nRF Connect SDK 2.6.0 has been released; I've upgraded my project and got the following build error:

[184/334] Building C object zephyr/drivers/gpio/CMakeFiles/drivers__gpio.dir/gpio_nrfx.c.obj
FAILED: zephyr/drivers/gpio/CMakeFiles/drivers__gpio.dir/gpio_nrfx.c.obj 
ccache /home/laci/projects/ncs/toolchains/2be090971e/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -DNRF52840_XXAA -DUSE_PARTITION_MANAGER=1 -D_ANSI_SOURCE -D_FORTIFY_SOURCE=1 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR_SUPERVISOR__ -D__ZEPHYR__=1 -I/home/laci/projects/firmware-uhk/nrfconnect/nrf/drivers/mpsl/clock_control -I/home/laci/projects/firmware-uhk/nrfconnect/zephyr/include -I/home/laci/projects/firmware-uhk/uhk/device/build/uhk-d/zephyr/include/generated -I/home/laci/projects/firmware-uhk/nrfconnect/zephyr/soc/arm/nordic_nrf/nrf52 -I/home/laci/projects/firmware-uhk/nrfconnect/zephyr/lib/libc/newlib/include -I/home/laci/projects/firmware-uhk/nrfconnect/zephyr/lib/posix/getopt/. -I/home/laci/projects/firmware-uhk/nrfconnect/zephyr/soc/common/nordic_nrf/. -I/home/laci/projects/firmware-uhk/nrfconnect/zephyr/soc/arm/nordic_nrf/common/. -I/home/laci/projects/firmware-uhk/nrfconnect/zephyr/subsys/bluetooth -I/home/laci/projects/firmware-uhk/nrfconnect/zephyr/subsys/settings/include -I/home/laci/projects/firmware-uhk/nrfconnect/zephyr/drivers/usb/common/nrf_usbd_common/. -I/home/laci/projects/firmware-uhk/nrfconnect/nrf/include -I/home/laci/projects/firmware-uhk/nrfconnect/nrf/lib/multithreading_lock/. -I/home/laci/projects/firmware-uhk/nrfconnect/nrf/subsys/bluetooth/controller/. -I/home/laci/projects/firmware-uhk/nrfconnect/zephyr/drivers/flash -I/home/laci/projects/firmware-uhk/nrfconnect/nrf/tests/include -I/home/laci/projects/firmware-uhk/nrfconnect/modules/hal/cmsis/CMSIS/Core/Include -I/home/laci/projects/firmware-uhk/nrfconnect/zephyr/modules/cmsis/. -I/home/laci/projects/firmware-uhk/nrfconnect/modules/hal/nordic/nrfx -I/home/laci/projects/firmware-uhk/nrfconnect/modules/hal/nordic/nrfx/drivers/include -I/home/laci/projects/firmware-uhk/nrfconnect/modules/hal/nordic/nrfx/mdk -I/home/laci/projects/firmware-uhk/nrfconnect/zephyr/modules/hal_nordic/nrfx/. -I/home/laci/projects/firmware-uhk/nrfconnect/modules/debug/segger/SEGGER -I/home/laci/projects/firmware-uhk/nrfconnect/modules/debug/segger/Config -I/home/laci/projects/firmware-uhk/nrfconnect/modules/crypto/tinycrypt/lib/include -I/home/laci/projects/firmware-uhk/nrfconnect/nrfxlib/mpsl/fem/common/include -I/home/laci/projects/firmware-uhk/nrfconnect/nrfxlib/mpsl/fem/nrf21540_gpio/include -I/home/laci/projects/firmware-uhk/nrfconnect/nrfxlib/mpsl/fem/nrf21540_gpio_spi/include -I/home/laci/projects/firmware-uhk/nrfconnect/nrfxlib/mpsl/fem/simple_gpio/include -I/home/laci/projects/firmware-uhk/nrfconnect/nrfxlib/mpsl/fem/include -I/home/laci/projects/firmware-uhk/nrfconnect/nrfxlib/mpsl/fem/include/protocol -I/home/laci/projects/firmware-uhk/nrfconnect/nrfxlib/mpsl/include -I/home/laci/projects/firmware-uhk/nrfconnect/nrfxlib/mpsl/include/protocol -I/home/laci/projects/firmware-uhk/nrfconnect/nrfxlib/softdevice_controller/include -isystem /home/laci/projects/firmware-uhk/nrfconnect/zephyr/lib/libc/common/include -isystem /home/laci/projects/firmware-uhk/nrfconnect/nrfxlib/crypto/nrf_cc310_platform/include -Wshadow -fno-strict-aliasing -Os -imacros /home/laci/projects/firmware-uhk/uhk/device/build/uhk-d/zephyr/include/generated/autoconf.h -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee --sysroot=/home/laci/projects/ncs/toolchains/2be090971e/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros /home/laci/projects/firmware-uhk/nrfconnect/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=/home/laci/projects/firmware-uhk/uhk/device=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/laci/projects/firmware-uhk/nrfconnect/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/laci/projects/firmware-uhk=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=nano.specs -D_POSIX_THREADS -std=c99 -MD -MT zephyr/drivers/gpio/CMakeFiles/drivers__gpio.dir/gpio_nrfx.c.obj -MF zephyr/drivers/gpio/CMakeFiles/drivers__gpio.dir/gpio_nrfx.c.obj.d -o zephyr/drivers/gpio/CMakeFiles/drivers__gpio.dir/gpio_nrfx.c.obj -c /home/laci/projects/firmware-uhk/nrfconnect/zephyr/drivers/gpio/gpio_nrfx.c
In file included from /home/laci/projects/firmware-uhk/nrfconnect/zephyr/include/zephyr/sys/util_macro.h:34,
                 from /home/laci/projects/firmware-uhk/nrfconnect/zephyr/include/zephyr/irq_multilevel.h:15,
                 from /home/laci/projects/firmware-uhk/nrfconnect/zephyr/include/zephyr/devicetree.h:20,
                 from /home/laci/projects/firmware-uhk/nrfconnect/zephyr/modules/hal_nordic/nrfx/./nrfx_config.h:10,
                 from /home/laci/projects/firmware-uhk/nrfconnect/modules/hal/nordic/nrfx/nrfx.h:37,
                 from /home/laci/projects/firmware-uhk/nrfconnect/modules/hal/nordic/nrfx/drivers/include/nrfx_gpiote.h:37,
                 from /home/laci/projects/firmware-uhk/nrfconnect/zephyr/drivers/gpio/gpio_nrfx.c:9:
/home/laci/projects/firmware-uhk/nrfconnect/zephyr/include/zephyr/toolchain/gcc.h:87:36: error: static assertion failed: "Please enable GPIOTE instance for used GPIO port!"
   87 | #define BUILD_ASSERT(EXPR, MSG...) _Static_assert(EXPR, "" MSG)
      |                                    ^~~~~~~~~~~~~~
/home/laci/projects/firmware-uhk/nrfconnect/zephyr/include/zephyr/sys/util_internal.h:72:26: note: in definition of macro '__DEBRACKET'
   72 | #define __DEBRACKET(...) __VA_ARGS__
      |                          ^~~~~~~~~~~
/home/laci/projects/firmware-uhk/nrfconnect/zephyr/include/zephyr/sys/util_internal.h:64:9: note: in expansion of macro '__GET_ARG2_DEBRACKET'
   64 |         __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
      |         ^~~~~~~~~~~~~~~~~~~~
/home/laci/projects/firmware-uhk/nrfconnect/zephyr/include/zephyr/sys/util_internal.h:59:9: note: in expansion of macro '__COND_CODE'
   59 |         __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
      |         ^~~~~~~~~~~
/home/laci/projects/firmware-uhk/nrfconnect/zephyr/include/zephyr/sys/util_macro.h:180:9: note: in expansion of macro 'Z_COND_CODE_1'
  180 |         Z_COND_CODE_1(_flag, _if_1_code, _else_code)
      |         ^~~~~~~~~~~~~
/home/laci/projects/firmware-uhk/nrfconnect/zephyr/include/zephyr/devicetree.h:4151:9: note: in expansion of macro 'COND_CODE_1'
 4151 |         COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT),   \
      |         ^~~~~~~~~~~
/home/laci/projects/firmware-uhk/nrfconnect/zephyr/include/zephyr/sys/util_internal.h:69:53: note: in expansion of macro '__DEBRACKET'
   69 | #define __GET_ARG2_DEBRACKET(ignore_this, val, ...) __DEBRACKET val
      |                                                     ^~~~~~~~~~~
/home/laci/projects/firmware-uhk/nrfconnect/zephyr/include/zephyr/sys/util_internal.h:64:9: note: in expansion of macro '__GET_ARG2_DEBRACKET'
   64 |         __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
      |         ^~~~~~~~~~~~~~~~~~~~
/home/laci/projects/firmware-uhk/nrfconnect/zephyr/include/zephyr/sys/util_internal.h:59:9: note: in expansion of macro '__COND_CODE'
   59 |         __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
      |         ^~~~~~~~~~~
/home/laci/projects/firmware-uhk/nrfconnect/zephyr/include/zephyr/sys/util_macro.h:180:9: note: in expansion of macro 'Z_COND_CODE_1'
  180 |         Z_COND_CODE_1(_flag, _if_1_code, _else_code)
      |         ^~~~~~~~~~~~~
/home/laci/projects/firmware-uhk/nrfconnect/zephyr/drivers/gpio/gpio_nrfx.c:448:9: note: in expansion of macro 'COND_CODE_1'
  448 |         COND_CODE_1(DT_INST_NODE_HAS_PROP(id, gpiote_instance),                \
      |         ^~~~~~~~~~~
/home/laci/projects/firmware-uhk/nrfconnect/zephyr/drivers/gpio/gpio_nrfx.c:449:18: note: in expansion of macro 'BUILD_ASSERT'
  449 |                 (BUILD_ASSERT(DT_NODE_HAS_STATUS(GPIOTE_PHANDLE(id), okay),    \
      |                  ^~~~~~~~~~~~
/home/laci/projects/firmware-uhk/nrfconnect/zephyr/drivers/gpio/gpio_nrfx.c:454:9: note: in expansion of macro 'GPIOTE_CHECK'
  454 |         GPIOTE_CHECK(id);                                               \
      |         ^~~~~~~~~~~~
/home/laci/projects/firmware-uhk/uhk/device/build/uhk-d/zephyr/include/generated/devicetree_generated.h:10158:50: note: in expansion of macro 'GPIO_NRF_DEVICE'
10158 | #define DT_FOREACH_OKAY_INST_nordic_nrf_gpio(fn) fn(0)
      |                                                  ^~
/home/laci/projects/firmware-uhk/nrfconnect/zephyr/include/zephyr/sys/util_internal.h:105:36: note: in expansion of macro 'DT_FOREACH_OKAY_INST_nordic_nrf_gpio'
  105 | #define UTIL_PRIMITIVE_CAT(a, ...) a##__VA_ARGS__
      |                                    ^
/home/laci/projects/firmware-uhk/nrfconnect/zephyr/drivers/gpio/gpio_nrfx.c:476:1: note: in expansion of macro 'DT_INST_FOREACH_STATUS_OKAY'
  476 | DT_INST_FOREACH_STATUS_OKAY(GPIO_NRF_DEVICE)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
[216/334] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/gatt.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /home/laci/projects/ncs/toolchains/2be090971e/usr/local/bin/cmake --build /home/laci/projects/firmware-uhk/uhk/device/build/uhk-d

Thanks in advance!

Parents
  • Hello,

    Thank you everyone for your contribution for this case.

    In new version of NCS (V2.6.0), because of adding multi-instance GPIOTE support in nrfx, now the user needs to explicitly enable gpiote node in the board dts. We do it by default for Nordic DKs, but if customer is using custom board it needs to be done manually. 

  • Just one little note, in case of basing a custom board on the nrf52832.dtsi, there the gpiote device comes disabled by default and must be enabled in the custom dtsi or in a custom overlay file, as of version V2.6.0:

            gpiote: gpiote0: gpiote@40006000 {
                compatible = "nordic,nrf-gpiote";
                reg = <0x40006000 0x1000>;
                interrupts = <6 5>;
                status = "disabled";
                instance = <0>;
            };
Reply
  • Just one little note, in case of basing a custom board on the nrf52832.dtsi, there the gpiote device comes disabled by default and must be enabled in the custom dtsi or in a custom overlay file, as of version V2.6.0:

            gpiote: gpiote0: gpiote@40006000 {
                compatible = "nordic,nrf-gpiote";
                reg = <0x40006000 0x1000>;
                interrupts = <6 5>;
                status = "disabled";
                instance = <0>;
            };
Children
No Data
Related