out of tree driver; builds, links but not in map

I have an out of tree driver (vl53l1x) building and linking for an out of tree board which works.  
However, another driver for bmi088, builds, appears to link but does not appear in the map files
which leads to this error when I try and use the sensor --> undefined reference to `__device_dts_ord_127' 

I have a feeling the dts fragment may be the cause but not sure at this point.

source tree looks like this 

- project_root
  - boards
  - dts
  - hello_world
    CMakeLists.txt
    KConfig
    prf.conf
    sample.yaml
  - drivers
    CMakeLists.txt
    KConfig
    - sensor 
      CMakeLists.txt
      KConfig
      - bmi088
        CMakeLists.txt
        KConfig
        <other code files>
      - vl53l1x (functioning)   
  - src
    main.c


Without trying to use the sensor 
[172/184] Linking C static library drivers\sensor\bmi088\lib..__..__..__workvob__xqc__bringup_empty__hello_world__drivers__sensor__bmi088.a
[173/184] Linking C static library zephyr\kernel\libkernel.a
[174/184] Linking C executable zephyr\zephyr_pre0.elf

When I try to use the sensor
[174/185] Linking C static library drivers\sensor\bmi088\lib..__..__..__workvob__xqc__bringup_empty__hello_world__drivers__sensor__bmi088.a
[175/185] Linking C executable zephyr\zephyr_pre0.elf
FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map
c:/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.exe: app/libapp.a(main.c.obj): in function `get_gyro_device':
C:\workvob\xqc\bringup_empty\hello_world\src\main.c:131: undefined reference to `__device_dts_ord_127'

Other functioning sensors left out 
&i2c1 {
    compatible = "nordic,nrf-twim";
    status = "okay";
    clock-frequency = <I2C_BITRATE_FAST>;

    pinctrl-0 = <&i2c1_default>;
    pinctrl-1 = <&i2c1_sleep>;
    pinctrl-names = "default", "sleep";

    gyro: bmi088_gyr@69 {
      compatible = "bosch,bmi088-gyr";
      status = "okay";
      reg = <0x69>;
      // datasheet page 39
      bandwidth = <0x06>; // corner-frequency at 64 Hz
    };
    acc: bmi088_acc@18 {
      compatible = "bosch,bmi088-acc";
      status = "okay";
      reg = <0x18>;
      odr = <0x0B>; // 800 Hz
      osr = <0x08>; // 4 times oversampled
    };
};
Parents
  • Hi,

    It seems something is not enabled, either in your device tree or Kconfig (prj.conf). I suggest you open your build folder and find this file: <build_folder>/zephyr/include/generated/devicetree_generated.h. There you see the numbered nodes. As you got __device_dts_ord_127, 127 is relevant here. That points to a peripheral or similar, and that needs to be enabled/included.

  • I just found a difference in this header file.  If I compare the in tree devices to my out of tree devices they are different as far as the header comment.  For example 

    /*
    * Devicetree node: /soc/peripheral@50000000/i2c@9000/bmm150@10
    *
    * Node identifier: DT_N_S_soc_S_peripheral_50000000_S_i2c_9000_S_bmm150_10
    *
    * Binding (compatible = bosch,bmm150):
    * $ZEPHYR_BASE\dts\bindings\sensor\bosch,bmm150.yaml
    *
    * (Descriptions have moved to the Devicetree Bindings Index
    * in the documentation.)
    */

    /*
    * Devicetree node: /soc/peripheral@50000000/i2c@9000/bmi088_gyr@69
    *
    * Node identifier: DT_N_S_soc_S_peripheral_50000000_S_i2c_9000_S_bmi088_gyr_69
    */

    Now, I'm not saying that is the issue and I can guarantee the out of tree dts\binding files are there. 
    Its the same for the vl53 out of tree device but it is functioning. 

Reply
  • I just found a difference in this header file.  If I compare the in tree devices to my out of tree devices they are different as far as the header comment.  For example 

    /*
    * Devicetree node: /soc/peripheral@50000000/i2c@9000/bmm150@10
    *
    * Node identifier: DT_N_S_soc_S_peripheral_50000000_S_i2c_9000_S_bmm150_10
    *
    * Binding (compatible = bosch,bmm150):
    * $ZEPHYR_BASE\dts\bindings\sensor\bosch,bmm150.yaml
    *
    * (Descriptions have moved to the Devicetree Bindings Index
    * in the documentation.)
    */

    /*
    * Devicetree node: /soc/peripheral@50000000/i2c@9000/bmi088_gyr@69
    *
    * Node identifier: DT_N_S_soc_S_peripheral_50000000_S_i2c_9000_S_bmi088_gyr_69
    */

    Now, I'm not saying that is the issue and I can guarantee the out of tree dts\binding files are there. 
    Its the same for the vl53 out of tree device but it is functioning. 

Children
No Data
Related