cancel
Showing results for 
Search instead for 
Did you mean: 

SPI interface from the LSM303AGR with the STM32L476 is not working

JBonn
Associate III

Using a custom board.

Used CubeMX and CubeIDE to develop the code which is attached to this post.

A read of WHO_AM_I_A results with the command in rxData[0] and nothing in rxData[1].

Same thing happens when reading registers.

1 ACCEPTED SOLUTION

Accepted Solutions
Saket_Om
ST Employee

Hello @JBonn 

Please use the BSP driver for LSM303AGR to set your spi and read your data.

GitHub - STMicroelectronics/stm32-lsm303agr at 08a4454a5359e2e0dee283b6df8ebbbae6366f14

32f401cdiscovery-bsp/stm32f401_discovery.c at 7a797af08db92b7638865ddd8c61a5449c93a5a5 · STMicroelectronics/32f401cdiscovery-bsp · GitHub

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.
Saket_Om

View solution in original post

1 REPLY 1
Saket_Om
ST Employee

Hello @JBonn 

Please use the BSP driver for LSM303AGR to set your spi and read your data.

GitHub - STMicroelectronics/stm32-lsm303agr at 08a4454a5359e2e0dee283b6df8ebbbae6366f14

32f401cdiscovery-bsp/stm32f401_discovery.c at 7a797af08db92b7638865ddd8c61a5449c93a5a5 · STMicroelectronics/32f401cdiscovery-bsp · GitHub

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.
Saket_Om