Skip to main content
JBonn
Associate III
May 16, 2025
Solved

SPI interface from the LSM303AGR with the STM32L476 is not working

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.

This topic has been closed for replies.
Saket_OmBest answer
ST Technical Moderator
May 17, 2025

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

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Saket_Om

1 reply

Saket_OmBest answer
ST Technical Moderator
May 17, 2025
In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Saket_Om