Getting started with the X-CUBE-IKA02A1 multifunctional software expansion for STM32Cube

Similar documents
Getting started with X-CUBE-LED channel LED driver software expansion based on LED1642GW for STM32Cube

Getting started with the X-CUBE-NFC5 high performance HF reader / NFC initiator IC software expansion for STM32Cube

UM2045 User manual. Getting started with the X-CUBE-NFC3 near field communication transceiver software expansion for STM32Cube.

Getting started with the X-CUBE-53L1A1 Time-of-Flight long distance ranging sensor software expansion for STM32Cube

Getting started with the STSW-BCNKT01 software package for STEVAL-BCNKT01V1 based on STM32Cube

Getting started with the software package for STEVAL-STLKT01V1 based on STM32Cube

Bluetooth low energy profiles for the X-CUBE-BLE1 expansion for STM32Cube. Description

Getting started with the X-CUBE-MEMS1 motion MEMS and environmental sensor software expansion for STM32Cube

UM1853 User manual. STM32CubeF1 Nucleo demonstration firmware. Introduction

AN4624 Application note

Getting started with the X-CUBE-SPN2 two-axis stepper motor driver software expansion for STM32Cube

Getting started with the FP-SNS-ALLMEMS1 Bluetooth low energy and sensors software expansion for STM32Cube

P-NUCLEO-IKA02A1. STM32 Nucleo pack: electrochemical toxic gas sensor expansion board with CO sensor. Description. Features

Getting started with the P-NUCLEO-IKA02A1 STM32 Nucleo pack for electrochemical toxic gas sensor expansion board with CO sensor

Getting started with osxmotiongc gyroscope calibration library for X-CUBE-MEMS1 expansion for STM32Cube

Getting started with the software package for digital MEMS microphones in X-CUBE-MEMSMIC1 expansion for STM32Cube

UM2232. Getting started with the IO-Link demonstration kit firmware. User manual. Introduction

Getting started with the X-CUBE-SPN3 high power stepper motor driver software expansion for STM32Cube

UM2204. Getting started with STM32CubeH7 for STM32H7 Series. User manual. Introduction

Getting started with the software package for L6474 stepper motor driver X-CUBE-SPN1 expansion for STM32Cube

STSW-BLUENRG1-DK. BlueNRG-1, BlueNRG-2 DK SW package

P-NUCLEO-USB001. STM32 Nucleo pack for USB Type-C and Power Delivery. Features. Description

Getting started with the FP-NET-6LPBLE1 function pack for 6LoWPAN IoT node connection to a smartphone via BLE interface

P-NUCLEO-USB001. STM32 Nucleo pack for USB Type-C and Power Delivery Data brief. Features. Description

Getting started with osxmotionmc magnetometer calibration library for X-CUBE-MEMS1 expansion for STM32Cube

USB Type-C and Power Delivery Nucleo pack with NUCLEO-F072RB expansion board based on STUSB1602. Description

Getting started with MotionPM real-time pedometer library in X CUBE-MEMS1 expansion for STM32Cube

Getting started with STEVAL-IDB007V1 and STEVAL-IDB008V1 evaluation boards

Getting started with the FP-IND-PLCWIFI1 function pack for PLC management via Wi-Fi

IoT node with BLE connectivity, digital microphone, environmental and motion sensors, motion and audio middleware libraries.

Getting started with MotionPM real-time pedometer library in X-CUBE-MEMS1 expansion for STM32Cube

Getting started with VL53L0X ranging and gesture detection sensor software expansion for STM32Cube

UM2350. Getting started with MotionPW real-time pedometer for wrist library in X-CUBE-MEMS1 expansion for STM32Cube. User manual.

Getting started with MotionMC magnetometer calibration library in X-CUBE-MEMS1 expansion for STM32Cube

32F412GDISCOVERY. Discovery kit with STM32F412ZG MCU. Features. Description

UM2276. Getting started with MotionSD standing vs sitting desk detection library in X-CUBE-MEMS1 expansion for STM32Cube. User manual.

USB Type-C and Power Delivery Nucleo pack with NUCLEO-F072RB expansion board based on the STUSB1602

NUCLEO-L433RC-P NUCLEO-L452RE-P

UM2194. Getting started with MotionAW activity recognition for wrist library in X-CUBE-MEMS1 expansion for STM32Cube. User manual.

UM2216 User manual. Getting started with MotionFA fitness activity library in X CUBE MEMS1 expansion for STM32Cube. Introduction

UM2192. Getting started with MotionMC magnetometer calibration library in X-CUBE-MEMS1 expansion for STM32Cube. User manual.

