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

  • Hello,

    I followed the method above the link you sent, and then I modified a number of files myself and successfully compiled the driver into it.
    But there are still questions:
    1. The device tree still fails to identify the device description file in the dts.
    2. Replacing 'headstage0' with 'headstage' is invalid, the variable will be assigned to 0, but the device_is_ready function will return false.

    Thanks!

Reply
  • Hello,

    I followed the method above the link you sent, and then I modified a number of files myself and successfully compiled the driver into it.
    But there are still questions:
    1. The device tree still fails to identify the device description file in the dts.
    2. Replacing 'headstage0' with 'headstage' is invalid, the variable will be assigned to 0, but the device_is_ready function will return false.

    Thanks!

Children
Related