This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

compilation error in nrf_drv_usbd.c

I have recently upgraded FTD code which was based on nrf sdk for thread and zigbee v2.0.0 to nrf sdk for thread and zigbee v4.0.0

On compiling the FTD I am having the following error..

Compiling file: nrf_drv_usbd.c
../../../../../nrf_sdk_thread/components/drivers_nrf/usbd/nrf_drv_usbd.c: In function 'usbd_ep_iso_capacity':
../../../../../nrf_sdk_thread/components/drivers_nrf/usbd/nrf_drv_usbd.c:1387:9: error: 'NRF_USBD_ISOSPLIT_Half' undeclared (first use in this function)
     if (NRF_USBD_ISOSPLIT_Half == split)
         ^~~~~~~~~~~~~~~~~~~~~~
../../../../../nrf_sdk_thread/components/drivers_nrf/usbd/nrf_drv_usbd.c:1387:9: note: each undeclared identifier is reported only once for each function it appears in
../../../../../nrf_sdk_thread/components/drivers_nrf/usbd/nrf_drv_usbd.c: In function 'nrf_drv_usbd_enable':
../../../../../nrf_sdk_thread/components/drivers_nrf/usbd/nrf_drv_usbd.c:1849:27: error: 'NRF_USBD_ISOSPLIT_Half' undeclared (first use in this function)
     nrf_usbd_isosplit_set(NRF_USBD_ISOSPLIT_Half);
                           ^~~~~~~~~~~~~~~~~~~~~~

Please suggest what can be done.

