Problem with openthread/instance.h

Hi, i was working with this project where i'm trying to make the thingy53 a thread node.

when i build i find this error and i don't know why:

Building thingy_coap_server
west build --build-dir c:\progetti\nexter\VS\esempi\thingy_coap_server\build c:\progetti\nexter\VS\esempi\thingy_coap_server

[1/271] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf.c.obj
[2/271] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/multi_heap.c.obj
[3/271] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/timeutil.c.obj
[4/271] Building C object zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj
[5/271] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_complete.c.obj
[6/271] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/reboot.c.obj
[7/271] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/assert.c.obj
[8/271] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/nrf53/power.c.obj
[9/271] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/ring_buffer.c.obj
[10/271] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/mpsc_pbuf.c.obj
[11/271] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/heap.c.obj
[12/271] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/heap-validate.c.obj
[13/271] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/bitarray.c.obj
[14/271] Building ASM object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/common/soc_nrf_common.S.obj
[15/271] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/validate_enabled_instances.c.obj
[16/271] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/validate_base_addresses.c.obj
[17/271] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/nrf53/sync_rtc.c.obj
[18/271] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/nrf53/soc.c.obj
[19/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_mgmt.c.obj
[20/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_msg.c.obj
[21/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_backend_uart.c.obj
[22/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_core.c.obj
[23/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_output.c.obj
[24/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/dfu/img_util/flash_img.c.obj
[25/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/ipc/ipc_service/lib/ipc_rpmsg.c.obj
[26/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/ipc/ipc_service/lib/ipc_static_vrings.c.obj
[27/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/ipc/ipc_service/backends/ipc_rpmsg_static_vrings.c.obj
[28/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/net/lib/utils/addr_utils.c.obj
[29/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/usb/device/usb_work_q.c.obj
[30/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/ipc/ipc_service/ipc_service.c.obj
[31/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/settings/src/settings_line.c.obj
[32/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/usb/device/usb_transfer.c.obj
[33/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/fs/nvs/nvs.c.obj
[34/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/settings/src/settings_init.c.obj
[35/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/settings/src/settings_store.c.obj
[36/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/storage/flash_map/flash_map.c.obj
[37/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/usb/device/usb_descriptor.c.obj
[38/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/storage/stream/stream_flash.c.obj
[39/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/state.c.obj
[40/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/storage/flash_map/flash_map_layout.c.obj
[41/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/usb/device/class/cdc_acm.c.obj
[42/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/tracing/tracing_none.c.obj
[43/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/settings/src/settings_nvs.c.obj
[44/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/settings/src/settings.c.obj
[45/271] Building C object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v2.1.1/modules/crypto/tinycrypt/lib/source/utils.c.obj
[46/271] Building C object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v2.1.1/nrf/subsys/partition_manager/flash_map_partition_manager.c.obj
[47/271] Building C object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v2.1.1/modules/crypto/tinycrypt/lib/source/cmac_mode.c.obj
[48/271] Building C object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v2.1.1/modules/crypto/tinycrypt/lib/source/hmac.c.obj
[49/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/policy.c.obj
[50/271] Building C object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v2.1.1/modules/crypto/tinycrypt/lib/source/aes_decrypt.c.obj
[51/271] Building C object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v2.1.1/modules/crypto/tinycrypt/lib/source/aes_encrypt.c.obj
[52/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/pm.c.obj
[53/271] Building C object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v2.1.1/modules/crypto/tinycrypt/lib/source/sha256.c.obj
[54/271] Building C object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v2.1.1/modules/crypto/tinycrypt/lib/source/hmac_prng.c.obj
[55/271] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/usb/device/usb_device.c.obj
[56/271] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc32c_sw.c.obj
[57/271] Building C object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v2.1.1/nrfxlib/crypto/nrf_cc312_platform/src/nrf_cc3xx_platform_abort_zephyr.c.obj
[58/271] Building C object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v2.1.1/nrf/subsys/bluetooth/services/nus.c.obj
[59/271] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc7_sw.c.obj
[60/271] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/dec.c.obj
[61/271] Building C object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v2.1.1/nrfxlib/crypto/nrf_cc312_platform/src/nrf_cc3xx_platform_mutex_zephyr.c.obj
[62/271] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc8_sw.c.obj
[63/271] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_packaged.c.obj
[64/271] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc16_sw.c.obj
[65/271] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/hex.c.obj
[66/271] Building C object CMakeFiles/app.dir/src/main.c.obj
FAILED: CMakeFiles/app.dir/src/main.c.obj
C:\ncs\toolchains\v2.1.1\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DKERNEL -DNRF5340_XXAA_APPLICATION -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DUSE_PARTITION_MANAGER=1 -DZCBOR_ASSERT -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZEPHYR__=1 -I../. -IC:/ncs/v2.1.1/zephyr/include/zephyr -IC:/ncs/v2.1.1/zephyr/include -Izephyr/include/generated -IC:/ncs/v2.1.1/zephyr/soc/arm/nordic_nrf/nrf53 -IC:/ncs/v2.1.1/zephyr/soc/arm/nordic_nrf/common/. -IC:/ncs/v2.1.1/zephyr/subsys/bluetooth -IC:/ncs/v2.1.1/bootloader/mcuboot/boot/bootutil/include -IC:/ncs/v2.1.1/bootloader/mcuboot/boot/zephyr/include -IC:/ncs/v2.1.1/zephyr/subsys/usb/device -IC:/ncs/v2.1.1/zephyr/subsys/settings/include -IC:/ncs/v2.1.1/nrf/include -IC:/ncs/v2.1.1/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v2.1.1/modules/hal/nordic/nrfx -IC:/ncs/v2.1.1/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.1.1/modules/hal/nordic/nrfx/mdk -IC:/ncs/v2.1.1/zephyr/modules/hal_nordic/nrfx/. -Imodules/libmetal/libmetal/lib/include -IC:/ncs/v2.1.1/modules/lib/open-amp/open-amp/lib/include -IC:/ncs/v2.1.1/modules/debug/segger/SEGGER -IC:/ncs/v2.1.1/modules/debug/segger/Config -IC:/ncs/v2.1.1/zephyr/modules/segger/. -IC:/ncs/v2.1.1/modules/crypto/tinycrypt/lib/include -IC:/ncs/v2.1.1/modules/lib/zcbor/include -IC:/ncs/v2.1.1/nrfxlib/softdevice_controller/include -IC:/ncs/v2.1.1/zephyr/subsys/mgmt/mcumgr/lib/mgmt/include -IC:/ncs/v2.1.1/zephyr/subsys/mgmt/mcumgr/lib/util/include -IC:/ncs/v2.1.1/zephyr/subsys/mgmt/mcumgr/lib/smp/include -IC:/ncs/v2.1.1/zephyr/subsys/mgmt/mcumgr/lib/cmd/img_mgmt/include -IC:/ncs/v2.1.1/zephyr/subsys/mgmt/mcumgr/lib/cmd/os_mgmt/include -isystem C:/ncs/v2.1.1/zephyr/lib/libc/minimal/include -isystem c:/ncs/toolchains/v2.1.1/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/include -isystem c:/ncs/toolchains/v2.1.1/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/include-fixed -isystem C:/ncs/v2.1.1/nrfxlib/crypto/nrf_cc312_platform/include -Os -imacros C:/progetti/nexter/VS/esempi/thingy_coap_server/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfp16-format=ieee --sysroot=C:/ncs/toolchains/v2.1.1/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/ncs/v2.1.1/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=C:/progetti/nexter/VS/esempi/thingy_coap_server=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.1.1/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.1.1=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT CMakeFiles/app.dir/src/main.c.obj -MF CMakeFiles\app.dir\src\main.c.obj.d -o CMakeFiles/app.dir/src/main.c.obj -c ../src/main.c
In file included from c:\progetti\nexter\VS\esempi\thingy_coap_server\src\main.c:23:
C:\ncs\v2.1.1\zephyr\include\zephyr\net\openthread.h:25:10: fatal error: openthread/instance.h: No such file or directory
25 | #include <openthread/instance.h>
| ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[67/271] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/thread_entry.c.obj
[68/271] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/fdtable.c.obj
[69/271] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/notify.c.obj
[70/271] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/sem.c.obj
[71/271] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/printk.c.obj
[72/271] Generating linker_zephyr_pre1.cmd
[73/271] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/rb.c.obj
[74/271] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/onoff.c.obj
[75/271] Building C object zephyr/drivers/usb/device/CMakeFiles/drivers__usb__device.dir/usb_dc_nrfx.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: 'c:\ncs\toolchains\v2.1.1\opt\bin\cmake.EXE' --build 'c:\progetti\nexter\VS\esempi\thingy_coap_server\build'

this is the project

thingy_coap_server.zip

Parents
  • Hi,

    Thank you for contacting DevZone at NordicSemi.

    As per the information you have provided, I started with:

    1) VS Code and selected nCS v2.1.1 as the SDK version and 2.1.1 as the toolchain version

    2) Then I created the new project and selected "coap_server" sample

    3) I built if for thingy53. Build was successful without any issue/problem.

    What I see is that your project is not very similar to this sample. For example, the sample has "coap_server.c" in the "src" folder while your project has "main.c", and their contents are also not similar.

    Moreover, another thing, which could be causing error in your case, is that the #include are different in your project.

    For example, the sample has:

    #include <zephyr/net/openthread.h>

    while your project has:
    #include <net/openthread.h>

    And, it is very this header file that contains the inclusion of instance.h

    So I suggest you to look into the code and structure of the sample project and then after successful compilation integrate your changes to the sample code.

    Let me know if this helps or there is something I am missing.

    Regards,
    Naeem

Reply
  • Hi,

    Thank you for contacting DevZone at NordicSemi.

    As per the information you have provided, I started with:

    1) VS Code and selected nCS v2.1.1 as the SDK version and 2.1.1 as the toolchain version

    2) Then I created the new project and selected "coap_server" sample

    3) I built if for thingy53. Build was successful without any issue/problem.

    What I see is that your project is not very similar to this sample. For example, the sample has "coap_server.c" in the "src" folder while your project has "main.c", and their contents are also not similar.

    Moreover, another thing, which could be causing error in your case, is that the #include are different in your project.

    For example, the sample has:

    #include <zephyr/net/openthread.h>

    while your project has:
    #include <net/openthread.h>

    And, it is very this header file that contains the inclusion of instance.h

    So I suggest you to look into the code and structure of the sample project and then after successful compilation integrate your changes to the sample code.

    Let me know if this helps or there is something I am missing.

    Regards,
    Naeem

Children
Related