Lm75 test example build issue

Hello everyone, I try to build tests/driver_lm75, and I am facing following error :

tests/driver_lm75/main.c:26:10: fatal error: lm75_regs.h: No such file or directory

I tried to modify the Makefile from :

DRIVER ?= tmp1015

to :

DRIVER ?= lm75 or DRIVER ?= lm75a

No luck with both cases.

What am I missing? Thank you for your help. Regards

Sorry for the delayed response

I cannot find anything that says we support the tmp1015, maybe that can be added but I didn’t look to much into it.

The following works for me:

  • DRIVER=tmp1075 make all -C tests/driver_lm75
  • DRIVER=lm75a make all -C tests/driver_lm75

It appears that DRIVER=lm75 make all -C tests/driver_lm75 is missing the parameters in drivers/lm75/include/lm75_params.h.

One could theoretically add a lm75 set of parameters or maybe even tmp1015 though.

If you would like to give it a try, open a PR (doesn’t need to work, just something to start) and ping me and I can help guide you.

Should be pretty straightforward, you probably only have to add a device ID check and maybe device specific parameters.

But AFAIU they all should be backwards compatible with lm75, so if you need none of the advanced features, that should work.

Hello, thank you for your help, I’ll try probably next week. If I come to something good, yes maybe I’ll open a PR, I’ll keep you in touch if so. ++

Hello, the solution was simple : I was setting the variable DRIVER to another value in my build command. What I don’t understand is :

  • I put DRIVER+=my_driver DRIVER+=lm75 in my build command : OK

  • I put no DRIVER in my Makefile command : OK (because tests/driver_lm75/Makefile have DRIVER?=lm75)

  • I put only DRIVER+=my_driver in the Makefile command but modify DRIVER?=lm75 to DRIVER+=lm75 : NOK, I have the issue of lm75_regs.h not found.

My question : what is the difference between writing DRIVER+=my_driver DRIVER+=lm75 in the build command and writing DRIVER+=my_driver in the build command and DRIVER+=lm75 in the Makefile?

Thank you for your answer

Regards

I will try to understand the conditions…

  • I put DRIVER+=my_driver DRIVER+=lm75 in my build command : OK

Using DRIVER+=? make ... is not really the correct way, as it is adding directly resulting a “module” with all the same names

$ DRIVER+=my_driver DRIVER+=lm75 make -C tests/driver_lm75/ info-modules | grep my_driver

my_driverlm75

Instead it would be recommended to do:

DRIVER=lm75 make -C tests/driver_lm75/ info-modules | grep lm75

lm75

As mentioned previously, the parameters are missing from the lm75 and would result in build failure, instead use the lm75a.

  • I put no DRIVER in my Makefile command : OK (because tests/driver_lm75/Makefile have DRIVER?=lm75)

No the makefile in the test sets it to DRIVER ?= tmp1075… which should work, as it has parameters.

  • I put only DRIVER+=my_driver in the Makefile command but modify DRIVER?=lm75 to DRIVER+=lm75 : NOK, I have the issue of lm75_regs.h not found.

The DRIVER is really only a "helperforUSEMODULE. Maybe it is failing because the lm75 doesn't have parameters. I don't really know what "my_driver module is or how it is implemented, or if it conflicts with the lm75 driver.

I believe the lm75 module only allows one driver, at least if you are using the PARAMS provided.

My question : what is the difference between writing DRIVER+=my_driver DRIVER+=lm75 in the build command and writing DRIVER+=my_driver in the build command and DRIVER+=lm75 in the Makefile?

The makefile splits the DRIVER values which would result in the my_driver and the lm75 module being used. Just the CLI make command (what I assume you mean by build command) would add those values together making a module my_driverlm75.

No the makefile in the test sets it to DRIVER ?= tmp1075… which should work, as it has parameters.

Yes sorry, I changed it to lm75 (actually, lm75a because as mentionned, params are missing for lm75)

my_driver is actually a radio driver, not related to any sensor. Your explanation was clear, thank you I understand now. If I use USEMODULE instead, it works like a charm, I can use LM75 along with my_driver thank you for your help. Best regards