cancel
Showing results for 
Search instead for 
Did you mean: 

Does STM32F4 Discovery (Disc1) have a built-in MEMS sensor? If yes, how can I use it in a bare-metal project using CMSIS headers?

Core_dump
Visitor

Hi everyone :waving_hand:,

I’m currently working on a bare-metal project using the STM32F4 Discovery (Disc1) board and developing my code purely with CMSIS header files (no HAL or CubeMX).

I wanted to check if this board has any onboard MEMS sensors (like accelerometer or gyroscope) — similar to what some older STM32 Discovery boards include.

If a MEMS sensor is present:

What is the exact sensor part number?

Which communication interface does it use (I2C/SPI)?

Are there any reference manuals or example register-level code available to initialize and read data using CMSIS?


If not available, could you suggest a good external MEMS sensor (like MPU6050 or LIS3DH) that works well with STM32F4 boards for motion or tilt detection?

My goal is to implement tilt or motion detection completely in bare-metal C without HAL drivers.

Any guidance, datasheets, or example code snippets would be really appreciated :folded_hands:

Thanks in advance!

 

1 REPLY 1
STTwo-32
ST Employee

Hello @Core_dump and welcome to the ST Community.

To check what are the MEMS available on your  board, you can refer to the schematic pack and the bill of material of your board (check the revision on your board). Those ressources are available here. For the examples you can have a look at this demonstration example (it is based on HAL). I suggest you to follow it and referring also to the Datasheet of the MEMS you can develop your own code based on the register access method that you are using (there is no register level official examples).

PS: on the DK board you are using there is a MEMS 3-axis accelerometer connected using SPI to the MCU). You can find the exact reference on the readme file of the example I’ve attached.

Best Regards.

STTwo-32

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.