2023-10-11 02:36 AM
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?
Solved! Go to Solution.
2023-10-11 04:59 AM
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
As you are using F4 devices, you could find information into the F4 discovery board BSP.
Best regards
Mikael
2023-10-11 03:00 AM - edited 2023-10-11 08:40 AM
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.
2023-10-11 03:06 AM - edited 2023-10-11 03:40 AM
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)
2023-10-11 04:59 AM
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
As you are using F4 devices, you could find information into the F4 discovery board BSP.
Best regards
Mikael
2023-10-11 08:37 AM
I see i am missing some of the basic libs that come with the discovery board thanks a lot!
2023-10-11 09:35 AM
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!
2023-10-12 01:46 AM
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