NUCLEO-L496ZG. STM32 Nucleo-144 board. Features. Description

Getting started with MotionAR activity recognition library in X-CUBE-MEMS1 expansion for STM32Cube

STM32L4R9I-EVAL. Evaluation board with STM32L4R9AI MCU. Features

Getting started with the STM32 Nucleo pack for USB Type-C and Power Delivery with the Nucleo-F072RB board and the STUSB1602

STM32H7x3I-EVAL. Evaluation board with STM32H7x3XI MCUs. Data brief. Features

Getting started with MotionAR activity recognition library in X-CUBE-MEMS1 expansion for STM32Cube

Getting started with osxacousticsl real-time sound source localization software expansion for STM32Cube

UM1727 User manual. Getting started with STM32 Nucleo board software development tools. Introduction

UM1754 User manual. Getting started with STM32CubeL0 firmware package for STM32L0 series. Introduction

Getting started with FP-SNS-6LPNODE1 software for IoT sensor node connection to 6LoWPAN networks using sub-1ghz RF

AN4515 Application note

32L476GDISCOVERY. Discovery kit with STM32L476VG MCU. Features. Description

STSW-STWBCFWDT. STWBC firmware downloader tool. Description. Features

Running a simple 6LowPAN network consisting of one receiver node and one or more sensor nodes in a Sub-1GHz RF band

32F746GDISCOVERY. Discovery kit with STM32F746NG MCU. Features. Description

32F469IDISCOVERY. Discovery kit with STM32F469NI MCU. Features. Description

UM2051 User manual. Getting started with the STM32 Nucleo pack for USB Type-C and Power Delivery. Introduction

DT0095 Design tip. Datalogging the SensorTile through a PC. Purpose and benefits. Description

X-NUCLEO-53L1A1. Long distance ranging Time-of-Flight sensor expansion board based on VL53L1X for STM32 Nucleo. Description.

How to upgrade the firmware on the STEVAL-USBC2DP USB Type-C to DisplayPort adapter

STSW-BNRGUI. BlueNRG GUI SW package. Data brief. Features. Description

P-NUCLEO-53L1A1. VL53L1X nucleo pack with X-NUCLEO-53L1A1 expansion board and STM32F401RE nucleo board. Description. Features

STM32SnippetsL0. STM32L0xx Snippets firmware package. Features. Description

Getting started with the digital MEMS microphone expansion board based on MP34DT01-M for STM32 Nucleo

Getting started with X-NUCLEO-IHM06A1 low voltage stepper motor driver expansion board based on STSPIN220 for STM32 Nucleo

EVALKITSTKNX. Miniature transceiver STKNX evaluation and development kit. Features

P-NUCLEO-53L0A1. VL53L0X Nucleo pack with ranging, gesture detection sensor expansion board and STM32F401RE. Description. Features

UM1677 User manual. Getting started with STM32F030 Value Line Discovery development tools. Introduction

STSW-BNRG-Mesh. Mesh over Bluetooth low energy. Features. Description. Applications

AN4749 Application note

EVLKSTCOMET10-1. STCOMET smart meter system-on-chip development kit. Features

Using the GPIOs and interrupt controller to drive LEDs on STM8 Nucleo-64 boards

UM1862 User manual. Getting started with STM32F411E Discovery software Development Tools. Introduction

TN1235 Technical note

X-NUCLEO-53L0A1. Ranging and gesture detection sensor expansion board based on VL53L0X for STM32 Nucleo. Description. Features

UM2495. High performance HF reader / NFC initiator IC software expansion for NUCLEO-8S208RB. User manual. Introduction

AN4872 Application note

Quick Start Guide. High power stepper motor driver expansion board based on powerstep01 for STM32 Nucleo (X-NUCLEO-IHM03A1)

RN0084 Release note. ST-LINK/V2 firmware upgrade. About this release note

P-NUCLEO-6180X2. Proximity, gesture, ambient light sensor expansion board based on VL6180X for STM32L053R8. Description. Features

Quick Start Guide. Stepper motor driver expansion board based on L6474 for STM32 Nucleo (X-NUCLEO-IHM01A1) Version 1.2.

External memory code execution on STM32F7x0 Value line and STM32H750 Value line MCUs

STM32 embedded target for MATLAB and Simulink release 3.1. Summary for STM32 embedded target for MATLAB and Simulink release 3.1:

STM3220G-SK/KEI. Keil starter kit for STM32F2 series microcontrollers (STM32F207IG MCU) Features. Description

UM2084 User manual. Getting started with the ultra-low-power STM32 and LoRa Nucleo pack. Introduction

