offsets.h No such file or directory

Hi, 

We have been using SDK version 2.1.1 and currently are in the process of migrating to SDK version 2.5.0.

Would be helpful to get some hint regarding what conditions can lead to the following error when building our application.

In file included from C:\ncs\v2.5.0\zephyr\include\zephyr\app_memory\app_memdomain.h:9,
from C:\ncs\v2.5.0\zephyr\include\zephyr\rtio\rtio.h:31,
from C:\ncs\v2.5.0\zephyr\include\zephyr\drivers\i2c.h:28,
from <our application.h>...
C:\ncs\v2.5.0\zephyr\include\zephyr\linker\linker-defs.h:26:10: fatal error: offsets.h: No such file or directory
26 | #include <offsets.h>
| ^~~~~~~~~~~

Thanks,

Mathi.

Parents
  • Hi,

    Can you explain the steps you did to update to v2.5.0? Both for the SDK and the application.

    Maybe most common is to forget to delete the build folder between versions.

    Regards,
    Sigurd Hellesvik

  • Hi Sigurd,

    Iam building an application that contains the child image mcuboot and hci_rpmsg.conf.
    I use vscode to install the new version of the SDK and toolchain.
    I can also confirm that the build error is seen only when upgrading from 2.4.2 to 2.5.0. i.e. 
    In order to re-create the problem we tried to incrementally upgrade from 2.1.1 to 2.5.0..
    i.e.
    Upgrade from 2.1.1 to 2.3.0 ==> No build error related to offsets.h generation.
    Upgrade from 2.3.0 to 2.4.0 ==> No build error related to offsets.h generation.
    Upgrade from 2.4.0 to 2.4.1 ==> No build error related to offsets.h generation.
    Upgrade from 2.4.1 to 2.4.2 ==> No build error related to offsets.h generation.
    Upgrade from 2.4.2 to 2.5.0 ==> Build fails due to offsets.h generation.

    Note: I always made sure to delete the build folder between versions.
    Please let me know if you need further information.

    Thanks,

    Mathi.

  • Mathi said:
    Yes, i set CONFIG_RTIO now and tried buiding a crypto sample application.

    QuoteIt seems like the issue is related to i2c code. Can you try to see if you get the same from a sample using i2c?
    For example from the I2C lesson in Devacademy?

  • I can confirm that I see the same issue, but on 2.5.1. A clean build fails because offsets.h can't be found, but subsequent builds succeed.I don't have CONFIG_RTIO set.

  • I also am seeing the same issue on 2.5.1

    When I dug into it a bit, it looked like zephyr's cmake was properly setting up the target for generating offsets.h, and that the library targets were setup to depend on it.

    It made me suspect that ninja was the issue, but that's where I got stuck.

    I have ninja version 1.10.1

  • ryan_mulder_antrum said:

    When I dug into it a bit, it looked like zephyr's cmake was properly setting up the target for generating offsets.h, and that the library targets were setup to depend on it.

    It made me suspect that ninja was the issue, but that's where I got stuck.

    I have ninja version 1.10.1

    How did you install the nRF Connect SDK and its toolchain?

    How do you build you projects?

  • That is of course not impossible, but it is unlikely, ninja is ultimately just a task runner and there aren't that many things that it can do wrong. I suspect that something changed in the Zephyr build system (or maybe in the NCS build system). For me, the file with the offsets.h issue is an external project that I add to the main CMakeLists.txt via add_subdirectory, which worked just fine in NCS 2.4.2, but fails now (with NCS 2.5.1). I also have an add_custom_target in my CMakeLists.txt that was added as a dependency to zephyr_final with NCS 2.4.2. After switching to 2.5.1, I had to add it as a dependency to zephyr_pre0 instead, because it wasn't executing at the right time anymore. So something definitely changed in the build system somewhere and I'm willing to bet that that's why we're seeing these issues now.

Reply
  • That is of course not impossible, but it is unlikely, ninja is ultimately just a task runner and there aren't that many things that it can do wrong. I suspect that something changed in the Zephyr build system (or maybe in the NCS build system). For me, the file with the offsets.h issue is an external project that I add to the main CMakeLists.txt via add_subdirectory, which worked just fine in NCS 2.4.2, but fails now (with NCS 2.5.1). I also have an add_custom_target in my CMakeLists.txt that was added as a dependency to zephyr_final with NCS 2.4.2. After switching to 2.5.1, I had to add it as a dependency to zephyr_pre0 instead, because it wasn't executing at the right time anymore. So something definitely changed in the build system somewhere and I'm willing to bet that that's why we're seeing these issues now.

Children
No Data
Related