cancel
Showing results for 
Search instead for 
Did you mean: 

Can I add a second instance of a supported MEMS sensor to project in the CubeMX configurator?

JD13
Associate

Sorry for the I'm too stupid to figure this out myself question, but couldn't figure out how to do this myself. In CubeMX Pinout & Configuration under software packs, I can install MEMS support, add a LSM6DSO (and required support elements) using i2c. In the Software Packages I can configure the mems and the LSM6DSO (including the SD0/AD0 pin for LSB of the address).

But, how does one add a second LSM6DSO to the project? Configuring the second slave address looks easy enough, but I need a second sensor instance first. Do I have to manually replicate the generated code used to create the first instance or is there some built-in way to "give me another i2c device with this configuration" option?

1 ACCEPTED SOLUTION

Accepted Solutions
Foued_KH
ST Employee

Hello @JD.1avies​ ,

Unfortunately, this feature is not supported today.

At the moment only one instance per sensor can be used.

Foued

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

2 REPLIES 2
Foued_KH
ST Employee

Hello @JD.1avies​ ,

Unfortunately, this feature is not supported today.

At the moment only one instance per sensor can be used.

Foued

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

JD13
Associate

Thanks for the reply, so since there's not GUI way to do it, how would one do it in manually? Is there any refence material for doing so?

Would be nice if there was internal support for just "add" another instance which then gets its own handlers. I didn't look too deep, instead I just copied off a "my_lsm6dso.c" from the generated file and made the changes to support a second. Seems incredibly inefficient, but it was a hack to get something working.