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

Does USBD on Zephyr is supported with nrf5340 ?

Hi,

I running a custom application on nRF5340 PDK using zephyr (2.3.0) and nordic SDK (1.3.0).

I tried to build Zephyr HID examples and got an error. (I don't think it's application issue)

I checked in dtsi files if usbd is declared in the same way as nrf52840 and I don't find any reference to usb in zephyr/dts/arm/nordic/nrf5340_cpuapp.dtsi

I'm not able to find in Nordic Zephyr documentation if USB support is working with nRF5340/Zephyr ?

  1. Does USBD is supported with Zephyr/nRF5340 ?
  2. If yes, how to enable it ? (Point me on documentation or version)
  3. If no, when is it planned to get USB support ?

Thank you.

Parents
  • Hi!

    Yes, USBD is supported in Zephyr for the nRF5340. The developers tell me any sample in zephyr/samples/subsys/usb should work on the nRF5340.

    You will have to write an overlay file for the board, similar to what was done here.

    Best regards,

    Heidi

  • It does not work with SDK v1.3.0 (zephyr v2.3.0-rc1-ncs1) with samplezephyr/samples/subsys/usb/hid/:

    $west west build -b nrf5340pdk_nrf5340_cpuapp
    -- west build: generating a build system
    Including boilerplate (Zephyr base): /home/user/nrf/zephyr/cmake/app/boilerplate.cmake
    -- Application: /home/user/nrf/zephyr/samples/subsys/usb/hid
    -- Zephyr version: 2.3.0-rc1 (/home/user/nrf/zephyr)
    -- Found Python3: /usr/bin/python3.8 (found suitable exact version "3.8.3") found components: Interpreter 
    -- Board: nrf5340pdk_nrf5340_cpuapp
    ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
    -- Found toolchain: zephyr (/home/cgorand/zephyr-sdk)
    -- Found west: /home/cgorand/.local/bin/west (found suitable version "0.7.2", minimum required is "0.7.1")
    -- Found dtc: /home/cgorand/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
    -- Found BOARD.dts: /home/user/nrf/zephyr/boards/arm/nrf5340pdk_nrf5340/nrf5340pdk_nrf5340_cpuapp.dts
    nrf5340pdk_nrf5340_cpuapp.dts.pre.tmp:95.42-107.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@50000000/flash-controller@39000: duplicate unit-address (also used in node /soc/peripheral@50000000/kmu@39000)
    nrf5340pdk_nrf5340_cpuapp.dts.pre.tmp:369.19-375.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@50000000/clock@5000: duplicate unit-address (also used in node /soc/peripheral@50000000/power@5000)
    nrf5340pdk_nrf5340_cpuapp.dts.pre.tmp:616.31-617.5: Warning (unique_unit_address_if_enabled): /reserved-memory/image@20000000: duplicate unit-address (also used in node /reserved-memory/image_s@20000000)
    also defined at nrf5340pdk_nrf5340_cpuapp.dts.pre.tmp:636.14-638.3
    -- Generated zephyr.dts: /home/user/nrf/zephyr/samples/subsys/usb/hid/build/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: /home/user/nrf/zephyr/samples/subsys/usb/hid/build/zephyr/include/generated/devicetree_unfixed.h
    Parsing /home/user/nrf/zephyr/samples/subsys/usb/hid/Kconfig
    Loaded configuration '/home/user/nrf/zephyr/boards/arm/nrf5340pdk_nrf5340/nrf5340pdk_nrf5340_cpuapp_defconfig'
    Merged configuration '/home/user/nrf/zephyr/samples/subsys/usb/hid/prj.conf'
    Configuration saved to '/home/user/nrf/zephyr/samples/subsys/usb/hid/build/zephyr/.config'
    Kconfig header saved to '/home/user/nrf/zephyr/samples/subsys/usb/hid/build/zephyr/include/generated/autoconf.h'
    -- The C compiler identification is GNU 9.2.0
    -- The CXX compiler identification is GNU 9.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /home/cgorand/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Cache files will be written to: /home/cgorand/.cache/zephyr
    CMake Warning at ../../../../subsys/usb/CMakeLists.txt:28 (message):
    CONFIG_USB_DEVICE_VID has default value 0x2FE3.
    
    This value is only for testing and MUST be configured for USB products.
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/user/nrf/zephyr/samples/subsys/usb/hid/build
    -- west build: building application
    [1/145] Preparing syscall dependency handling
    
    [137/145] Building C object zephyr/CMakeFiles/zephyr.dir/drivers/clock_control/nrf_power_clock.c.obj
    FAILED: zephyr/CMakeFiles/zephyr.dir/drivers/clock_control/nrf_power_clock.c.obj 
    ccache /home/cgorand/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DBUILD_VERSION=v2.3.0-rc1-ncs1 -DKERNEL -DNRF5340_XXAA_APPLICATION -DUSE_PARTITION_MANAGER=0 -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZEPHYR__=1 -I../../../../../include -Izephyr/include/generated -I../../../../../soc/arm/nordic_nrf/nrf53 -I../../../../../subsys/usb -I/home/user/nrf/nrf/include -I/home/user/nrf/modules/hal/cmsis/CMSIS/Core/Include -I/home/user/nrf/modules/hal/nordic/nrfx -I/home/user/nrf/modules/hal/nordic/nrfx/drivers/include -I/home/user/nrf/modules/hal/nordic/nrfx/mdk -I/home/user/nrf/modules/hal/nordic/. -isystem ../../../../../lib/libc/minimal/include -isystem /home/cgorand/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/9.2.0/include -isystem /home/cgorand/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/9.2.0/include-fixed -Os -imacros/home/user/nrf/zephyr/samples/subsys/usb/hid/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -mcpu=cortex-m33 -mthumb -mabi=aapcs -imacros/home/user/nrf/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-address-of-packed-member -Wno-pointer-sign -Wpointer-arith -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=/home/user/nrf/zephyr/samples/subsys/usb/hid=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/user/nrf/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/user/nrf=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT zephyr/CMakeFiles/zephyr.dir/drivers/clock_control/nrf_power_clock.c.obj -MF zephyr/CMakeFiles/zephyr.dir/drivers/clock_control/nrf_power_clock.c.obj.d -o zephyr/CMakeFiles/zephyr.dir/drivers/clock_control/nrf_power_clock.c.obj -c /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c
    In file included from ../../../../../include/devicetree.h:35,
    from ../../../../../include/arch/arm/aarch32/arch.h:20,
    from ../../../../../include/arch/cpu.h:19,
    from ../../../../../include/irq.h:15,
    from /home/user/nrf/modules/hal/nordic/./nrfx_glue.h:37,
    from /home/user/nrf/modules/hal/nordic/nrfx/nrfx.h:37,
    from ../../../../../soc/arm/nordic_nrf/nrf53/soc.h:17,
    from /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c:8:
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c: In function 'clock_irqs_disable':
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c:85:6: error: 'NRF_POWER_INT_USBDETECTED_MASK' undeclared (first use in this function); did you mean 'NRF_POWER_INT_SLEEPENTER_MASK'?
    85 | (NRF_POWER_INT_USBDETECTED_MASK |
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../../../../include/sys/util.h:447:26: note: in definition of macro '__DEBRACKET'
    447 | #define __DEBRACKET(...) __VA_ARGS__
    | ^~~~~~~~~~~
    ../../../../../include/sys/util.h:444:2: note: in expansion of macro '__GET_ARG2_DEBRACKET'
    444 | __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
    | ^~~~~~~~~~~~~~~~~~~~
    ../../../../../include/sys/util.h:327:2: note: in expansion of macro '__COND_CODE'
    327 | __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
    | ^~~~~~~~~~~
    ../../../../../include/sys/util.h:324:2: note: in expansion of macro 'Z_COND_CODE_1'
    324 | Z_COND_CODE_1(_flag, _if_1_code, _else_code)
    | ^~~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c:84:5: note: in expansion of macro 'COND_CODE_1'
    84 | COND_CODE_1(CONFIG_USB_NRFX,
    | ^~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c:85:6: note: each undeclared identifier is reported only once for each function it appears in
    85 | (NRF_POWER_INT_USBDETECTED_MASK |
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../../../../include/sys/util.h:447:26: note: in definition of macro '__DEBRACKET'
    447 | #define __DEBRACKET(...) __VA_ARGS__
    | ^~~~~~~~~~~
    ../../../../../include/sys/util.h:444:2: note: in expansion of macro '__GET_ARG2_DEBRACKET'
    444 | __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
    | ^~~~~~~~~~~~~~~~~~~~
    ../../../../../include/sys/util.h:327:2: note: in expansion of macro '__COND_CODE'
    327 | __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
    | ^~~~~~~~~~~
    ../../../../../include/sys/util.h:324:2: note: in expansion of macro 'Z_COND_CODE_1'
    324 | Z_COND_CODE_1(_flag, _if_1_code, _else_code)
    | ^~~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c:84:5: note: in expansion of macro 'COND_CODE_1'
    84 | COND_CODE_1(CONFIG_USB_NRFX,
    | ^~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c:86:6: error: 'NRF_POWER_INT_USBREMOVED_MASK' undeclared (first use in this function); did you mean 'NRF_POWER_INT_SLEEPEXIT_MASK'?
    86 | NRF_POWER_INT_USBREMOVED_MASK |
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../../../../include/sys/util.h:447:26: note: in definition of macro '__DEBRACKET'
    447 | #define __DEBRACKET(...) __VA_ARGS__
    | ^~~~~~~~~~~
    ../../../../../include/sys/util.h:444:2: note: in expansion of macro '__GET_ARG2_DEBRACKET'
    444 | __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
    | ^~~~~~~~~~~~~~~~~~~~
    ../../../../../include/sys/util.h:327:2: note: in expansion of macro '__COND_CODE'
    327 | __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
    | ^~~~~~~~~~~
    ../../../../../include/sys/util.h:324:2: note: in expansion of macro 'Z_COND_CODE_1'
    324 | Z_COND_CODE_1(_flag, _if_1_code, _else_code)
    | ^~~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c:84:5: note: in expansion of macro 'COND_CODE_1'
    84 | COND_CODE_1(CONFIG_USB_NRFX,
    | ^~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c:87:6: error: 'NRF_POWER_INT_USBPWRRDY_MASK' undeclared (first use in this function); did you mean 'NRF_POWER_INT_POFWARN_MASK'?
    87 | NRF_POWER_INT_USBPWRRDY_MASK),
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../../../../include/sys/util.h:447:26: note: in definition of macro '__DEBRACKET'
    447 | #define __DEBRACKET(...) __VA_ARGS__
    | ^~~~~~~~~~~
    ../../../../../include/sys/util.h:444:2: note: in expansion of macro '__GET_ARG2_DEBRACKET'
    444 | __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
    | ^~~~~~~~~~~~~~~~~~~~
    ../../../../../include/sys/util.h:327:2: note: in expansion of macro '__COND_CODE'
    327 | __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
    | ^~~~~~~~~~~
    ../../../../../include/sys/util.h:324:2: note: in expansion of macro 'Z_COND_CODE_1'
    324 | Z_COND_CODE_1(_flag, _if_1_code, _else_code)
    | ^~~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c:84:5: note: in expansion of macro 'COND_CODE_1'
    84 | COND_CODE_1(CONFIG_USB_NRFX,
    | ^~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c: In function 'clock_irqs_enable':
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c:97:6: error: 'NRF_POWER_INT_USBDETECTED_MASK' undeclared (first use in this function); did you mean 'NRF_POWER_INT_SLEEPENTER_MASK'?
    97 | (NRF_POWER_INT_USBDETECTED_MASK |
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../../../../include/sys/util.h:447:26: note: in definition of macro '__DEBRACKET'
    447 | #define __DEBRACKET(...) __VA_ARGS__
    | ^~~~~~~~~~~
    ../../../../../include/sys/util.h:444:2: note: in expansion of macro '__GET_ARG2_DEBRACKET'
    444 | __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
    | ^~~~~~~~~~~~~~~~~~~~
    ../../../../../include/sys/util.h:327:2: note: in expansion of macro '__COND_CODE'
    327 | __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
    | ^~~~~~~~~~~
    ../../../../../include/sys/util.h:324:2: note: in expansion of macro 'Z_COND_CODE_1'
    324 | Z_COND_CODE_1(_flag, _if_1_code, _else_code)
    | ^~~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c:96:5: note: in expansion of macro 'COND_CODE_1'
    96 | COND_CODE_1(CONFIG_USB_NRFX,
    | ^~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c:98:6: error: 'NRF_POWER_INT_USBREMOVED_MASK' undeclared (first use in this function); did you mean 'NRF_POWER_INT_SLEEPEXIT_MASK'?
    98 | NRF_POWER_INT_USBREMOVED_MASK |
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../../../../include/sys/util.h:447:26: note: in definition of macro '__DEBRACKET'
    447 | #define __DEBRACKET(...) __VA_ARGS__
    | ^~~~~~~~~~~
    ../../../../../include/sys/util.h:444:2: note: in expansion of macro '__GET_ARG2_DEBRACKET'
    444 | __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
    | ^~~~~~~~~~~~~~~~~~~~
    ../../../../../include/sys/util.h:327:2: note: in expansion of macro '__COND_CODE'
    327 | __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
    | ^~~~~~~~~~~
    ../../../../../include/sys/util.h:324:2: note: in expansion of macro 'Z_COND_CODE_1'
    324 | Z_COND_CODE_1(_flag, _if_1_code, _else_code)
    | ^~~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c:96:5: note: in expansion of macro 'COND_CODE_1'
    96 | COND_CODE_1(CONFIG_USB_NRFX,
    | ^~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c:99:6: error: 'NRF_POWER_INT_USBPWRRDY_MASK' undeclared (first use in this function); did you mean 'NRF_POWER_INT_POFWARN_MASK'?
    99 | NRF_POWER_INT_USBPWRRDY_MASK),
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../../../../include/sys/util.h:447:26: note: in definition of macro '__DEBRACKET'
    447 | #define __DEBRACKET(...) __VA_ARGS__
    | ^~~~~~~~~~~
    ../../../../../include/sys/util.h:444:2: note: in expansion of macro '__GET_ARG2_DEBRACKET'
    444 | __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
    | ^~~~~~~~~~~~~~~~~~~~
    ../../../../../include/sys/util.h:327:2: note: in expansion of macro '__COND_CODE'
    327 | __COND_CODE(_XXXX##_flag, _if_1_code, _else_code)
    | ^~~~~~~~~~~
    ../../../../../include/sys/util.h:324:2: note: in expansion of macro 'Z_COND_CODE_1'
    324 | Z_COND_CODE_1(_flag, _if_1_code, _else_code)
    | ^~~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c:96:5: note: in expansion of macro 'COND_CODE_1'
    96 | COND_CODE_1(CONFIG_USB_NRFX,
    | ^~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c: In function 'usb_power_isr':
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c:390:34: error: 'NRF_POWER_EVENT_USBDETECTED' undeclared (first use in this function); did you mean 'NRF_POWER_EVENT_SLEEPENTER'?
    390 | if (power_event_check_and_clean(NRF_POWER_EVENT_USBDETECTED,
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    | NRF_POWER_EVENT_SLEEPENTER
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c:391:6: error: 'NRF_POWER_INT_USBDETECTED_MASK' undeclared (first use in this function); did you mean 'NRF_POWER_INT_SLEEPENTER_MASK'?
    391 | NRF_POWER_INT_USBDETECTED_MASK)) {
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    | NRF_POWER_INT_SLEEPENTER_MASK
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c:395:34: error: 'NRF_POWER_EVENT_USBPWRRDY' undeclared (first use in this function); did you mean 'NRF_POWER_EVENT_POFWARN'?
    395 | if (power_event_check_and_clean(NRF_POWER_EVENT_USBPWRRDY,
    | ^~~~~~~~~~~~~~~~~~~~~~~~~
    | NRF_POWER_EVENT_POFWARN
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c:396:6: error: 'NRF_POWER_INT_USBPWRRDY_MASK' undeclared (first use in this function); did you mean 'NRF_POWER_INT_POFWARN_MASK'?
    396 | NRF_POWER_INT_USBPWRRDY_MASK)) {
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    | NRF_POWER_INT_POFWARN_MASK
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c:400:34: error: 'NRF_POWER_EVENT_USBREMOVED' undeclared (first use in this function); did you mean 'NRF_POWER_EVENT_SLEEPEXIT'?
    400 | if (power_event_check_and_clean(NRF_POWER_EVENT_USBREMOVED,
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~
    | NRF_POWER_EVENT_SLEEPEXIT
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c:401:6: error: 'NRF_POWER_INT_USBREMOVED_MASK' undeclared (first use in this function); did you mean 'NRF_POWER_INT_SLEEPEXIT_MASK'?
    401 | NRF_POWER_INT_USBREMOVED_MASK)) {
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    | NRF_POWER_INT_SLEEPEXIT_MASK
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c: In function 'nrf5_power_usb_power_int_enable':
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c:446:9: error: 'NRF_POWER_INT_USBDETECTED_MASK' undeclared (first use in this function); did you mean 'NRF_POWER_INT_SLEEPENTER_MASK'?
    446 | mask = NRF_POWER_INT_USBDETECTED_MASK |
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    | NRF_POWER_INT_SLEEPENTER_MASK
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c:447:9: error: 'NRF_POWER_INT_USBREMOVED_MASK' undeclared (first use in this function); did you mean 'NRF_POWER_INT_SLEEPEXIT_MASK'?
    447 | NRF_POWER_INT_USBREMOVED_MASK |
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    | NRF_POWER_INT_SLEEPEXIT_MASK
    /home/user/nrf/zephyr/drivers/clock_control/nrf_power_clock.c:448:9: error: 'NRF_POWER_INT_USBPWRRDY_MASK' undeclared (first use in this function); did you mean 'NRF_POWER_INT_POFWARN_MASK'?
    448 | NRF_POWER_INT_USBPWRRDY_MASK;
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    | NRF_POWER_INT_POFWARN_MASK
    [138/145] Building C object zephyr/CMakeFiles/zephyr.dir/drivers/usb/device/usb_dc_nrfx.c.obj
    FAILED: zephyr/CMakeFiles/zephyr.dir/drivers/usb/device/usb_dc_nrfx.c.obj 
    ccache /home/cgorand/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DBUILD_VERSION=v2.3.0-rc1-ncs1 -DKERNEL -DNRF5340_XXAA_APPLICATION -DUSE_PARTITION_MANAGER=0 -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZEPHYR__=1 -I../../../../../include -Izephyr/include/generated -I../../../../../soc/arm/nordic_nrf/nrf53 -I../../../../../subsys/usb -I/home/user/nrf/nrf/include -I/home/user/nrf/modules/hal/cmsis/CMSIS/Core/Include -I/home/user/nrf/modules/hal/nordic/nrfx -I/home/user/nrf/modules/hal/nordic/nrfx/drivers/include -I/home/user/nrf/modules/hal/nordic/nrfx/mdk -I/home/user/nrf/modules/hal/nordic/. -isystem ../../../../../lib/libc/minimal/include -isystem /home/cgorand/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/9.2.0/include -isystem /home/cgorand/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/9.2.0/include-fixed -Os -imacros/home/user/nrf/zephyr/samples/subsys/usb/hid/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -mcpu=cortex-m33 -mthumb -mabi=aapcs -imacros/home/user/nrf/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-address-of-packed-member -Wno-pointer-sign -Wpointer-arith -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=/home/user/nrf/zephyr/samples/subsys/usb/hid=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/user/nrf/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/user/nrf=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT zephyr/CMakeFiles/zephyr.dir/drivers/usb/device/usb_dc_nrfx.c.obj -MF zephyr/CMakeFiles/zephyr.dir/drivers/usb/device/usb_dc_nrfx.c.obj.d -o zephyr/CMakeFiles/zephyr.dir/drivers/usb/device/usb_dc_nrfx.c.obj -c /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c
    In file included from /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:19:
    ../../../../../include/devicetree.h:297:40: error: 'DT_N_INST_0_nordic_nrf_usbd_P_num_in_endpoints' undeclared here (not in a function)
    297 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
    | ^~~~~~~~~
    ../../../../../include/kernel.h:4666:46: note: in definition of macro 'K_HEAP_DEFINE'
    4666 | char __aligned(sizeof(void *)) kheap_##name[bytes]; \
    | ^~~~~
    ../../../../../include/kernel.h:4702:2: note: in expansion of macro 'Z_MEM_POOL_DEFINE'
    4702 | Z_MEM_POOL_DEFINE(name, minsz, maxsz, nmax, align)
    | ^~~~~~~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:237:1: note: in expansion of macro 'K_MEM_POOL_DEFINE'
    237 | K_MEM_POOL_DEFINE(ep_buf_pool, EP_BUF_POOL_BLOCK_MIN_SZ,
    | ^~~~~~~~~~~~~~~~~
    ../../../../../include/devicetree.h:393:32: note: in expansion of macro 'DT_CAT'
    393 | #define DT_PROP(node_id, prop) DT_CAT(node_id, _P_##prop)
    | ^~~~~~
    ../../../../../include/devicetree.h:1368:34: note: in expansion of macro 'DT_PROP'
    1368 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
    | ^~~~~~~
    ../../../../../include/sys/util.h:509:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
    509 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
    | ^~~~~~~~~~~~~~~~~~
    ../../../../../include/devicetree.h:297:31: note: in expansion of macro 'UTIL_CAT'
    297 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
    | ^~~~~~~~
    ../../../../../include/devicetree.h:1346:27: note: in expansion of macro 'DT_INST'
    1346 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
    | ^~~~~~~
    ../../../../../include/devicetree.h:1368:42: note: in expansion of macro 'DT_DRV_INST'
    1368 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
    | ^~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:190:23: note: in expansion of macro 'DT_INST_PROP'
    190 | #define CFG_EPIN_CNT (DT_INST_PROP(0, num_in_endpoints) + \
    | ^~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:225:24: note: in expansion of macro 'CFG_EPIN_CNT'
    225 | #define EP_BUF_TOTAL ((CFG_EPIN_CNT * EP_BUF_MAX_SZ) + \
    | ^~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:231:35: note: in expansion of macro 'EP_BUF_TOTAL'
    231 | #define EP_BUF_POOL_BLOCK_COUNT ((EP_BUF_TOTAL / EP_BUF_POOL_BLOCK_MAX_SZ) + \
    | ^~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:238:31: note: in expansion of macro 'EP_BUF_POOL_BLOCK_COUNT'
    238 | EP_BUF_POOL_BLOCK_MAX_SZ, EP_BUF_POOL_BLOCK_COUNT,
    | ^~~~~~~~~~~~~~~~~~~~~~~
    ../../../../../include/devicetree.h:297:40: error: 'DT_N_INST_0_nordic_nrf_usbd_P_num_bidir_endpoints' undeclared here (not in a function)
    297 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
    | ^~~~~~~~~
    ../../../../../include/kernel.h:4666:46: note: in definition of macro 'K_HEAP_DEFINE'
    4666 | char __aligned(sizeof(void *)) kheap_##name[bytes]; \
    | ^~~~~
    ../../../../../include/kernel.h:4702:2: note: in expansion of macro 'Z_MEM_POOL_DEFINE'
    4702 | Z_MEM_POOL_DEFINE(name, minsz, maxsz, nmax, align)
    | ^~~~~~~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:237:1: note: in expansion of macro 'K_MEM_POOL_DEFINE'
    237 | K_MEM_POOL_DEFINE(ep_buf_pool, EP_BUF_POOL_BLOCK_MIN_SZ,
    | ^~~~~~~~~~~~~~~~~
    ../../../../../include/devicetree.h:393:32: note: in expansion of macro 'DT_CAT'
    393 | #define DT_PROP(node_id, prop) DT_CAT(node_id, _P_##prop)
    | ^~~~~~
    ../../../../../include/devicetree.h:1368:34: note: in expansion of macro 'DT_PROP'
    1368 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
    | ^~~~~~~
    ../../../../../include/sys/util.h:509:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
    509 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
    | ^~~~~~~~~~~~~~~~~~
    ../../../../../include/devicetree.h:297:31: note: in expansion of macro 'UTIL_CAT'
    297 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
    | ^~~~~~~~
    ../../../../../include/devicetree.h:1346:27: note: in expansion of macro 'DT_INST'
    1346 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
    | ^~~~~~~
    ../../../../../include/devicetree.h:1368:42: note: in expansion of macro 'DT_DRV_INST'
    1368 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
    | ^~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:191:9: note: in expansion of macro 'DT_INST_PROP'
    191 | DT_INST_PROP(0, num_bidir_endpoints))
    | ^~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:225:24: note: in expansion of macro 'CFG_EPIN_CNT'
    225 | #define EP_BUF_TOTAL ((CFG_EPIN_CNT * EP_BUF_MAX_SZ) + \
    | ^~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:231:35: note: in expansion of macro 'EP_BUF_TOTAL'
    231 | #define EP_BUF_POOL_BLOCK_COUNT ((EP_BUF_TOTAL / EP_BUF_POOL_BLOCK_MAX_SZ) + \
    | ^~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:238:31: note: in expansion of macro 'EP_BUF_POOL_BLOCK_COUNT'
    238 | EP_BUF_POOL_BLOCK_MAX_SZ, EP_BUF_POOL_BLOCK_COUNT,
    | ^~~~~~~~~~~~~~~~~~~~~~~
    ../../../../../include/devicetree.h:297:40: error: 'DT_N_INST_0_nordic_nrf_usbd_P_num_out_endpoints' undeclared here (not in a function)
    297 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
    | ^~~~~~~~~
    ../../../../../include/kernel.h:4666:46: note: in definition of macro 'K_HEAP_DEFINE'
    4666 | char __aligned(sizeof(void *)) kheap_##name[bytes]; \
    | ^~~~~
    ../../../../../include/kernel.h:4702:2: note: in expansion of macro 'Z_MEM_POOL_DEFINE'
    4702 | Z_MEM_POOL_DEFINE(name, minsz, maxsz, nmax, align)
    | ^~~~~~~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:237:1: note: in expansion of macro 'K_MEM_POOL_DEFINE'
    237 | K_MEM_POOL_DEFINE(ep_buf_pool, EP_BUF_POOL_BLOCK_MIN_SZ,
    | ^~~~~~~~~~~~~~~~~
    ../../../../../include/devicetree.h:393:32: note: in expansion of macro 'DT_CAT'
    393 | #define DT_PROP(node_id, prop) DT_CAT(node_id, _P_##prop)
    | ^~~~~~
    ../../../../../include/devicetree.h:1368:34: note: in expansion of macro 'DT_PROP'
    1368 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
    | ^~~~~~~
    ../../../../../include/sys/util.h:509:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
    509 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
    | ^~~~~~~~~~~~~~~~~~
    ../../../../../include/devicetree.h:297:31: note: in expansion of macro 'UTIL_CAT'
    297 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
    | ^~~~~~~~
    ../../../../../include/devicetree.h:1346:27: note: in expansion of macro 'DT_INST'
    1346 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
    | ^~~~~~~
    ../../../../../include/devicetree.h:1368:42: note: in expansion of macro 'DT_DRV_INST'
    1368 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
    | ^~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:194:24: note: in expansion of macro 'DT_INST_PROP'
    194 | #define CFG_EPOUT_CNT (DT_INST_PROP(0, num_out_endpoints) + \
    | ^~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:226:10: note: in expansion of macro 'CFG_EPOUT_CNT'
    226 | (CFG_EPOUT_CNT * EP_BUF_MAX_SZ) + \
    | ^~~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:231:35: note: in expansion of macro 'EP_BUF_TOTAL'
    231 | #define EP_BUF_POOL_BLOCK_COUNT ((EP_BUF_TOTAL / EP_BUF_POOL_BLOCK_MAX_SZ) + \
    | ^~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:238:31: note: in expansion of macro 'EP_BUF_POOL_BLOCK_COUNT'
    238 | EP_BUF_POOL_BLOCK_MAX_SZ, EP_BUF_POOL_BLOCK_COUNT,
    | ^~~~~~~~~~~~~~~~~~~~~~~
    ../../../../../include/devicetree.h:297:40: error: 'DT_N_INST_0_nordic_nrf_usbd_P_num_isoin_endpoints' undeclared here (not in a function)
    297 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
    | ^~~~~~~~~
    ../../../../../include/kernel.h:4666:46: note: in definition of macro 'K_HEAP_DEFINE'
    4666 | char __aligned(sizeof(void *)) kheap_##name[bytes]; \
    | ^~~~~
    ../../../../../include/kernel.h:4702:2: note: in expansion of macro 'Z_MEM_POOL_DEFINE'
    4702 | Z_MEM_POOL_DEFINE(name, minsz, maxsz, nmax, align)
    | ^~~~~~~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:237:1: note: in expansion of macro 'K_MEM_POOL_DEFINE'
    237 | K_MEM_POOL_DEFINE(ep_buf_pool, EP_BUF_POOL_BLOCK_MIN_SZ,
    | ^~~~~~~~~~~~~~~~~
    ../../../../../include/devicetree.h:393:32: note: in expansion of macro 'DT_CAT'
    393 | #define DT_PROP(node_id, prop) DT_CAT(node_id, _P_##prop)
    | ^~~~~~
    ../../../../../include/devicetree.h:1368:34: note: in expansion of macro 'DT_PROP'
    1368 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
    | ^~~~~~~
    ../../../../../include/sys/util.h:509:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
    509 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
    | ^~~~~~~~~~~~~~~~~~
    ../../../../../include/devicetree.h:297:31: note: in expansion of macro 'UTIL_CAT'
    297 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
    | ^~~~~~~~
    ../../../../../include/devicetree.h:1346:27: note: in expansion of macro 'DT_INST'
    1346 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
    | ^~~~~~~
    ../../../../../include/devicetree.h:1368:42: note: in expansion of macro 'DT_DRV_INST'
    1368 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
    | ^~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:198:26: note: in expansion of macro 'DT_INST_PROP'
    198 | #define CFG_EP_ISOIN_CNT DT_INST_PROP(0, num_isoin_endpoints)
    | ^~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:227:10: note: in expansion of macro 'CFG_EP_ISOIN_CNT'
    227 | (CFG_EP_ISOIN_CNT * ISO_EP_BUF_MAX_SZ) + \
    | ^~~~~~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:231:35: note: in expansion of macro 'EP_BUF_TOTAL'
    231 | #define EP_BUF_POOL_BLOCK_COUNT ((EP_BUF_TOTAL / EP_BUF_POOL_BLOCK_MAX_SZ) + \
    | ^~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:238:31: note: in expansion of macro 'EP_BUF_POOL_BLOCK_COUNT'
    238 | EP_BUF_POOL_BLOCK_MAX_SZ, EP_BUF_POOL_BLOCK_COUNT,
    | ^~~~~~~~~~~~~~~~~~~~~~~
    ../../../../../include/devicetree.h:297:40: error: 'DT_N_INST_0_nordic_nrf_usbd_P_num_isoout_endpoints' undeclared here (not in a function)
    297 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
    | ^~~~~~~~~
    ../../../../../include/kernel.h:4666:46: note: in definition of macro 'K_HEAP_DEFINE'
    4666 | char __aligned(sizeof(void *)) kheap_##name[bytes]; \
    | ^~~~~
    ../../../../../include/kernel.h:4702:2: note: in expansion of macro 'Z_MEM_POOL_DEFINE'
    4702 | Z_MEM_POOL_DEFINE(name, minsz, maxsz, nmax, align)
    | ^~~~~~~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:237:1: note: in expansion of macro 'K_MEM_POOL_DEFINE'
    237 | K_MEM_POOL_DEFINE(ep_buf_pool, EP_BUF_POOL_BLOCK_MIN_SZ,
    | ^~~~~~~~~~~~~~~~~
    ../../../../../include/devicetree.h:393:32: note: in expansion of macro 'DT_CAT'
    393 | #define DT_PROP(node_id, prop) DT_CAT(node_id, _P_##prop)
    | ^~~~~~
    ../../../../../include/devicetree.h:1368:34: note: in expansion of macro 'DT_PROP'
    1368 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
    | ^~~~~~~
    ../../../../../include/sys/util.h:509:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
    509 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
    | ^~~~~~~~~~~~~~~~~~
    ../../../../../include/devicetree.h:297:31: note: in expansion of macro 'UTIL_CAT'
    297 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
    | ^~~~~~~~
    ../../../../../include/devicetree.h:1346:27: note: in expansion of macro 'DT_INST'
    1346 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
    | ^~~~~~~
    ../../../../../include/devicetree.h:1368:42: note: in expansion of macro 'DT_DRV_INST'
    1368 | #define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
    | ^~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:201:27: note: in expansion of macro 'DT_INST_PROP'
    201 | #define CFG_EP_ISOOUT_CNT DT_INST_PROP(0, num_isoout_endpoints)
    | ^~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:228:10: note: in expansion of macro 'CFG_EP_ISOOUT_CNT'
    228 | (CFG_EP_ISOOUT_CNT * ISO_EP_BUF_MAX_SZ))
    | ^~~~~~~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:231:35: note: in expansion of macro 'EP_BUF_TOTAL'
    231 | #define EP_BUF_POOL_BLOCK_COUNT ((EP_BUF_TOTAL / EP_BUF_POOL_BLOCK_MAX_SZ) + \
    | ^~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:238:31: note: in expansion of macro 'EP_BUF_POOL_BLOCK_COUNT'
    238 | EP_BUF_POOL_BLOCK_MAX_SZ, EP_BUF_POOL_BLOCK_COUNT,
    | ^~~~~~~~~~~~~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c: In function 'usb_dc_nrfx_power_event_callback':
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:495:7: error: 'NRF_POWER_EVENT_USBDETECTED' undeclared (first use in this function); did you mean 'NRF_POWER_EVENT_SLEEPENTER'?
    495 | case NRF_POWER_EVENT_USBDETECTED:
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    | NRF_POWER_EVENT_SLEEPENTER
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:495:7: note: each undeclared identifier is reported only once for each function it appears in
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:498:7: error: 'NRF_POWER_EVENT_USBPWRRDY' undeclared (first use in this function); did you mean 'NRF_POWER_EVENT_POFWARN'?
    498 | case NRF_POWER_EVENT_USBPWRRDY:
    | ^~~~~~~~~~~~~~~~~~~~~~~~~
    | NRF_POWER_EVENT_POFWARN
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:501:7: error: 'NRF_POWER_EVENT_USBREMOVED' undeclared (first use in this function); did you mean 'NRF_POWER_EVENT_SLEEPEXIT'?
    501 | case NRF_POWER_EVENT_USBREMOVED:
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~
    | NRF_POWER_EVENT_SLEEPEXIT
    In file included from ../../../../../include/arch/arm/aarch32/irq.h:20,
    from ../../../../../include/arch/arm/aarch32/arch.h:27,
    from ../../../../../include/arch/cpu.h:19,
    from ../../../../../include/irq.h:15,
    from /home/user/nrf/modules/hal/nordic/./nrfx_glue.h:37,
    from /home/user/nrf/modules/hal/nordic/nrfx/nrfx.h:37,
    from ../../../../../soc/arm/nordic_nrf/nrf53/soc.h:17,
    from /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:16:
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c: In function 'usb_dc_attach':
    ../../../../../include/devicetree.h:297:40: error: 'DT_N_INST_0_nordic_nrf_usbd_IRQ_IDX_0_VAL_irq' undeclared (first use in this function)
    297 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
    | ^~~~~~~~~
    ../../../../../include/sw_isr_table.h:71:5: note: in definition of macro 'Z_ISR_DECLARE'
    71 | {irq, flags, (void *)&func, (void *)param}
    | ^~~
    ../../../../../include/irq.h:49:2: note: in expansion of macro 'ARCH_IRQ_CONNECT'
    49 | ARCH_IRQ_CONNECT(irq_p, priority_p, isr_p, isr_param_p, flags_p)
    | ^~~~~~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:1367:2: note: in expansion of macro 'IRQ_CONNECT'
    1367 | IRQ_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority),
    | ^~~~~~~~~~~
    ../../../../../include/devicetree.h:972:2: note: in expansion of macro 'DT_CAT'
    972 | DT_CAT(node_id, _IRQ_IDX_##idx##_VAL_##cell)
    | ^~~~~~
    ../../../../../include/devicetree.h:1564:2: note: in expansion of macro 'DT_IRQ_BY_IDX'
    1564 | DT_IRQ_BY_IDX(DT_DRV_INST(inst), idx, cell)
    | ^~~~~~~~~~~~~
    ../../../../../include/sys/util.h:509:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
    509 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
    | ^~~~~~~~~~~~~~~~~~
    ../../../../../include/devicetree.h:297:31: note: in expansion of macro 'UTIL_CAT'
    297 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
    | ^~~~~~~~
    ../../../../../include/devicetree.h:1346:27: note: in expansion of macro 'DT_INST'
    1346 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
    | ^~~~~~~
    ../../../../../include/devicetree.h:1564:16: note: in expansion of macro 'DT_DRV_INST'
    1564 | DT_IRQ_BY_IDX(DT_DRV_INST(inst), idx, cell)
    | ^~~~~~~~~~~
    ../../../../../include/devicetree.h:1582:33: note: in expansion of macro 'DT_INST_IRQ_BY_IDX'
    1582 | #define DT_INST_IRQ(inst, cell) DT_INST_IRQ_BY_IDX(inst, 0, cell)
    | ^~~~~~~~~~~~~~~~~~
    ../../../../../include/devicetree.h:1589:28: note: in expansion of macro 'DT_INST_IRQ'
    1589 | #define DT_INST_IRQN(inst) DT_INST_IRQ(inst, irq)
    | ^~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:1367:14: note: in expansion of macro 'DT_INST_IRQN'
    1367 | IRQ_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority),
    | ^~~~~~~~~~~~
    In file included from ../../../../../include/arch/arm/aarch32/arch.h:27,
    from ../../../../../include/arch/cpu.h:19,
    from ../../../../../include/irq.h:15,
    from /home/user/nrf/modules/hal/nordic/./nrfx_glue.h:37,
    from /home/user/nrf/modules/hal/nordic/nrfx/nrfx.h:37,
    from ../../../../../soc/arm/nordic_nrf/nrf53/soc.h:17,
    from /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:16:
    ../../../../../include/devicetree.h:297:40: error: 'DT_N_INST_0_nordic_nrf_usbd_IRQ_IDX_0_VAL_priority' undeclared (first use in this function)
    297 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
    | ^~~~~~~~~
    ../../../../../include/arch/arm/aarch32/irq.h:111:32: note: in definition of macro 'ARCH_IRQ_CONNECT'
    111 | z_arm_irq_priority_set(irq_p, priority_p, flags_p); \
    | ^~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:1367:2: note: in expansion of macro 'IRQ_CONNECT'
    1367 | IRQ_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority),
    | ^~~~~~~~~~~
    ../../../../../include/devicetree.h:972:2: note: in expansion of macro 'DT_CAT'
    972 | DT_CAT(node_id, _IRQ_IDX_##idx##_VAL_##cell)
    | ^~~~~~
    ../../../../../include/devicetree.h:1564:2: note: in expansion of macro 'DT_IRQ_BY_IDX'
    1564 | DT_IRQ_BY_IDX(DT_DRV_INST(inst), idx, cell)
    | ^~~~~~~~~~~~~
    ../../../../../include/sys/util.h:509:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
    509 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
    | ^~~~~~~~~~~~~~~~~~
    ../../../../../include/devicetree.h:297:31: note: in expansion of macro 'UTIL_CAT'
    297 | #define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
    | ^~~~~~~~
    ../../../../../include/devicetree.h:1346:27: note: in expansion of macro 'DT_INST'
    1346 | #define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
    | ^~~~~~~
    ../../../../../include/devicetree.h:1564:16: note: in expansion of macro 'DT_DRV_INST'
    1564 | DT_IRQ_BY_IDX(DT_DRV_INST(inst), idx, cell)
    | ^~~~~~~~~~~
    ../../../../../include/devicetree.h:1582:33: note: in expansion of macro 'DT_INST_IRQ_BY_IDX'
    1582 | #define DT_INST_IRQ(inst, cell) DT_INST_IRQ_BY_IDX(inst, 0, cell)
    | ^~~~~~~~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:1367:31: note: in expansion of macro 'DT_INST_IRQ'
    1367 | IRQ_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority),
    | ^~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:1387:6: warning: implicit declaration of function 'nrf_power_usbregstatus_vbusdet_get' [-Wimplicit-function-declaration]
    1387 | if (nrf_power_usbregstatus_vbusdet_get(NRF_POWER)) {
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/user/nrf/zephyr/drivers/usb/device/usb_dc_nrfx.c:1395:36: error: 'NRF_POWER_EVENT_USBDETECTED' undeclared (first use in this function); did you mean 'NRF_POWER_EVENT_SLEEPENTER'?
    1395 | usb_dc_nrfx_power_event_callback(NRF_POWER_EVENT_USBDETECTED);
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    | NRF_POWER_EVENT_SLEEPENTER
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: /usr/bin/cmake --build /home/user/nrf/zephyr/samples/subsys/usb/hid/build

  • Hi , you asked but to put overlay file in private, but it's the sample code built with the preview default overlay file : nrf5340pdk_nrf5340_cpuapp. This is what I'm asking does it work with PDK board at least ?

    (NOTE : I used the insert code function, but it seems not working)

  • Hi! Sorry about the confusion, I was misinformed when I wrote my initial comment.

    We do not have USB support for nRF5340DK in the NCS repos yet. We are working on it, and it will most likely be ready for the 2.4.0 release of our Zephyr repo. 

    However, if you take a look at Zephyr upstream release 2.4.0 there is support for USB on nRF5340 (this dtsi file has declared usdb). So you can either build and run the sample from this repository, or attempt to port the relevant changes to NCS. 

    Best regards,

    Heidi

Reply Children
Related