This post was last edited by lb8820265 on 2019-7-28 20:41
I used to experience the routines first, but this time I did something different and used CubeMX to create a new routine. The main reason was that the MEMS1 routine library page on the official website crashed, which made me look for a solution everywhere . I would like to thank @littleshrimp and @hujj for providing the routine library!
New Construction
First download STM32CubeMX, the latest version is 5.30 . Create a new project with CubeMX, and then select "Board Selector". Because I have a NUCLEO-F411RE board, I search for the corresponding board and click "Start Project". A blank project based on NUCLEO-F411RE is created.
Initialize IIC
By studying the information of IKS01A3, we can know that all sensors on the board communicate through an I2C interface. The interface is I2C1, and the corresponding pins are B8 and B9. Select I2C1 in the configuration interface, select the mode as fast mode, and adjust the pins to B8 and B9.
Add x-cube-mems1 library
Click the "Additional Software" button on the interface, and the Additional Software Components selection box will pop up. Then check the " Board Extension " and " Device " check boxes. On the right, you can choose to download the 6.2.0 version of the firmware. After downloading, you can choose various applications under Device_Application . Here I choose the " IKS01A3_DataLogTeminal " application. This routine is included in the 6.2 version of the firmware package. Then select " IKS01A3 " under " Board_Externsion_MEMS ", and finally click the " OK " button in the lower right corner of the box .
Configuration Application Engineering
Back to the configuration interface, you will find that there is a MEMS firmware library in the configurable list. Click to enter and check the "Board Extension MEMS" and "Device Application" checkboxes on the right. Finally, configure the options below as shown below.
Generate Project
Click the "Project Manager" tab on the top tab, set the project name and save path under "Project", select IDE, and finally click "GENERATE CODE" in the upper right corner. The project is generated. If the F4 firmware package is not downloaded, the firmware will be downloaded automatically.
Engineering Demonstration
Use IAR to open the project, compile and run. Plug in the two boards as shown, then open the serial port assistant, with a baud rate of 115200, and you will receive data from all sensors. You can find that the project generated in this way has the same effect as the routine in the firmware package.
References:
STMicroelectronics.X-CUBE-MEMS1_GettingStarted.pdf
(5.64 MB, downloads: 21)
Source code (decompress both files together):
lb_IKS01A3.zip
(11.21 MB, downloads: 297)
lb_IKS01A3.z01
(20 MB, downloads: 143)
This content is originally created by EEWORLD forum user lb8820265 . If you want to reprint or use it for commercial purposes, you must obtain the author's consent and indicate the source