Skip to main content
ebader
Associate
April 11, 2015
Question

LSM303DLHC won't return I_AM_LMS303DLHC register when using STM32CubeF4 v1.5

  • April 11, 2015
  • 3 replies
  • 631 views
Posted on April 11, 2015 at 18:07

Hi everybody,

Using IAR for ARM v7.40.8472.

I just purchased a STM32F401C-DISCO (also called 32F401CDISCOVERY or MB1115B).

When using the demonstration code provided by ''STM32F401 discovery firmware package (UM1660)'', the LSM303DLHC  is working and I can get sensor values.

However, when I use the demonstration code provided by ''STM32CubeF4 v1.5'', the LSM303DLHC won't return the I_AM_LMS303DLHC register.

Needless to say that I have not modified the code at all.

I am really interested in using the STM32F4CUBE HAL driver but I have no experience yet.

I was wondering if anybody had the same issue and fixed it, or if another code exists that uses the LSM303DLHC sensor and the STM32F4CUBE HAL driver with the STM32F401C-DISCO?

Please let me know if you need additional information?

Eric

#stm32f401c-disco-lsm303dlhc-hal
This topic has been closed for replies.

3 replies

raptorhal2
Lead
April 11, 2015
Posted on April 11, 2015 at 19:56

Do the two demonstration code examples use the same microprocessor pins?

Cheers, Hal

ebader
ebaderAuthor
Associate
April 12, 2015
Posted on April 12, 2015 at 03:44

The pinout to the accelerometer is the same on both demo code.

Again, I have not touched the code, so I am really surprised...

I will be running the board on the oscilloscope tomorrow to find out.

chyeguan_2002
Associate
April 21, 2015
Posted on April 21, 2015 at 10:35

Hi,

I think you can compare the working codes with the non-working one so that it is faster to find out the cause. 

If LSM303DLHC is not responding that means the I2C communication is not properly setup or the device address is wrong.