Skip to main content
Visitor II
July 4, 2023
Question

X-NUCLEO-GNSS2A1 - how to make it work without RTOS - initialisation and reading the NMEA data?

  • July 4, 2023
  • 7 replies
  • 5052 views

Hallo.

I have NUCLEO-L476 and X-NUCLEO-GNSS2A1 (with Teseo-VIC3DA). Of course, the only one present example, in "en.x-cube-gnss1" package for both boards (GetPos) works great, but all examples (including GetPos) available in package, work with RTOS. Unfortunatly, I am no familiar with RTOS, I will also not use RTOS in my project. I spent lot of hours to analyse the code and documentation, to find the way to use VIC3DA without RTOS without succes. I know also, that many GPS modules (for example from Origin GPS...) work just after powering it, the only problem is to efficiently parse the data from NMEA frames - there will be no problem with it.

And now is the question. How to:

  • initialise Teseo-VIC3DA module (without RTOS),
  • get NMEA data from it (after init), using I2C or USART?

It should be simple, but it is not. 

    This topic has been closed for replies.

    7 replies

    ST Employee
    July 7, 2023

    Hello @PDobr.1  ,

    Thanks for trying out this package.

    For Package without RTOS I suggest you start by generating the new ioc for NucleoL476RG using STM32CubeMX tool and using the settings of  Virtual_COM_Port.ioc placed in X-CUBE-GNSS1\6.0.0\Projects\NUCLEO-F401RE\Applications\Virtual_COM_Port .

    Generate the code and use the function  TeseoConsumerTask for getting the GNSS NMEA Message and ConsoleParseTask for parsing the message. Right now they are associated with thread but you can comment that and use above functions directly.

    USART1 Baud rate you can make 115200.

    Let me know !

    Regards,

    Saurabh

    PDobr.1Author
    Visitor II
    July 7, 2023

    Hello,

    thank you for the answer. Regarding the settings - I must copy ports, interfaces settings and middelware package settings (X-CUBE-GNSS1 - change for VIC3DA, without using RTOS - RTOS disabled), according to set pictures below?

    - pionout and port settings for connection with X-NUCLEO-GNSS2A1 board:

    0_1.JPG

    - interrupts (USART):

    0_2.JPG

    - USART1, change BR to 115200:

    0_3.JPG

    - settings of GNSS1 package, we are disabing RTOS (here is still enabled, thig to change):

    0_4.JPG

    And the last needed thing - to use two mentioned functions (Consumer and ParseTask) - I must comment these lines marked as red in main.c --> main(), as placed below (if I want to use/modify ready example for L476 0 GetPos - from package, it has RTOS inside) :

    0_5.JPG

    If something is missing, please correct me.

    regards, Paul

    ST Employee
    July 7, 2023

    Hello @PDobr.1  , 

    Yes please go ahead. Let me know.

    Regards,

    Saurabh

    PDobr.1Author
    Visitor II
    July 7, 2023

    Few more things, can you explain mi how to use these two functions (TeseoConsumerTask, ConsoleParseTask)? Where put them, in main()? They are associated with thread, so where should I put a comment to make the unassociated? And the last thing, which extensions should be chosen:

    0_4A.jpg

    - all?

    Hope it is all, what I will need t know, I will try to make it work on the weekend...

    ST Employee
    July 10, 2023

    Hello , 

    Since you are not using RTOS you have to devise your own way to simultaneously receive and parse the NMEA data.

    You may call TeseoConsumerTask and ConsoleParseTask  inside MX_GNSS_PostOSInit or in a main while loop.

    Dont call _init ( where above two functions are associated with the thread) .

    You can pass a const parameter in above two functions soemthing like :  TeseoConsumerTask("GNSS Fetching the NMEA Data..!"); and  ConsoleParseTask("GNSS Parsing the NMEA Data..!"); .

    We haven't tried without RTOS but above sequence should work. Please try.

    Regards,

    Saurabh

    There are osthread handlers which are . 

    PDobr.1Author
    Visitor II
    July 10, 2023

    Thanks for an answer. The best way, I think, the fastest one, is:

    • take NUCLEO-F401 (for which originally Virtual_COM_Port.ioc is dedicated - so there will be no need to change settings), 
    • download the code for Virtual_COM_Port,
    • make changes you mentioned earlier (described at the photos below):

    __app_gnss.JPG

     (above - commented _init functions and added TeseoConsumerTask("GNSS Fetching the NMEA Data..!"); and  ConsoleParseTask("GNSS Parsing the NMEA Data..!"); )

    __main.JPG

     (above - main() with added while(1); 

    • and run it. 

    It compiles without errors, I'll try it in the evening and send fedback - if it works or not. 

    PDobr.1Author
    Visitor II
    July 11, 2023

    Hallo. Unfortunatly the solution you adviced doesn't work with NUCLEO-L476 and NUCLEO-F401 - I took code from X-CUBE-GNSS1 examples with RTOS (so, the configuration was good), there are these functions implemented, so I disabled _init and added TeseoConsumerTask and TeseoParserTask - without success.

     

    Visitor II
    November 8, 2023

    @PDobr.1 I'm a beginner for the X-NUCLEO-GNSS2A1 module. I could not get the basic outputs even using the example application codes. Could you assist me? I have Nucleo64 - g491Re board as well.

    Graduate II
    November 8, 2023

    At the most simplistic level you probably want to open a UART connection, and forward content over the ST-LINK VCP so you can see NMEA Sentences coming from the receiver.

    Then build something to collect lines of data from the stream, ie a string bounded by CR/LF. Collect data from UART, construct string, hand-off for processing whole lines.

    How one might manage NMEA data from a GNSS shield on a STM32F746G-DISCO, simple, not-RTOS.

    https://github.com/cturvey/RandomNinjaChef/blob/main/f746g_disco_gps.c

    PDobr.1Author
    Visitor II
    November 9, 2023

    Parsing UART message is not a problem at all. 

    The thing I don't know how to do, is - how to force the Teseo module (from the board X-NUCLEO-GNSSA2) to send the NMEA data via UART to outside world. 

    When you yave uBlox GPS or Origin or other device, you have to power it up and simply get the data. So - I don't know to force Teseo to do that. My app can't work with RTOS, so how to do this without RTOS? I've tried many things, without success.

    Graduate II
    November 8, 2023
    Visitor II
    November 9, 2023

    That's the main problem. Still don't know the firmware on this module runs, the flow of the data occurs?

    PDobr.1Author
    Visitor II
    November 10, 2023

    I don't know how to make it run with my own code, of course examples with RTOS from ST pack work very well. I need a short part of code to make the Teseo flow the data at the outpt.