Custom OOT AMS TMF882X driver - multiple definition of `__device_dts_ord_xx'

Hi everyone,

I am currently trying to implement a new OOT driver for a ToF sensor made by AMS, the TMF882X.

I have made a kind of skeleton driver based on another one (Sensirion SCD4X).

While compiling my driver i get the following error which I cannot track down and find the cause of it.

It seems that there's multiple definitions during linking of my driver.

I could not find much while searching online

I've also posted all my source files for the driver.

Any help would be greatly appreciated.

tmf882x_testing.rar

  • Will do!
    BTW I have uploaded my dts (and driver stubs) in a zip file.
    Don't know if you had a look there or not.
    Maybe there could be something to make the issue clearer.

    Thanks Slight smile

  • Hey Susheel,

    So I tried with the latest SDK 2.4.2 but still the same issue.
    I will sill keep looking into it.
    I am also including the whole project as you requested.
    Maybe there's something there which I cannot see at the moment.


    testing_tmf882x.rar

  • Hello Dorian,

    I have checked your project.

    Directly building for the NRF53DK, I would see the same error as you have mentioned (multiple definitions of log module and __device_ord_134, both of which are pointing to the TMF882X).

    I could see that the source files are referred two times (one time in the main CMakeLists.txt and the other time within the CMakeLists.txt of the respective driver folder). So, I commented out 4 lines from the CMakeLists.txt:

    Line 15 #FILE(GLOB scd4x_drv scd4x_oot_driver/drivers/sensor/scd4x/*.c)
    Line 16 #FILE(GLOB tmf882x_drv tmf882x_oot_driver/drivers/sensor/tmf882x/*.c)
    
    Line 18 #target_sources(app PRIVATE ${scd4x_drv})
    Line 19 #target_sources(app PRIVATE ${tmf882x_drv})

    Now that error is removed but a new error appears. 

    This time the error is related to the __device_ord_133 which is the other sensor.

    I do not think that this is an overlay issue. I have removed your source code from the main and can access TFM sensor as below (it builds correctly).

    However, I do get error when I try to use the other sensor. I think this is some issue in your implementation. I would suggest you to look at zephyr out-of-tree driver example (I think that is within example-application sample) and revise your implementation etc.

    BR, Naeem

  • Hi Naeem,

    Thanks for the tips.
    I made it work in the end by following a similar structure as the one in the example.
    Even made the binfings work.
    I am posting a pic just in case someone else encounters the same issue.


Related