Page 1
AN4594 Application note Getting started with the STM32 Nucleo and the sensor expansion board X-NUCLEO-IKS01A1 Introduction This document describes how to develop a sensor-based application using the STM32 Nucleo platform and the X-NUCLEO-IKS01A1 sensor expansion board, in the STM32Cube software environment. The sensor expansion board is a multi-sensor board with temperature, humidity, pressure and motion MEMS measuring sensors.
It provides an affordable and flexible way for users to try new ideas and build prototypes with any STM32 microcontroller lines. The Arduino™ connectivity support and ST Morpho headers make it easy to expand the functionality of the Nucleo open development platform with a wide range of specialized expansion boards to choose from.
AN4594 Getting started Figure 2. X-NUCLEO-IKS01A1 sensor expansion board Figure 3. Sensor expansion board connected to STM32 Nucleo board The X-CUBE-MEMS1 firmware and related documentation is available on st.com at http://www.st.com/x-nucleo. Software description The following software components are required to set up a suitable development environment for creating applications based on the sensor expansion board: •...
X-CUBE-MEMS1 is a package that contains firmware with the STM32 Cube framework that is compatible with the STM32 Nucleo and the X-NUCLEO-IKS01A1 boards. It has sample applications that can be used to obtain data from the sensors on the expansion board. The same sample applications are referenced in further sections of this document.
System setup guide This section describes how to setup different hardware components before writing and executing an application on the STM32 Nucleo board with the sensor expansion board. Sensors_Datalog GUI setup The Sensors_Datalog GUI included in the software package is a graphical user interface that can be used to interact and obtain data from the sensors on the sensor expansion board.
(MCU). This structure improves the library code reusability and facilitates portability to other devices. For detailed information regarding the STM32Cube HAL drivers API, please refer to the document “Description of STM32F4xx HAL drivers”, User manual UM1749, available from st.com at http://www.st.com/st-web- ui/static/active/en/resource/technical/document/user_manual/DM00113898.pdf. 8/16 DocID026958 Rev 1...
AN4594 Software overview Board support package (BSP) The board software package (BSP) includes support for the peripherals on the STM32 Nucleo board with a limited set of APIs that provides a programming interface for certain board-specific peripherals such as the LED, the user button, etc., and also facilitates identifying the specific board version.
4.1.1 Initialization Every application must first execute the following basic initialization steps in order to configure and set up the STM32 Nucleo with the sensor expansion board hardware and the software stack for correct operation. Initializing STM32Cube HAL The STM32Cube HAL library must be initialized so that the necessary hardware components are correctly configured.
AN4594 Guide for writing applications Reading data from sensor expansion board The BSP provides the API and the functionality for taking the data from sensors. Once the sensors are initialized we can get data from them using these functions: • BSP_HUM_TEMP_GetTemperature(float * Temp) This API gives the access to temperature sensor data.
Using the Sensors_Datalog application This section describes the Sensors_Datalog utility. The user must first ensure that the necessary drivers described in previous sections are installed and the STM32 Nucleo with the expansion board is connected to a PC. Please follow the sequence below: Check the windows “device manager”...
Page 13
AN4594 Using the Sensors_Datalog application Figure 7. Sampling interval selection You can save the log to a file that you can find in a folder called “SensorsDataLog”; or you can clear the log by pressing the “ClearLog” button. Check the “Plot” CheckBox to see a data log for the sensors that you have selected. Figure 8.
Page 14
Using the Sensors_Datalog application AN4594 Figure 9. Sensor data visualization in the Sensors_Datalog utility window 14/16 DocID026958 Rev 1...
AN4594 Revision history Revision history Table 2. Document revision history Date Revision Changes 19-Nov-2014 Initial release. DocID026958 Rev 1 15/16...
Page 16
ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on ST products before placing orders. ST products are sold pursuant to ST’s terms and conditions of sale in place at the time of order acknowledgement.
Need help?
Do you have a question about the STM32 Nucleo and is the answer not in the manual?
Questions and answers