[riot-users] using lis3dh in STM32F4 discovery board

Peter Kietzmann peter.kietzmann at haw-hamburg.de
Mon Nov 16 08:35:15 CET 2015


Hi Alicja,

and welcome to RIOT! If I see it correctly, the a accelerometer that's 
mounted on the stm32f4 discovery board is LIS3D*S*H whereas we only have 
support for the LIS3DH accelerometer currently. I assume they are not 
too different, but it might be the reason why the app does not work out 
of the box. Also: did you make sure that the sensor is really connected 
to SPI_0 in RIOT?

Best,
Peter



Am 12.11.2015 um 11:53 schrieb Alicja Norrdine:
> Hi,
> I am using RIOT-OS in STM32F4discovery. The hello world program runs 
> very well. Unfortunately I can *compile* the lis3dh example (located 
> in /RIOT/tests/driver_lis3dh) but the program didn’t run on the board 
> correctly. Because I read 255 from the *LIS3DH_REG_WHO_AM_I* Register. 
> Did you have any idea how to let the lis3dh example run correctly in 
> STM32F4discovery properly.
>
> Many thanks,
>
> Abdel
>
>
> Similar to the hello world program, I copied the 
> /RIOT/tests/driver_lis3dh in a new directory.
> I added at the beginning of the main program:
>
> #include <stdio.h>
> #include "board.h"
> #include "xtimer.h"
> #include "periph/spi.h"
> #include "periph/gpio.h"
> #include "lis3dh.h"
> #include "vtimer.h"
>
> #define     LIS3DH_CS   GPIO_PIN(PORT_E, 3)
> #define     LIS3DH_SPI   SPI_0
> #define     LIS3DH_INT1   GPIO_PIN(PORT_E, 0)
> #define     LIS3DH_INT2   GPIO_PIN(PORT_E, 1)
>
> I used the following Makefile:
>
> APPLICATION = driver_lis3dh
> #include ../Makefile.tests_common
> RIOTBASE ?= $(CURDIR)/../RIOT
> QUIET ?= 1
> FEATURES_REQUIRED = periph_spi periph_gpio
>
> USEMODULE += lis3dh
> USEMODULE += xtimer
> USEMODULE += vtimer
>
>
> include $(RIOTBASE)/Makefile.include
>
>
> _______________________________________________
> users mailing list
> users at riot-os.org
> https://lists.riot-os.org/mailman/listinfo/users

-- 
Peter Kietzmann

Hamburg University of Applied Sciences
Dept. Informatik, Internet Technologies Group
Berliner Tor 7, 20099 Hamburg, Germany
Fon: +49-40-42875-8426
Web: http://www.haw-hamburg.de/inet

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/users/attachments/20151116/8438e71c/attachment.html>


More information about the users mailing list