Quick Start Guide. Bipolar stepper motor driver expansion board based on L6208 for STM32 Nucleo (X-NUCLEO-IHM05A1) Version 1.1.

Quick Start Guide. Long distance ranging ToF sensor expansion board based on VL53L1X for STM32 Nucleo (X-NUCLEO-53L1A1) Version (February 20, 2018)

How to configure the BlueNRG-1 and BlueNRG-2 devices in network coprocessor mode. Main components Bluetooth Low Energy wireless system-on-chip

Getting started with the ultra-low-power STM32 and LoRa Nucleo pack

EVALKIT-VL6180X. VL6180X plug-in and STM32 F401RE Nucleo board explorer kit. Description. Features

Getting started with X-NUCLEO-53L1A1 long distance ranging ToF sensor expansion board based on VL53L1X for STM32 Nucleo

AN4869 Application note

UM2361. Getting started with the ST BlueNRG-Mesh ios application. User manual. Introduction

AN4894 Application note

UM1754. Getting started with STM32CubeL0 for STM32L0 Series. User manual. Introduction

Version (Apr 28, 2016)

Getting started with osxacousticbf real-time beam forming software expansion for STM32Cube

AN4045 Application note

Motor control power board based on the SLLIMM-nano 2 nd series

Transcription:

User manual Getting started with the X-CUBE-IKA02A1 multifunctional software expansion for STM32Cube Introduction The X-CUBE-IKA02A1 expansion software package for STM32Cube runs on the STM32 microcontrollers and can be used to read the analog gas concentration value, reference voltage and temperature from the STLM20 sensor. The software library sets the appropriate sensor sensitivity and performs the compensation over the temperature range. The expansion is built on STM32Cube software technology to ease portability across different STM32 microcontrollers. It is compatible with the P-NUCLEO-IKA02A1development kit. The software comes with a sample implementation to help you get started. October 2017 DocID030670 Rev 2 1/13 www.st.com

Contents UM2230 Contents 1 What is STM32Cube?... 4 1.1 How does this software complement STM32Cube?... 4 1.2 STM32Cube architecture... 4 2 X-CUBE-IKA02A1 software expansion for STM32Cube... 7 2.1 Overview... 7 2.2 Architecture... 7 2.3 Folder structure... 8 2.4 APls... 8 2.5 Gas sensor sensitivity setting... 9 2.6 Gain setting... 10 2.7 Gas concentration reading sample... 10 2.8 Unicleo GUI sample... 10 3 Revision history... 12 2/13 DocID030670 Rev 2

List of figures List of figures Figure 1: Firmware architecture... 5 Figure 2: X-CUBE-IKA02A1 software architecture... 8 Figure 3: X-CUBE-IKA02A1 package folder structure... 8 Figure 4: Data matrix reading from TGS5141... 9 Figure 5: P-NUCLEO-IKA02A1 expansion board connected to Tera Term: firmware output with no gas presence... 10 Figure 6: Unicleo Custom Fields window... 11 DocID030670 Rev 2 3/13

What is STM32Cube? UM2230 1 What is STM32Cube? STMCube is an STMicroelectronics initiative that helps you reduce development effort, time and cost. STM32Cube covers the STM32 portfolio. STM32Cube version 1.x includes: STM32CubeMX, a graphical software configuration tool that allows the generation of C initialization code using graphical wizards. A comprehensive embedded software platform specific to each series (such as the STM32CubeF4 for the STM32F4 series), which includes: the STM32Cube HAL embedded abstraction-layer software, ensuring maximized portability across the STM32 portfolio a consistent set of middleware components such as RTOS, USB, TCP/IP and graphics all embedded software utilities with a full set of examples 1.1 How does this software complement STM32Cube? This software is based on the STM32CubeHAL hardware abstraction layer for the STM32 microcontroller. The package extends STM32Cube by providing a board support package (BSP) for the gas sensing expansion board. Several sample projects in the Projects\Multi\Examples directory are available for developers to use and start experimenting with the code. These samples are ready to be compiled using Keil (MDK-ARM) or IAR (EWARM): Gas concentration reading sample: reads the analog value of gas concentration, temperature and reference voltage performs compensation over the temperature range prints data to serial line Unicleo GUI sample: performs the same readings and compensation of the gas concentration reading sample shows data in graphs via the user-friendly GUI is available at www.st.com 1.2 STM32Cube architecture The STM32Cube firmware solution is built around three independent levels that can easily interact with one another, as described in the diagram below. 4/13 DocID030670 Rev 2

