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 Reply Children
  • Yes, I have enabled it now and the problem still persists.

    Having said that,

    As a side note - When everything works(for example on 2.1.1), i can see that there are 4 offsets.h files that are generated in our system in the following folders:
    ..../build/hci_rpmsg/b0n/zephyr/include/generated/offsets.h
    ..../build/hci_rpmsg/zephyr/include/generated/offsets.h
    ..../build/mcuboot/zephyr/include/generated/offsets.h
    .../build/zephyr/include/generated/offsets.h

    And, i think the error occurs when the last (highlighted) offsets.h above, was not (yet?) generated.

    Makes me wonder if there is some kind of parallel build happening that is causing this error to occur?
    Does west has any parallell build options that can be controlled? 
    Because, 

    Step1): When clicking on "build"(in vscode) leads to the failure, and upon listing the above folders, all offsets.h are not generated.
    Subsequently,
    Step 2): Clicking on "flash"(in vscode) causes a re-trigger of the build and sometimes causes all of the above 4 offsets.h files to be generated.
    Step3) Clicking on "build" then succeeds.


  • We don't enable CONFIG_RTIO in our configurations, but i do realize now that when the error occurs, the header file related to rtio seems to be getting included as a dependency, only in 2.5.0:
    from C:\ncs\v2.5.0\zephyr\include\zephyr\rtio\rtio.h:31,

    In either case, the problem still persists irrespective of whether CONFIG_RTIO is enabled or disabled.

  • 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

Related