Skip to main content
Associate III
May 27, 2024
Question

STM32h745 ADXL355

  • May 27, 2024
  • 3 replies
  • 1135 views

Hi everyone

this is my code for reading X axis ADXL355 accelerometer thanks to STM32h745.

fru999_0-1716812358925.png

But when I run it, i keep being stuck if the HAL-SPIèTransmitReceive

 

Can you help me ?

3 replies

fru999Author
Associate III
May 27, 2024

My mac delay is now = 100 but 

I am always is HAL_TIMEOUT I don't understand why

 

Pavel A.
Super User
May 28, 2024

Can you post the actual code? In your post, returned value of HAL_SPI_TransmitReceive is not checked.

 

Andrew Neil
Super User
May 29, 2024

Please use this button to properly post source code - not as an image:

AndrewNeil_1-1716971934419.png

 

You also need to show the definitions of your data and addr variables - are you sure they are correct?

Have you used an oscilloscope to check what's actually happening on the wires?

Please also post your schematic showing how the ADXL355 is connected. Have you double checked the connections?

The ADXL355 can operate in either I2C or SPI - are you sure you have it correctly configured?

https://www.analog.com/en/products/adxl355.html 

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.