Figure 1: Firmware architecture What is STM32Cube? Level 0: This level is divided into three sub-layers: Board Support Package (BSP): this layer offers a set of APIs relative to the hardware components in the hardware boards (Audio codec, IO expander, Touchscreen, SRAM driver, LCD drivers. etc ); it is based on modular architecture allowing it to be easily ported on any hardware by just implementing the low level routines. It is composed of two parts: Component: is the driver relative to the external device on the board and not related to the STM32, the component driver provides specific APIs to the external components of the BSP driver, and can be ported on any other board. BSP driver: links the component driver to a specific board and provides a set of easy to use APIs. The API naming convention is BSP_FUNCT_Action(): e.g., BSP_LED_Init(), BSP_LED_On(). Hardware Abstraction Layer (HAL): this layer provides the low level drivers and the hardware interfacing methods to interact with the upper layers (application, libraries and stacks). It provides generic, multi-instance and function-oriented APIs to help offload user application development time by providing ready to use processes. For example, for the communication peripherals (I²C, UART, etc.) it provides APIs for peripheral initialization and configuration, data transfer management based on polling, interrupt or DMA processes, and communication error management. The HAL Drivers APIs are split in two categories: generic APIs providing common, generic functions to all the STM32 series and extension APIs which provide special, customized functions for a specific family or a specific part number. Basic peripheral usage examples: this layer houses the examples built around the STM32 peripherals using the HAL and BSP resources only. Level 1: This level is divided into two sub-layers: Middleware components: set of libraries covering USB Host and Device Libraries, STemWin, FreeRTOS, FatFS, LwIP, and PolarSSL. Horizontal interaction among the DocID030670 Rev 2 5/13

What is STM32Cube? UM2230 components in this layer is performed directly by calling the feature APIs, while vertical interaction with low-level drivers is managed by specific callbacks and static macros implemented in the library system call interface. For example, FatFs implements the disk I/O driver to access a microsd drive or USB Mass Storage Class. Examples based on the middleware components: each middleware component comes with one or more examples (or applications) showing how to use it. Integration examples that use several middleware components are provided as well. Level 2: This level is a single layer with a global, real-time and graphical demonstration based on the middleware service layer, the low level abstraction layer and basic peripheral usage applications for board-based functions. 6/13 DocID030670 Rev 2

X-CUBE-IKA02A1 software expansion for STM32Cube 2 X-CUBE-IKA02A1 software expansion for STM32Cube 2.1 Overview The X-CUBE-IKA02A1 software package expands the functionality of STM32Cube. The key features of package are: Complete middleware to build application sensing the concentration of different gases depending on the sensor used High portability across different MCU families thanks to STM32Cube A sample application to transmit real-time data to PC using serial communication A Windows PC applications to log sensor data Free, user-friendly license terms Sample implementations available for the P-NUCLEO-IKA02A1 development kit. The package also includes a sample application that the developer can use to start experimenting with the code. 2.2 Architecture This software is a fully compliant expansion for STM32Cube that enables the development of applications using different gas sensors. The software is based on the STM32CubeHAL hardware abstraction layer for the STM32 microcontroller. The package extends STM32Cube with a board support package (BSP) for the sensor expansion board and a sample application for serial communication with a PC. The software layers used by the application software to access the sensor expansion board are: The STM32Cube HAL driver layer provides a simple, generic and multi-instance set of APIs (application programming interfaces) to interact with the upper layers (application, libraries and stacks). It includes generic and extension APIs and is based on a generic architecture which allows the layers built on it (such as the middleware layer) to implement their functions without requiring specific microcontroller unit (MCU) configuration data. This structure improves library code re-usability and guarantees high portability across other devices. The board support package (BSP) layer provides supporting software for the peripherals on the STM32 Nucleo board, except for the MCU. It has a set of APIs to provide a programming interface for certain board-specific peripherals (e.g., the LED, the user button, etc.) and allow identification of the specific board version. For the sensor expansion board, it provides the programming interface for various inertial and environmental sensors and provides support for initializing and reading sensor data. DocID030670 Rev 2 7/13

X-CUBE-IKA02A1 software expansion for STM32Cube Figure 2: X-CUBE-IKA02A1 software architecture UM2230 2.3 Folder structure Figure 3: X-CUBE-IKA02A1 package folder structure The following folders are included in the software package: 2.4 APls The Drivers folder contains the HAL drivers, the board-specific drivers for each supported board or hardware platform (including those for the on-board components), and the CMSIS vendor-independent hardware abstraction layer for the Cortex-M processor series. The Projects folder contains a sample application for the NUCLEO-L053R8, NUCLEO-F401RE and NUCLEO-L476RG platforms to access sensor data; projects are provided for two development environments (IAR Embedded Workbench for ARM and RealView MDKARM Microcontroller Development Kit). The X-CUBE-IKA02A1 software package provides simple APIs to read the analog values from the P-NUCLEO-IKA02A1 expansion board. Solder bridges must be in line with the header file x_nucleo_ika02a1.h a. a Refer to UM2247 at www.st.com for solder bridge setting. 8/13 DocID030670 Rev 2