Parents Reply Children
  • once i remove nrf_drv_usbd.c, and add modules/nrfx/drivers/src/nrfx_usbd.c it has following compilation errors.

    Compiling file: nrfx_usbd.c
    Linking target: _build/nrf52840_xxaa.out
    _build/nrf52840_xxaa/app_usbd.c.o: In function `app_usbd_init':
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:830: undefined reference to `nrfx_usbd_init'
    _build/nrf52840_xxaa/app_usbd.c.o: In function `nrf_drv_usbd_uninit':
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/integration/nrfx/legacy/nrf_drv_usbd.h:263: undefined reference to `nrfx_usbd_uninit'
    _build/nrf52840_xxaa/app_usbd.c.o: In function `app_usbd_init':
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:845: undefined reference to `app_usbd_core_inst'
    _build/nrf52840_xxaa/app_usbd.c.o: In function `nrf_drv_usbd_uninit':
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/integration/nrfx/legacy/nrf_drv_usbd.h:263: undefined reference to `nrfx_usbd_uninit'
    _build/nrf52840_xxaa/app_usbd.c.o: In function `app_usbd_power_events_enable':
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:949: undefined reference to `nrfx_usbd_is_initialized'
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:949: undefined reference to `nrfx_usbd_is_enabled'
    _build/nrf52840_xxaa/app_usbd.c.o: In function `app_usbd_enable':
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:972: undefined reference to `nrfx_usbd_enable'
    _build/nrf52840_xxaa/app_usbd.c.o: In function `app_usbd_disable':
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:979: undefined reference to `nrfx_usbd_disable'
    _build/nrf52840_xxaa/app_usbd.c.o: In function `app_usbd_event_execute':
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:1141: undefined reference to `nrfx_usbd_suspend'
    _build/nrf52840_xxaa/app_usbd.c.o: In function `sustate_set':
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:736: undefined reference to `nrfx_usbd_suspend_irq_config'
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:732: undefined reference to `nrfx_usbd_active_irq_config'
    _build/nrf52840_xxaa/app_usbd.c.o: In function `app_usbd_ep_disable':
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:1721: undefined reference to `nrfx_usbd_ep_disable'
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:1721: undefined reference to `nrfx_usbd_ep_disable'
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:1721: undefined reference to `nrfx_usbd_ep_disable'
    _build/nrf52840_xxaa/app_usbd.c.o: In function `app_usbd_event_execute':
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:1159: undefined reference to `nrfx_usbd_wakeup_req'
    _build/nrf52840_xxaa/app_usbd.c.o: In function `sustate_set':
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:732: undefined reference to `nrfx_usbd_active_irq_config'
    _build/nrf52840_xxaa/app_usbd.c.o: In function `app_usbd_event_execute':
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:1195: undefined reference to `app_usbd_core_ep0_enable'
    _build/nrf52840_xxaa/app_usbd.c.o: In function `sustate_set':
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:732: undefined reference to `nrfx_usbd_active_irq_config'
    _build/nrf52840_xxaa/app_usbd.c.o: In function `app_usbd_event_execute':
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:1098: undefined reference to `nrfx_usbd_stop'
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:1086: undefined reference to `app_usbd_core_ep0_disable'
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:1087: undefined reference to `nrfx_usbd_start'
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:1208: undefined reference to `nrfx_usbd_force_bus_wakeup'
    _build/nrf52840_xxaa/app_usbd.c.o: In function `sustate_set':
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:736: undefined reference to `nrfx_usbd_suspend_irq_config'
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:736: undefined reference to `nrfx_usbd_suspend_irq_config'
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:736: undefined reference to `nrfx_usbd_suspend_irq_config'
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:736: undefined reference to `nrfx_usbd_suspend_irq_config'
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:732: undefined reference to `nrfx_usbd_active_irq_config'
    _build/nrf52840_xxaa/app_usbd.c.o: In function `app_usbd_event_execute':
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:1154: undefined reference to `nrfx_usbd_suspend'
    _build/nrf52840_xxaa/app_usbd.c.o: In function `sustate_set':
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:736: undefined reference to `nrfx_usbd_suspend_irq_config'
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:736: undefined reference to `nrfx_usbd_suspend_irq_config'
    _build/nrf52840_xxaa/app_usbd.c.o: In function `app_usbd_event_execute':
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/components/libraries/usbd/app_usbd.c:1293: undefined reference to `nrfx_usbd_ep_stall'
    ../../../../../nrf_sdk_thread/external/openthread/lib/nrf52840/gcc/libopenthread-nrf52840-sdk-usb.a(usb-cdc-uart.c.o): In function `isPortOpened':
    C:\bamboo\xml-data\build-dir\KNG-OL-BOLO\sdk\sdk\nrf5\external\openthread\project\nrf52840\openthread_nrf52840\sdk\usb\armgcc/../../../../../openthread/examples/platforms/nrf528xx/src/usb-cdc-uart.c:176: undefined reference to `app_usbd_cdc_acm_line_state_get'
    ../../../../../nrf_sdk_thread/external/openthread/lib/nrf52840/gcc/libopenthread-nrf52840-sdk-usb.a(usb-cdc-uart.c.o): In function `cdcAcmUserEventHandler':
    C:\bamboo\xml-data\build-dir\KNG-OL-BOLO\sdk\sdk\nrf5\external\openthread\project\nrf52840\openthread_nrf52840\sdk\usb\armgcc/../../../../../openthread/examples/platforms/nrf528xx/src/usb-cdc-uart.c:107: undefined reference to `app_usbd_cdc_acm_read_any'
    C:\bamboo\xml-data\build-dir\KNG-OL-BOLO\sdk\sdk\nrf5\external\openthread\project\nrf52840\openthread_nrf52840\sdk\usb\armgcc/../../../../../openthread/examples/platforms/nrf528xx/src/usb-cdc-uart.c:121: undefined reference to `app_usbd_cdc_acm_rx_size'
    ../../../../../nrf_sdk_thread/external/openthread/lib/nrf52840/gcc/libopenthread-nrf52840-sdk-usb.a(usb-cdc-uart.c.o): In function `nrf5UartInit':
    C:\bamboo\xml-data\build-dir\KNG-OL-BOLO\sdk\sdk\nrf5\external\openthread\project\nrf52840\openthread_nrf52840\sdk\usb\armgcc/../../../../../openthread/examples/platforms/nrf528xx/src/usb-cdc-uart.c:272: undefined reference to `app_usbd_serial_num_generate'
    ../../../../../nrf_sdk_thread/external/openthread/lib/nrf52840/gcc/libopenthread-nrf52840-sdk-usb.a(usb-cdc-uart.c.o): In function `nrf5UartDeinit':
    C:\bamboo\xml-data\build-dir\KNG-OL-BOLO\sdk\sdk\nrf5\external\openthread\project\nrf52840\openthread_nrf52840\sdk\usb\armgcc/../../../../../openthread/examples/platforms/nrf528xx/src/usb-cdc-uart.c:292: undefined reference to `nrfx_usbd_is_started'
    C:\bamboo\xml-data\build-dir\KNG-OL-BOLO\sdk\sdk\nrf5\external\openthread\project\nrf52840\openthread_nrf52840\sdk\usb\armgcc/../../../../../openthread/examples/platforms/nrf528xx/src/usb-cdc-uart.c:300: undefined reference to `nrfx_usbd_is_enabled'
    ../../../../../nrf_sdk_thread/external/openthread/lib/nrf52840/gcc/libopenthread-nrf52840-sdk-usb.a(usb-cdc-uart.c.o): In function `processConnection':
    C:\bamboo\xml-data\build-dir\KNG-OL-BOLO\sdk\sdk\nrf5\external\openthread\project\nrf52840\openthread_nrf52840\sdk\usb\armgcc/../../../../../openthread/examples/platforms/nrf528xx/src/usb-cdc-uart.c:194: undefined reference to `nrfx_usbd_is_enabled'
    C:\bamboo\xml-data\build-dir\KNG-OL-BOLO\sdk\sdk\nrf5\external\openthread\project\nrf52840\openthread_nrf52840\sdk\usb\armgcc/../../../../../openthread/examples/platforms/nrf528xx/src/usb-cdc-uart.c:217: undefined reference to `nrfx_usbd_is_enabled'
    ../../../../../nrf_sdk_thread/external/openthread/lib/nrf52840/gcc/libopenthread-nrf52840-sdk-usb.a(usb-cdc-uart.c.o): In function `processReceive':
    C:\bamboo\xml-data\build-dir\KNG-OL-BOLO\sdk\sdk\nrf5\external\openthread\project\nrf52840\openthread_nrf52840\sdk\usb\armgcc/../../../../../openthread/examples/platforms/nrf528xx/src/usb-cdc-uart.c:235: undefined reference to `app_usbd_cdc_acm_read_any'
    ../../../../../nrf_sdk_thread/external/openthread/lib/nrf52840/gcc/libopenthread-nrf52840-sdk-usb.a(usb-cdc-uart.c.o): In function `processTransmit':
    C:\bamboo\xml-data\build-dir\KNG-OL-BOLO\sdk\sdk\nrf5\external\openthread\project\nrf52840\openthread_nrf52840\sdk\usb\armgcc/../../../../../openthread/examples/platforms/nrf528xx/src/usb-cdc-uart.c:247: undefined reference to `app_usbd_cdc_acm_write'
    ../../../../../nrf_sdk_thread/external/openthread/lib/nrf52840/gcc/libopenthread-nrf52840-sdk-usb.a(usb-cdc-uart.c.o): In function `processConnection':
    C:\bamboo\xml-data\build-dir\KNG-OL-BOLO\sdk\sdk\nrf5\external\openthread\project\nrf52840\openthread_nrf52840\sdk\usb\armgcc/../../../../../openthread/examples/platforms/nrf528xx/src/usb-cdc-uart.c:201: undefined reference to `nrfx_usbd_is_started'
    ../../../../../nrf_sdk_thread/external/openthread/lib/nrf52840/gcc/libopenthread-nrf52840-sdk-usb.a(usb-cdc-uart.c.o): In function `otPlatUartSend':
    C:\bamboo\xml-data\build-dir\KNG-OL-BOLO\sdk\sdk\nrf5\external\openthread\project\nrf52840\openthread_nrf52840\sdk\usb\armgcc/../../../../../openthread/examples/platforms/nrf528xx/src/usb-cdc-uart.c:356: undefined reference to `app_usbd_cdc_acm_write'
    ../../../../../nrf_sdk_thread/external/openthread/lib/nrf52840/gcc/libopenthread-nrf52840-sdk-usb.a(usb-cdc-uart.c.o):(.rodata.sAppCdcAcm+0x4): undefined reference to `app_usbd_cdc_acm_class_methods'
    collect2: error: ld returned 1 exit status
    ../../../../../nrf_sdk_thread/components/toolchain/gcc/Makefile.common:292: recipe for target '_build/nrf52840_xxaa.out' failed
    make: *** [_build/nrf52840_xxaa.out] Error 1
    make: Leaving directory '/home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc'
    
     

  • Search for the function within the SDK tree, find the header where its declared, and add this to your include path.

    In this case, its modules/nrfx/drvers/include.

     

    Kind regards,

    Håkon

  • i have already set that in my include path

  • Could you check if "NRFX_USBD_ENABLED" is set to '1' in your sdk_config.h?

  • I checked for it, It was not defined in sdk_config.h

    Now after including all the related files and macros in makefile and sdk_config, I am stuck with following compilation error..

    Compiling file: main.c
    Linking target: _build/nrf52840_xxaa.out
    _build/nrf52840_xxaa/nrfx_usbd.c.o: In function `usbd_dmareq_process':
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/modules/nrfx/drivers/src/nrfx_usbd.c:1469: undefined reference to `nrfx_systick_delay_us'
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/modules/nrfx/drivers/src/nrfx_usbd.c:1477: undefined reference to `nrfx_systick_delay_us'
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/modules/nrfx/drivers/src/nrfx_usbd.c:1480: undefined reference to `nrfx_systick_delay_us'
    /home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc/../../../../../nrf_sdk_thread/modules/nrfx/drivers/src/nrfx_usbd.c:1482: undefined reference to `nrfx_systick_delay_us'
    ../../../../../nrf_sdk_thread/external/openthread/lib/nrf52840/gcc/libopenthread-nrf52840-sdk-usb.a(usb-cdc-uart.c.o): In function `isPortOpened':
    C:\bamboo\xml-data\build-dir\KNG-OL-BOLO\sdk\sdk\nrf5\external\openthread\project\nrf52840\openthread_nrf52840\sdk\usb\armgcc/../../../../../openthread/examples/platforms/nrf528xx/src/usb-cdc-uart.c:176: undefined reference to `app_usbd_cdc_acm_line_state_get'
    ../../../../../nrf_sdk_thread/external/openthread/lib/nrf52840/gcc/libopenthread-nrf52840-sdk-usb.a(usb-cdc-uart.c.o): In function `cdcAcmUserEventHandler':
    C:\bamboo\xml-data\build-dir\KNG-OL-BOLO\sdk\sdk\nrf5\external\openthread\project\nrf52840\openthread_nrf52840\sdk\usb\armgcc/../../../../../openthread/examples/platforms/nrf528xx/src/usb-cdc-uart.c:107: undefined reference to `app_usbd_cdc_acm_read_any'
    C:\bamboo\xml-data\build-dir\KNG-OL-BOLO\sdk\sdk\nrf5\external\openthread\project\nrf52840\openthread_nrf52840\sdk\usb\armgcc/../../../../../openthread/examples/platforms/nrf528xx/src/usb-cdc-uart.c:121: undefined reference to `app_usbd_cdc_acm_rx_size'
    ../../../../../nrf_sdk_thread/external/openthread/lib/nrf52840/gcc/libopenthread-nrf52840-sdk-usb.a(usb-cdc-uart.c.o): In function `processReceive':
    C:\bamboo\xml-data\build-dir\KNG-OL-BOLO\sdk\sdk\nrf5\external\openthread\project\nrf52840\openthread_nrf52840\sdk\usb\armgcc/../../../../../openthread/examples/platforms/nrf528xx/src/usb-cdc-uart.c:235: undefined reference to `app_usbd_cdc_acm_read_any'
    ../../../../../nrf_sdk_thread/external/openthread/lib/nrf52840/gcc/libopenthread-nrf52840-sdk-usb.a(usb-cdc-uart.c.o): In function `processTransmit':
    C:\bamboo\xml-data\build-dir\KNG-OL-BOLO\sdk\sdk\nrf5\external\openthread\project\nrf52840\openthread_nrf52840\sdk\usb\armgcc/../../../../../openthread/examples/platforms/nrf528xx/src/usb-cdc-uart.c:247: undefined reference to `app_usbd_cdc_acm_write'
    ../../../../../nrf_sdk_thread/external/openthread/lib/nrf52840/gcc/libopenthread-nrf52840-sdk-usb.a(usb-cdc-uart.c.o): In function `otPlatUartSend':
    C:\bamboo\xml-data\build-dir\KNG-OL-BOLO\sdk\sdk\nrf5\external\openthread\project\nrf52840\openthread_nrf52840\sdk\usb\armgcc/../../../../../openthread/examples/platforms/nrf528xx/src/usb-cdc-uart.c:356: undefined reference to `app_usbd_cdc_acm_write'
    ../../../../../nrf_sdk_thread/external/openthread/lib/nrf52840/gcc/libopenthread-nrf52840-sdk-usb.a(usb-cdc-uart.c.o):(.rodata.sAppCdcAcm+0x4): undefined reference to `app_usbd_cdc_acm_class_methods'
    collect2: error: ld returned 1 exit status
    ../../../../../nrf_sdk_thread/components/toolchain/gcc/Makefile.common:292: recipe for target '_build/nrf52840_xxaa.out' failed
    make: *** [_build/nrf52840_xxaa.out] Error 1
    make: Leaving directory '/home/bhumik/zipnet/app/ftd/pca10056/blank/armgcc'
    
    I have already included nrfx_systick.h in main.c and set NRFX_USBD_ENABLED 1 

Related