ADXL345 SPI works on STM32F446RE but same code fails on STM32H723ZG (DEVID 0xE5 not read)
- December 17, 2025
- 2 replies
- 268 views
I’m running into a confusing SPI issue and would appreciate a second set of eyes.
I have an ADXL345 accelerometer over SPI working perfectly on an STM32F446RE Nucleo board. I can reliably read the DEVID register (0x00 → 0xE5) and stream XYZ data.
I moved the exact same code (verbatim) to an STM32H723ZG board and swapped the SPI handle / GPIO definitions accordingly. The SPI peripheral initializes correctly, but the ADXL345 no longer returns 0xE5. Reads either return 0x00 / 0xFF or garbage depending on settings.
Things I’ve already checked / changed:
Same ADXL345 breakout (verified working on F446)
SPI mode (CPOL/CPHA) set to Mode 3 per datasheet
MSB + READ bit set correctly
Chip select manually controlled
SPI clock slowed way down
Correct SPI instance & pins
NSS handled in software
Power and ground verified at the sensor
What’s odd:
Works 100% on F446RE
Fails consistently on H723ZG with the same transaction sequence
Can’t even read the DEVID register (0xE5)
I’m starting to suspect something H7-specific (SPI FIFO behavior, NSS timing, GPIO speed, SPI prescaler differences, or cache/DMA side effects), but I’m not sure where to focus next.
Has anyone seen ADXL345 (or SPI sensors in general) behave differently on STM32H7 vs F4?
Any common gotchas with H7 SPI that would break an otherwise valid SPI driver?
Happy to share code snippets or logic analyzer traces if needed.

