Failed to add a user-defined device.

I tried to add a chip of our own design to NCS, but when I tried to write the device description file, I ran into two problems:

1.Even if the chip description file is compiled successfully, the prompt "unknown node type" and "Only spi nodes accepted in /soc/spi@40023000/" are displayed in the editor.

2.If I ignore the above cases, adding a device binding in main will prompt a compilation error "undefined reference to '__device_dts_ord_108'"

Parents
  • Hello,

    Please see Håkon's reply in this ticket

    I tested it on your sample by doing steps 1 and 2, copied here for convenience:

    1. in CMakeLists.txt, add this before find_package(...):

    list(APPEND ZEPHYR_EXTRA_MODULES
      ${CMAKE_CURRENT_SOURCE_DIR}/drivers
    )

    2. create file driver/zephyr/module.yml, containing:

    build:
      cmake: .
      kconfig: Kconfig

    Then make sure to delete your old build folder, and generate a new build configuration (just like you did before). 

    One final thing is that in main.c, line 15, use this:

    bmstim2216 = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(headstage));

    (remove the '0' in "headstage0").

    Then it built fine on my computer.

    Best regards,

    Edvin

Reply
  • Hello,

    Please see Håkon's reply in this ticket

    I tested it on your sample by doing steps 1 and 2, copied here for convenience:

    1. in CMakeLists.txt, add this before find_package(...):

    list(APPEND ZEPHYR_EXTRA_MODULES
      ${CMAKE_CURRENT_SOURCE_DIR}/drivers
    )

    2. create file driver/zephyr/module.yml, containing:

    build:
      cmake: .
      kconfig: Kconfig

    Then make sure to delete your old build folder, and generate a new build configuration (just like you did before). 

    One final thing is that in main.c, line 15, use this:

    bmstim2216 = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(headstage));

    (remove the '0' in "headstage0").

    Then it built fine on my computer.

    Best regards,

    Edvin

Children
Related