X-CUBE-IKA02A1 software expansion for STM32Cube Basic functions, such as converting analog to digital values using STM32 ADC converters, are handled by stm32fxxx_nucleo_ika02a1.c. The BSP layer for the P-NUCLEO-IKA02A1 expansion board is provided by x_nucleo_ika02a1.c. Some functions directly provide gas concentration readings in ppm value, temperature and function to perform compensation over temperature: to read temperature in C: Get_Temperature() to get gas concentration in ppm: Get_Gas_concentration( ) to calculate compensated concentration: Get_comp_gas_concentration( ) To provide appropriate compensation over temperature the lookup table, sensor_calibration_tgs5141.h, with the related sensitivity must be filled in. By default, all the parameters are set to provide the best performance with the TGS5141 sensor. 2.5 Gas sensor sensitivity setting The sensitivity of any electrochemical sensor in unique to that sensor. Even devices produced consecutively on the same day can vary greatly in sensitivity. For the TGS5141, the output current per CO concentration can vary from 1.2nA/ppm to 3.2nA/ppm. The sensor sensitivity must therefore be calibrated in the gas chamber before embedding the sensor in the final application. The P-NUCLEO-IKA02A1 comes with the Figaro TGS5141 sensor, which has a data matrix with calibration information that can be read by a smartphone with an appropriate application; the first four digits represent the sensor sensitivity in pa/ppm. Sample routines are provided in the X-CUBE-IKA02A1 package which count values while compensating for different sensitivity parameters that can be easily modified and even stored in the STM32 microcontroller Flash. Figure 4: Data matrix reading from TGS5141 DocID030670 Rev 2 9/13

X-CUBE-IKA02A1 software expansion for STM32Cube 2.6 Gain setting UM2230 The P-NUCLEO-IKA02A1 development kit for gas sensing allows the gain to be set with ease a. The X-CUBE-IKA02A1 package contains routines that compensate for gain as well as sensitivity during counting. 2.7 Gas concentration reading sample The P-NUCLEO-IKA02A1 expansion board is pre-programmed with basic firmware and calibration values stored in the Flash memory. To read these data, you only have to connect the board to the PC with installed drivers for STM32 Nucleo boards (STSW-LINK009) and a terminal application. Once the virtual COM port is detected, you can open it by setting up 115200 baud rate, 8 bits and no parity. Figure 5: P-NUCLEO-IKA02A1 expansion board connected to Tera Term: firmware output with no gas presence The P-NUCLEO-IKA02A1 board can host different sensor types and the user can modify the gain. The default application allows changing the sensitivity, gain and new value storage in the Flash memory. The dialog can be invoked by sending s to adjust the sensitivity or g to adjust the gain. 2.8 Unicleo GUI sample The ST GUI application, Unicleo, available at www.st.com, contains a Custom Fields window which fully supports the P-NUCLEO-IKA02A1 expansion board to show the measured values in a graph. a See the P-NUCLEO-IKA02A1 hardware user manual for more information. 10/13 DocID030670 Rev 2

Figure 6: Unicleo Custom Fields window X-CUBE-IKA02A1 software expansion for STM32Cube DocID030670 Rev 2 11/13

Revision history UM2230 3 Revision history Table 1: Document revision history Date Version Changes 05-Jul-2017 1 Initial release. 24-Oct-2017 2 Updated Section 1.1: "How does this software complement STM32Cube?", Section 2.3: "Folder structure" and Section 2.4: "APls". Added Section 2.7: "Gas concentration reading sample" and Section 2.8: "Unicleo GUI sample". 12/13 DocID030670 Rev 2

IMPORTANT NOTICE PLEASE READ CAREFULLY STMicroelectronics NV and its subsidiaries ( ST ) reserve the right to make changes, corrections, enhancements, modifications, and improvements to 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. Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the design of Purchasers products. No license, express or implied, to any intellectual property right is granted by ST herein. Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product. ST and the ST logo are trademarks of ST. All other product or service names are the property of their respective owners. Information in this document supersedes and replaces information previously supplied in any prior versions of this document. 2017 STMicroelectronics All rights reserved DocID030670 Rev 2 13/13