cannot find "__device_[device name]" #api


Justin Huang
 

Hi,

I am building a device driver for Zephyr and when calling the macro, DEVICE_GET(), like DEVICE_GET(my_dev), I get a build error complaining about undefined __device_my_dev.
I tried to locate where the variable is assembled during the build process but have no luck so far.

I have placed the following in the driver source code:

  DEVICE_INIT(my_dev, CONFIG_MYDEV_NAME, my_dev_init,                                                                                                                                                                                                                                                                                                                                                                                                                                                
              my_dev_device_ctrl, NULL,                                                                                                                                                                                                                                                                                                                                                                                                                                                         
              APPLICATION, CONFIG_MYDEV_INIT_PRIORITY);

Could you please shed some light on where to look for what might go wrong?

Thanks,
Justin

Join users@lists.zephyrproject.org to automatically receive all group messages.