cancel
Showing results for 
Search instead for 
Did you mean: 

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

ebader
Associate
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
3 REPLIES 3
raptorhal2
Lead
Posted on April 11, 2015 at 19:56

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

Cheers, Hal

ebader
Associate
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 II
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.