GPSProvider wrapper library for STMicroelectronics' X-NUCLEO-GNSS1A1 Expansion Board.

Dependents:   TeseoLocation

X_NUCLEO_GNSS1A1 Library

GPS_Provider wrapper library for STMicroelectronics' X-NUCLEO-GNSS1A1 component.

Overview

This library includes drivers for ST’s Teseo-LIV3F Global Navigation Satellite System (GNSS) device and middleware for the NMEA protocol support. This firmware package implements the port of the GPS_Provider to STMicroelectronics' X-NUCLEO-GNSS1A1 GNSS Expansion Board.

The key features of the library are:

  • Complete software to build applications using Teseo-LIV3F GNSS device
  • Middleware for the NMEA protocol support

Furthermore the library provides the following advanced features:

  • Geofencing - allows the Teseo-LIV3F receiver to raise a NMEA message when the resolved GNSS position is close to or entering or exiting from a specific circle
  • Odometer - provides information on the traveled distance using only the resolved GNSS position
  • Data Logging - allows the Teseo-LIV3F receiver to save locally on the flash the resolved GNSS position to be retrieved on demand from the Host

Hardware description

The X-NUCLEO-GNSS1A1 is a Global Navigation Satellite System Expansion Board usable with the STM32 Nucleo system and other Arduino compatible platforms. It is designed around the STMicroelectronics Teseo-LIV3F GNSS receiver IC working on multiple constellations (GPS/Galileo/Glonass/BeiDou/QZSS).

The Teseo-LIV3F module is designed for top performance in a minimal space. Within its 10x10mm compact size, Teseo-LIV3F offers superior accuracy thanks to the on board 26MHz Temperature Compensated Crystal Oscillator (TCXO) and a reduced Time To First Fix (TTFF) relying to its dedicated 32KHz Real Time Clock (RTC) oscillator.

The X-NUCLEO-GNSS1A1, hosting the Teseo-LIV3F, is compatible with Arduino UNO R3 connector layout and interfaces with the MCU via the UART channel. To connect by serial port the GNSS receiver and the host the following parameters must be used:

  • 8 data bits
  • No parity
  • 1 stop bit
  • 9600 bauds

A GPS/GLONASS/Beidou antenna, distributed along with the X-NUCLEO-GNSS1A1 Expansion Board, must be connected to the antenna connector present on the Expansion Board. For the X-NUCLEO-GNSS1A1 proper operations, the following jumper settings must be used:

  • J2 open
  • J3 closed
  • J4 closed
  • J5 open
  • J6 closed
  • J7 closed
  • J8 open
  • J9 closed
  • J10 open
  • J11 closed
  • J12 closed
  • J13 closed
  • J14 closed
  • J15 closed

Tested platforms

This firmware has been tested on STM32 NUCLEO-F401RE

Example Application

To run GNSS example applications using X-NUCLEO-GNSS1A1 Expansion Board based on mbed OS, please refer to TeseoLocation page.

