element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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
IoT on Wheels Design Challenge
  • Challenges & Projects
  • Design Challenges
  • IoT on Wheels Design Challenge
  • More
  • Cancel
IoT on Wheels Design Challenge
Blog IOT on Wheels Design Challenge - Smart Drive - Connecting GPS module to STM32L476RG - Blog #6
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: vlasov01
  • Date Created: 6 Nov 2017 1:29 AM Date Created
  • Views 603 views
  • Likes 4 likes
  • Comments 0 comments
  • nucleo expansion boards
  • ubx
  • nmea
  • stm32cubemx
  • gps receiver
  • smartdrive
Related
Recommended

IOT on Wheels Design Challenge - Smart Drive - Connecting GPS module to STM32L476RG - Blog #6

vlasov01
vlasov01
6 Nov 2017

IOT on Wheels Design Challenge - Smart Drive - Project Index

Using STM32CubeMX to configure USART3

My GPS module only supports serial communication. So I've again used STM32CubeMX to configure serial ports. I've configured STM32L476RG pins PC11 and PC12 as USART3_RX and USART3_TX As well I configured USART3 to use interrupts. And then I've generated the code template. It was quite straightforward.

image

Porting Arduino UBX GPS MultipleMessages code

I've ported GPS module configuration and parser from Arduino. The original Arduino code and UBX messages has been explained in UBX GPS MultipleMessages video https://www.youtube.com/watch?v=ylxwOg2pXrc . UBX is an alternative to NMEA protocol developed by u-Blox.

The configuration ensures that I only receive messages that I'm interested in, like position and status of connection with satellites (how reliable is information about position). One of the challenges during the port was to migrate from polling serial port in Arduino to use of interrupts with STM32. STM32 interrupts works great. But the challenge was that UBX messages have a variable length. So I was forced to use interrupts after receiving each byte. The next day after I've completed my code I've receive an article from STMicroelectronics Community "Efficiently use DMA with UART RX on STM32"  https://community.st.com/thread/42689-efficiently-use-dma-with-uart-rx-on-stm32  . They describe a better approach to handling this situation. As I'm running out of time with my project I'll delay the change for another time.

 

Connecting hardware components

I've connected serial ports from GPS module with Morfio pins of STM32L476RG Nucleo board. In addition I've monitored serial communication using USB to RS232 serial adapter, which was connected to my PC.

image

 

Running tests

This test I executed inside the house. So GPS module was not able identify latitude and longitude. But it was sending messages as expected and parser was able to go over this messages without any issues.

image

STM32CubeMX and Nucleo expansion boards

STM32CubeMX accelerated and simplified parts of low level coding. I've start looking how to use it with my sensors and WiFi Nucleo expansion boards.I was surprised to find out that

it is not aware of Nucleo expansion boards at all at this time.

  • Sign in to reply
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 © 2025 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