STM32 GPSDO

What are you developing?
AndrewBCN
Posts: 105
Joined: Sun Apr 25, 2021 3:50 pm
Answers: 1
Location: Strasbourg, France

STM32 GPSDO Version v0.04e pushed to GitHub

Post by AndrewBCN »

STM32 GPSDO firmware Version v0.04e sees some code refactoring, improved comments, and a couple of new features:
- All voltage readings are now filtered using a moving average of 10 samples (10 seconds at 1 sample per second). I am using a neat Arduino library for this, movingAvg.
- GPS baud rate increased to 38400 from the default 9600. This is done in Setup using a $PUBX command sent to the u-Blox Neo-M8 GPS receiver. The increase in baud rate increases the "quiet time" when the MCU is not busy waiting for and processing messages from the GPS receiver.
- VTG messages (track made good and ground speed information) from the u-Blox Neo-M8 GPS receiver are disabled, again using a specific $PUBX command. These messages are not needed for a stationary application such as a GPSDO.
- Many, many small details fixed/improved in the source.
AndrewBCN
Posts: 105
Joined: Sun Apr 25, 2021 3:50 pm
Answers: 1
Location: Strasbourg, France

STM32 GPSDO YouTube video

Post by AndrewBCN »

I just uploaded a short (<5 minutes) video about the STM32 GPSDO on YouTube:

https://www.youtube.com/watch?v=mgoK4KuVDhw

Any suggestions on what subjects a follow-up video should cover?
AndrewBCN
Posts: 105
Joined: Sun Apr 25, 2021 3:50 pm
Answers: 1
Location: Strasbourg, France

Version 0.04g with auto-calibration implemented

Post by AndrewBCN »

I have just uploaded to GitHub version v0.04g of the STM32 GPSDO firmware, and the big news is that this version implements a simple linear interpolation auto-calibration algorithm for the OCXO.
In previous versions of the firmware, any new OCXO had to be tested/characterized first before the firmware was compiled with an initial Vctl so that the frequency locked loop wouldn't take ages (hours or days depending on the OCXO) to reach 10MHz +/- 1ppb.

This auto-calibration takes just 30 seconds to run and calculates an approximate initial Vctl for 10MHz +/- 10ppb. The frequency locked loop then takes over and reaches +/-0.1 ppb in at most a few hours.

I have considered a PID algorithm but I am not sure the added complexity and time to reach a solution would be worth it.
CBoissy
Posts: 1
Joined: Mon Feb 28, 2022 8:58 am

Re: STM32 GPSDO

Post by CBoissy »

Hello,

You can see here our GPSDO from SYRLINKS.
They use STM32

https://time-frequency.syrlinks.com/gns ... g-modules/

Cyril BOISSY
Syrlinks
AndrewBCN
Posts: 105
Joined: Sun Apr 25, 2021 3:50 pm
Answers: 1
Location: Strasbourg, France

Re: STM32 GPSDO

Post by AndrewBCN »

CBoissy wrote: Mon Feb 28, 2022 9:00 am Hello,

You can see here our GPSDO from SYRLINKS.
They use STM32

https://time-frequency.syrlinks.com/gns ... g-modules/

Cyril BOISSY
Syrlinks
Hello Cyril,
Very nice GPSDOs and the low power consumption is quite unique. Thank you for mentioning your products, and that they use STM32 MCUs. I really think the STM32 is - by far - the best MCU for such applications.
skylin008
Posts: 5
Joined: Sun Feb 05, 2023 12:35 pm

Re: STM32 GPSDO

Post by skylin008 »

