cancel
Showing results for 
Search instead for 
Did you mean: 

From where should I start to programming my lis2dw12 with STM32L4 board.

MAndr.233
Associate III

My journey with microcontrollers just have started a few months ago. I've bought an NUCLEO-L476RG board and an STEVAL-MKI179V.

I've started by doing simple things as turnning on LEDs and send messages through serial port using HAL code.

Now I want to acquire data from my accelarometer and send it by serial port, or doing plots with that. However, I've no ideia from where should I start. I've already used cubeMX to generate LIS2dw12 drivers, but I did not find any good examples which uses this generated code. Any one have good references about that?

Thanks in advance,

1 REPLY 1
Eleon BORLINI
ST Employee

Hi @Community member​ , I believe you have at least a couple of way to get your target.

  1. As 1st approach, you can start from an existing project / library package, such as the X-CUBE-MEMS1. This package supports both the STM32L476RG-Nucleo (path: Projects\STM32L476RG-Nucleo) and the lis2dw12 product drivers (path: Drivers\BSP\Components\lis2dw12). However, these libraries are based on the X-NUCLEO-IKS01A3 hardware, so in order to make the code compatible with your HW you maybe have to change the physical pin name inside the code;
  2. As 2nd approach, you can start from scratch and select the STM32L476RG-Nucleo from the STM32CubeProgrammer, and then add the C drivers for the lis2dw12  to your project. You can find them on free Github repository at this link.

Regards