cancel
Showing results for 
Search instead for 
Did you mean: 

lsm303dlhc.c

Chris_student
Associate II

Hey st i am working with the stm32f407g and i am trying to make the LSM303 working on my board. At this moment i am using this lib: https://github.com/STMicroelectronics/STM32CubeL4/blob/master/Drivers/BSP/Components/lsm303dlhc/lsm303dlhc.c
The problem i am having is that it cant find the COMPASSACCELERO_IO_WRITE function and the COMPASSACCELERO_IO_Init function. I think this is because i am missing a .A or .LIB. Could i get help with this?

1 ACCEPTED SOLUTION

Accepted Solutions

hello @Chris_student 

You could find what you want here (function definition):
https://github.com/STMicroelectronics/STM32CubeF4/blob/master/Drivers/BSP/STM32F401-Discovery/stm32f401_discovery.c

MikaelM_0-1697025581926.png

As you are using F4 devices, you could find information into the F4 discovery board BSP.

Best regards

Mikael

If you feel a post has answered your question, please click Accept as Solution.

View solution in original post

6 REPLIES 6
Foued_KH
ST Employee

Hello @Chris_student , 

Did you add the .h file into your project ?

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.

I did but it did not work, i added these 3 libs because they are needed and made sure the path was right but it wont work. when i open the declaration of COMPASSACCELERO_IO_WRITE i get passed to the .h file so thats good but i can not find the function it self enywhere. because as far as i know there should be a function of COMPASSACCELERO_IO_WRITE with code in it. But this is no where to be found.
(COMPASSACCELERO_IO_WRITE is a function that gets called by multiple functions in the .c file)

Chris_student_0-1697018774309.png

 

hello @Chris_student 

You could find what you want here (function definition):
https://github.com/STMicroelectronics/STM32CubeF4/blob/master/Drivers/BSP/STM32F401-Discovery/stm32f401_discovery.c

MikaelM_0-1697025581926.png

As you are using F4 devices, you could find information into the F4 discovery board BSP.

Best regards

Mikael

If you feel a post has answered your question, please click Accept as Solution.

I see i am missing some of the basic libs that come with the discovery board thanks a lot!

Can u help me with one last thing. Is there a example code for the lsm303dlhc.c. This because i am missing the parameters i need to give to the functions. A initstruct and a pData pointer to a type unknown. Thanks for the help already!

Hello @Chris_student 

maybe you could find lot of interesting stuff here :
https://www.st.com/en/embedded-software/x-cube-mems1.html#overview

Best regards

Mikael

If you feel a post has answered your question, please click Accept as Solution.