I used the Arduino IDE 2.0.3,but some error issue to build STM32-GPSDO, the error information is:
C:\Users\Administrator\Downloads\ArduinoIDE\GPSDO_V006c\GPSDO_V006c.ino:53:1: warning: "/*" within comment [-Wcomment]
/* Commands to be implemented:
^
C:\Users\Administrator\Downloads\ArduinoIDE\GPSDO_V006c\GPSDO_V006c.ino:62:1: warning: "/*" within comment [-Wcomment]
/**********************************************************************************************************
^
C:\Users\Administrator\Downloads\ArduinoIDE\GPSDO_V006c\GPSDO_V006c.ino: In function 'void Timer_ISR_2Hz()':
C:\Users\Administrator\Downloads\ArduinoIDE\GPSDO_V006c\GPSDO_V006c.ino:862:20: error: base operand of '->' is not a pointer
lsfcount = TIM2->CCR3; // read TIM2->CCR3
^
C:\Users\Administrator\Downloads\ArduinoIDE\GPSDO_V006c\GPSDO_V006c.ino: In function 'void docalibration()':
C:\Users\Administrator\Downloads\ArduinoIDE\GPSDO_V006c\GPSDO_V006c.ino:1424:18: warning: unused variable 'e1' [-Wunused-variable]
double f1, f2, e1, e2;
^
C:\Users\Administrator\Downloads\ArduinoIDE\GPSDO_V006c\GPSDO_V006c.ino:1424:22: warning: unused variable 'e2' [-Wunused-variable]
double f1, f2, e1, e2;
^
C:\Users\Administrator\Downloads\ArduinoIDE\GPSDO_V006c\GPSDO_V006c.ino: In function 'void displayscreen_OLED()':
C:\Users\Administrator\Downloads\ArduinoIDE\GPSDO_V006c\GPSDO_V006c.ino:1907:9: warning: unused variable 'tempfloat' [-Wunused-variable]
float tempfloat;
^
C:\Users\Administrator\Downloads\ArduinoIDE\GPSDO_V006c\GPSDO_V006c.ino: In function 'void setup()':
C:\Users\Administrator\Downloads\ArduinoIDE\GPSDO_V006c\GPSDO_V006c.ino:2508:26: error: 'HERTZ_FORMAT' was not declared in this scope
tim2Hz->setOverflow(2, HERTZ_FORMAT); // 2 Hz
^
C:\Users\Administrator\Downloads\ArduinoIDE\GPSDO_V006c\GPSDO_V006c.ino:2509:40: error: no matching function for call to 'HardwareTimer::attachInterrupt(void (&)())'
tim2Hz->attachInterrupt(Timer_ISR_2Hz);
^
C:\Users\Administrator\Downloads\ArduinoIDE\GPSDO_V006c\GPSDO_V006c.ino:2509:40: note: candidate is:
In file included from C:\Users\Administrator\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F4\2022.9.26\cores\maple/wirish.h:49:0,
from C:\Users\Administrator\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F4\2022.9.26\cores\maple/WProgram.h:30,
from C:\Users\Administrator\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F4\2022.9.26\system/libmaple/Arduino.h:31,
from C:\Users\Administrator\Downloads\ArduinoIDE\GPSDO_V006c\GPSDO_V006c.ino:113:
C:\Users\Administrator\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F4\2022.9.26\cores\maple/HardwareTimer.h:200:10: note: void HardwareTimer::attachInterrupt(uint8, voidFuncPtr)
void attachInterrupt(uint8 channel, voidFuncPtr handler) {
^
C:\Users\Administrator\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F4\2022.9.26\cores\maple/HardwareTimer.h:200:10: note: candidate expects 2 arguments, 1 provided
C:\Users\Administrator\Downloads\ArduinoIDE\GPSDO_V006c\GPSDO_V006c.ino:2697:26: error: 'analogReadResolution' was not declared in this scope
analogReadResolution(12); // make sure we read 12 bit values when we read from any ADC analog channel
^
C:\Users\Administrator\Downloads\ArduinoIDE\GPSDO_V006c\GPSDO_V006c.ino:2702:28: error: 'analogWriteFrequency' was not declared in this scope
analogWriteFrequency(2000); // default PWM frequency is 1kHz, change it to 2kHz
^
C:\Users\Administrator\Downloads\ArduinoIDE\GPSDO_V006c\GPSDO_V006c.ino:2703:27: error: 'analogWriteResolution' was not declared in this scope
analogWriteResolution(16); // set PWM resolution to 16 bits (the maximum for the STM32F411CEU6)
^
C:\Users\Administrator\Downloads\ArduinoIDE\GPSDO_V006c\GPSDO_V006c.ino:2740:19: error: 'GPIO_AF1_TIM2' was not declared in this scope
pinModeAF(PA15, GPIO_AF1_TIM2); // setup PA15 as TIM2 channel 1 / ETR
^
C:\Users\Administrator\Downloads\ArduinoIDE\GPSDO_V006c\GPSDO_V006c.ino:2749:27: error: 'TIMER_INPUT_CAPTURE_RISING' was not declared in this scope
FreqMeasTim->setMode(3, TIMER_INPUT_CAPTURE_RISING, PB10);
^
C:\Users\Administrator\Downloads\ArduinoIDE\GPSDO_V006c\GPSDO_V006c.ino:2752:7: error: base operand of '->' is not a pointer
TIM2->ARR = 0xffffffff; // count to 2^32, then wraparound (approximately every 429 seconds)
^
C:\Users\Administrator\Downloads\ArduinoIDE\GPSDO_V006c\GPSDO_V006c.ino:2755:51: error: no matching function for call to 'HardwareTimer::attachInterrupt(void (&)())'
FreqMeasTim->attachInterrupt(Timer2_Overflow_ISR);
^
C:\Users\Administrator\Downloads\ArduinoIDE\GPSDO_V006c\GPSDO_V006c.ino:2755:51: note: candidate is:
In file included from C:\Users\Administrator\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F4\2022.9.26\cores\maple/wirish.h:49:0,
from C:\Users\Administrator\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F4\2022.9.26\cores\maple/WProgram.h:30,
from C:\Users\Administrator\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F4\2022.9.26\system/libmaple/Arduino.h:31,
from C:\Users\Administrator\Downloads\ArduinoIDE\GPSDO_V006c\GPSDO_V006c.ino:113:
C:\Users\Administrator\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F4\2022.9.26\cores\maple/HardwareTimer.h:200:10: note: void HardwareTimer::attachInterrupt(uint8, voidFuncPtr)
void attachInterrupt(uint8 channel, voidFuncPtr handler) {
^
C:\Users\Administrator\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F4\2022.9.26\cores\maple/HardwareTimer.h:200:10: note: candidate expects 2 arguments, 1 provided
C:\Users\Administrator\Downloads\ArduinoIDE\GPSDO_V006c\GPSDO_V006c.ino:2761:7: error: base operand of '->' is not a pointer
TIM2->SMCR |= TIM_SMCR_ECE; // 0x4000
^
C:\Users\Administrator\Downloads\ArduinoIDE\GPSDO_V006c\GPSDO_V006c.ino:2761:17: error: 'TIM_SMCR_ECE' was not declared in this scope
TIM2->SMCR |= TIM_SMCR_ECE; // 0x4000
^
C:\Users\Administrator\Downloads\ArduinoIDE\GPSDO_V006c\GPSDO_V006c.ino:2775:25: error: 'AVREF' was not declared in this scope
adcVdd = analogRead(AVREF);
^

exit status 1

Compilation error: base operand of '->' is not a pointer



How to solve this issue. Thanks!
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 27
Location: Prudnik, Poland

Re: STM32 GPSDO

Post by GonzoG »

skylin008 wrote: Sun Feb 05, 2023 12:42 pm I used the Arduino IDE 2.0.3,but some error issue to build STM32-GPSDO, the error information is:
...
Which core are you using ??
skylin008
Posts: 5
Joined: Sun Feb 05, 2023 12:35 pm

Re: STM32 GPSDO

Post by skylin008 »

Thanks support. I had fix the issue. Now update the core to 2.04
Post Reply

Return to “Projects”