Committer:
apalmieri
Date:
Fri Nov 09 17:06:11 2018 +0000
Revision:
0:a77f1f1f8318
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
apalmieri 0:a77f1f1f8318 1 /**
apalmieri 0:a77f1f1f8318 2 *******************************************************************************
apalmieri 0:a77f1f1f8318 3 * @file NMEA_utils.c
apalmieri 0:a77f1f1f8318 4 * @author AST / Central Lab
apalmieri 0:a77f1f1f8318 5 * @version V1.0.0
apalmieri 0:a77f1f1f8318 6 * @date 18-May-2017
apalmieri 0:a77f1f1f8318 7 * @brief NMEA utilities
apalmieri 0:a77f1f1f8318 8 *
apalmieri 0:a77f1f1f8318 9 *******************************************************************************
apalmieri 0:a77f1f1f8318 10 * @attention
apalmieri 0:a77f1f1f8318 11 *
apalmieri 0:a77f1f1f8318 12 * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
apalmieri 0:a77f1f1f8318 13 *
apalmieri 0:a77f1f1f8318 14 * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
apalmieri 0:a77f1f1f8318 15 * You may not use this file except in compliance with the License.
apalmieri 0:a77f1f1f8318 16 * You may obtain a copy of the License at:
apalmieri 0:a77f1f1f8318 17 *
apalmieri 0:a77f1f1f8318 18 * http://www.st.com/software_license_agreement_liberty_v2
apalmieri 0:a77f1f1f8318 19 *
apalmieri 0:a77f1f1f8318 20 * Redistribution and use in source and binary forms, with or without modification,
apalmieri 0:a77f1f1f8318 21 * are permitted provided that the following conditions are met:
apalmieri 0:a77f1f1f8318 22 * 1. Redistributions of source code must retain the above copyright notice,
apalmieri 0:a77f1f1f8318 23 * this list of conditions and the following disclaimer.
apalmieri 0:a77f1f1f8318 24 * 2. Redistributions in binary form must reproduce the above copyright notice,
apalmieri 0:a77f1f1f8318 25 * this list of conditions and the following disclaimer in the documentation
apalmieri 0:a77f1f1f8318 26 * and/or other materials provided with the distribution.
apalmieri 0:a77f1f1f8318 27 * 3. Neither the name of STMicroelectronics nor the names of its contributors
apalmieri 0:a77f1f1f8318 28 * may be used to endorse or promote products derived from this software
apalmieri 0:a77f1f1f8318 29 * without specific prior written permission.
apalmieri 0:a77f1f1f8318 30 *
apalmieri 0:a77f1f1f8318 31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
apalmieri 0:a77f1f1f8318 32 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
apalmieri 0:a77f1f1f8318 33 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
apalmieri 0:a77f1f1f8318 34 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
apalmieri 0:a77f1f1f8318 35 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
apalmieri 0:a77f1f1f8318 36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
apalmieri 0:a77f1f1f8318 37 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
apalmieri 0:a77f1f1f8318 38 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
apalmieri 0:a77f1f1f8318 39 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
apalmieri 0:a77f1f1f8318 40 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
apalmieri 0:a77f1f1f8318 41 *
apalmieri 0:a77f1f1f8318 42 ********************************************************************************
apalmieri 0:a77f1f1f8318 43 */
apalmieri 0:a77f1f1f8318 44
apalmieri 0:a77f1f1f8318 45 #include "string.h"
apalmieri 0:a77f1f1f8318 46 #include "NMEAUtils.h"
apalmieri 0:a77f1f1f8318 47
apalmieri 0:a77f1f1f8318 48 /** @defgroup Middlewares
apalmieri 0:a77f1f1f8318 49 * @brief Contains all platform independent modules (eg. NMEA Sentence Parser, ...).
apalmieri 0:a77f1f1f8318 50 * @{
apalmieri 0:a77f1f1f8318 51 */
apalmieri 0:a77f1f1f8318 52
apalmieri 0:a77f1f1f8318 53 /** @defgroup ST
apalmieri 0:a77f1f1f8318 54 * @{
apalmieri 0:a77f1f1f8318 55 */
apalmieri 0:a77f1f1f8318 56
apalmieri 0:a77f1f1f8318 57 /** @defgroup LIB_NMEA
apalmieri 0:a77f1f1f8318 58 * @{
apalmieri 0:a77f1f1f8318 59 */
apalmieri 0:a77f1f1f8318 60
apalmieri 0:a77f1f1f8318 61 /** @defgroup NMEA_UTILS
apalmieri 0:a77f1f1f8318 62 * @{
apalmieri 0:a77f1f1f8318 63 */
apalmieri 0:a77f1f1f8318 64
apalmieri 0:a77f1f1f8318 65 /** @addtogroup NMEA_UTILS_PUBLIC_FUNCTIONS
apalmieri 0:a77f1f1f8318 66 * @{
apalmieri 0:a77f1f1f8318 67 */
apalmieri 0:a77f1f1f8318 68 /**
apalmieri 0:a77f1f1f8318 69 * @brief Scans a string with UTC info and fills all fields of a
apalmieri 0:a77f1f1f8318 70 * UTC_Info struct
apalmieri 0:a77f1f1f8318 71 * @param utc_str NMEA UTC string
apalmieri 0:a77f1f1f8318 72 * @param utc The UTC_Info struct to fill
apalmieri 0:a77f1f1f8318 73 * @retval None
apalmieri 0:a77f1f1f8318 74 */
apalmieri 0:a77f1f1f8318 75 void scan_utc (char* utc_str, UTC_Info* utc) {
apalmieri 0:a77f1f1f8318 76
apalmieri 0:a77f1f1f8318 77 sscanf(utc_str, "%d", &utc->utc);
apalmieri 0:a77f1f1f8318 78
apalmieri 0:a77f1f1f8318 79 utc->hh = (utc->utc / 10000);
apalmieri 0:a77f1f1f8318 80 utc->mm = (utc->utc - (utc->hh * 10000)) / 100;
apalmieri 0:a77f1f1f8318 81 utc->ss = utc->utc - ((utc->hh * 10000) + (utc->mm * 100));
apalmieri 0:a77f1f1f8318 82
apalmieri 0:a77f1f1f8318 83 return;
apalmieri 0:a77f1f1f8318 84 }
apalmieri 0:a77f1f1f8318 85
apalmieri 0:a77f1f1f8318 86 /**
apalmieri 0:a77f1f1f8318 87 * @brief Scans a bidimensional array with longitude and latitude infos and
apalmieri 0:a77f1f1f8318 88 * fills the relative fields of a Coords struct
apalmieri 0:a77f1f1f8318 89 * @param xy_str NMEA string with latitude and longitude infos
apalmieri 0:a77f1f1f8318 90 * @param str_offset NMEA string with latitude and longitude infos
apalmieri 0:a77f1f1f8318 91 * @param utc The Coords struct to fill
apalmieri 0:a77f1f1f8318 92 * @retval None
apalmieri 0:a77f1f1f8318 93 */
apalmieri 0:a77f1f1f8318 94 void scan_xy (char* xy_str, uint8_t str_offset, Coords* xy)
apalmieri 0:a77f1f1f8318 95 {
apalmieri 0:a77f1f1f8318 96 //printf("NMEA (xy_str): %s\n\r", xy_str);
apalmieri 0:a77f1f1f8318 97 sscanf(xy_str, "%lf", &xy->lat);
apalmieri 0:a77f1f1f8318 98 sscanf(xy_str+str_offset, "%c", &xy->ns);
apalmieri 0:a77f1f1f8318 99 sscanf(xy_str+(2*str_offset), "%lf", &xy->lon);
apalmieri 0:a77f1f1f8318 100 sscanf(xy_str+(3*str_offset), "%c", &xy->ew);
apalmieri 0:a77f1f1f8318 101
apalmieri 0:a77f1f1f8318 102 return;
apalmieri 0:a77f1f1f8318 103 }
apalmieri 0:a77f1f1f8318 104
apalmieri 0:a77f1f1f8318 105 /**
apalmieri 0:a77f1f1f8318 106 * @}
apalmieri 0:a77f1f1f8318 107 */
apalmieri 0:a77f1f1f8318 108
apalmieri 0:a77f1f1f8318 109 /**
apalmieri 0:a77f1f1f8318 110 * @}
apalmieri 0:a77f1f1f8318 111 */
apalmieri 0:a77f1f1f8318 112
apalmieri 0:a77f1f1f8318 113 /**
apalmieri 0:a77f1f1f8318 114 * @}
apalmieri 0:a77f1f1f8318 115 */
apalmieri 0:a77f1f1f8318 116
apalmieri 0:a77f1f1f8318 117 /**
apalmieri 0:a77f1f1f8318 118 * @}
apalmieri 0:a77f1f1f8318 119 */
apalmieri 0:a77f1f1f8318 120
apalmieri 0:a77f1f1f8318 121 /**
apalmieri 0:a77f1f1f8318 122 * @}
apalmieri 0:a77f1f1f8318 123 */