element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Embedded and Microcontrollers
  • Technologies
  • More
Embedded and Microcontrollers
Blog C++ library for ST Teseo GPS - pt. 5: ready for a first (0.1) firmware release
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Embedded and Microcontrollers to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 21 Jul 2024 11:20 AM Date Created
  • Views 1317 views
  • Likes 6 likes
  • Comments 12 comments
  • raspberry
  • pico
  • uart
  • Teseo
  • gps
  • OO
  • teseo_c++
Related
Recommended

C++ library for ST Teseo GPS - pt. 5: ready for a first (0.1) firmware release

Jan Cumps
Jan Cumps
21 Jul 2024

The Teseo-LIV3 GPS module (as used in shabaz ' GPS / Galileo / BeiDou / GLONASS receiver) talks UART and I2C. I'm writing an OO driver for it, for embedded systems. The firmware is now ready for a release.

GitHub Release 0.1, with binaries.

image
image: actual output of the firmware for Pico

Functionality:

  • Talks to ST Teseo-LIV3 GPS in query-response mode.
    you send a query, and get the reply
  • UART and I2C supported.
    same functionality with both protocols.
  • predefined functionality for NMEA commands $GPGLL, $GLGSV, $GPRMC.
    low level write, read, and parse functions can be used for the other NMEA commands
  • reply validation.
    for the predefined functions, the library validates the NMEA status line
  • supports commands that return single and multiline lines of data.
    single line commands fill a string with the response.
    multiline commands fill a vector of strings with all response lines. The library reports the count of lines.
  • initialisation option.
    you can pre-program the Teseo to work in reply-response mode (persistent).
    but if you want to keep the factory settings, the library can configure the Teseo (nonpersistent)
  • platform independent.
    will work on any platform, that supports UART or I2C
    you provide the reader and writer for the protocol, and (optionally) a reset function.
    current firmware example tests the lib with a Raspberry Pico 

Pico connections for I2C, UART and shared functions

A connection deep dive in available in this post:  C++ library for ST Teseo GPS - pt. 4: PCB to Pico hardware connections . The instructions will work for different Teseo boards. I used the board that shabaz published on the e14 community:  Fun With Arduino, Global Navigation Satellite Systems (GNSS) and Teseo III .

Pico resources used only if you use I2C:

  • I2C0
  • SDA: GP16 (Pico I2C0 SDA)
  • SCL:  GP17 (Pico I2C0 SCL)
  • baud: 100 * 1000

for I2C, SDA connects to SDA and SCL to SCL. The PCB that I use has the pull-ups for I2C.

Pico resources used only if you use UART:

  • UART1
  • TX: GP4 (Pico UART1 RX)
  • RX:  GP5 (Pico UART1 Tx)
  • baud: 9600
  • UART1 RX interrupt

for UART, RX connects to TX and vice versa

Pico common resources:

  • RESET: GP18 (optional)
  • 5V: VBUS
  • 0V: GND

image
image: how to hook up the Teseo PCB to a Pico.

The binary firmware file (.uf2) - built for I2C -  can be downloaded from GitHub.

Next post:  C++ library for ST Teseo GPS - pt. 6: running library built-in requests, and free conversations 

visit the github repository (git clone https://github.com/jancumps/pico_gps_teseo.git)
view the online documentation
Link to all posts.

  • Sign in to reply
  • Jan Cumps
    Jan Cumps over 1 year ago

    Since the release, I've made a few changes to the structure:

    all pico specific code (init, reset, read and write) is moved out of main.cpp.
    These device dependent functions now reside in the port/pico subfolder.
    goal: make it easier to create ports for other controller families

    the library core files have their own github repository now,
    and I changed this project's git setup and build infra to use that repo as a subfolder.
    goal: make it easier for users to just get / use the pure library, without getting the Pico specific examples and code

    • If you do a clean checkout, you can use this command to get the project and the submodule in one go:
    git clone github.com/.../pico_gps_teseo.git --recursive
    • If you already have a local repository, take care that it has latest changes (git pull),
      and then retrieve submodule:
    git submodule init
    git submodule update
    • if you want to add the lib to your own project, execute this from the project's root folder:
    git submodule add https://github.com/jancumps/gps_teseo_lib.git

    GitHub repo: https://github.com/jancumps/pico_gps_teseo

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 1 year ago

    GSA and GGA message added. That completes the list of data that the device outputs by default.
    For other messages (there are a lot), a developer can use the libraries reader, writer and line parser methods to query them.

    currently available in the develop branch.

    GLL valid: yes.
    $GPGLL,5051.76917,N,00422.58021,E,194121.000,V,N*4A
    GSV valid: yes. count: 5.
    $GPGSV,3,1,11,13,86,080,,15,58,293,,14,55,091,,22,55,131,*70
    $GPGSV,3,2,11,05,38,205,,30,35,070,,24,19,256,,23,15,324,*7C
    $GPGSV,3,3,11,20,14,189,,18,10,286,,07,05,069,11,,,,*47
    $GLGSV,2,1,08,74,65,048,,72,64,140,23,75,54,209,,65,52,318,24*61
    $GLGSV,2,2,08,73,20,040,37,71,14,139,,82,12,004,30,81,08,319,28*6D
    GSA valid: yes. count: 2.
    $GNGSA,A,1,,,,,,,,,,,,,99.0,99.0,99.0*1E
    $GNGSA,A,1,,,,,,,,,,,,,99.0,99.0,99.0*1E
    GGA valid: yes.
    $GPGGA,194124.000,5051.76917,N,00422.58021,E,0,00,99.0,065.76,M,0.0,M,,*61
    RMC valid: yes.
    $GPRMC,194125.000,V,5051.76917,N,00422.58021,E,,,240724,,,N*7E
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 1 year ago

    Why I selected std::vector as container in this lib: https://embeddedartistry.com/blog/2017/08/23/choosing-the-right-stl-container-general-rules-of-thumb/

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 1 year ago in reply to Jan Cumps

    I'll need to debug my callback class for Arduino first. It's misbehaving (not executing the registered callback, but hanging)...
    image
    The rest seems to do what's needed fairly well.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 1 year ago

    With a few tweaks, it builds in the Arduino IDE too:

    image

    I had to downgrade some C++ constructs that aren't available in the GCC versions that ship with the IDE:

    This optional one I commented out for Arduino and other older toolchains. It's a guard, not executable code. 

    #ifdef __GNUC__ // this requires a recent version of GCC.
    #if __GNUC_PREREQ(10,0)
      requires std::is_void<R>::value || std::is_arithmetic_v<R>
    #endif
    #endif
    

    The std::string class in Arduino's toolchain doesn't support starts_with() yet. I replaced it (for older compilers) with a find(). My code is not exactly the same, but will fit in this scenario.

    #ifdef __GNUC__ // this requires a recent version of GCC.
    #if __GNUC_PREREQ(10,0)
                valid = s.substr(string_index, s.length() - string_index).starts_with(command.second);
    #else
                valid = (s.substr(string_index, s.length() - string_index).find(command.second)) != std::string::npos;
    #endif
    #endif

    I'm not ready to test yet - I still have to write the reader and writer. But this is a good start.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
<>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube