Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable external reference clock #14

Open
sq6emm opened this issue Jan 6, 2025 · 64 comments
Open

Enable external reference clock #14

sq6emm opened this issue Jan 6, 2025 · 64 comments
Labels
enhancement New feature or request libresdr

Comments

@sq6emm
Copy link
Contributor

sq6emm commented Jan 6, 2025

If possible, please enable external reference to be possible to be used.

@FPSychotic
Copy link

I have GPSDO, SI5351 device and Hackrf output to help to test that if needed

@F5OEO F5OEO added the enhancement New feature or request label Jan 7, 2025
@F5OEO
Copy link
Owner

F5OEO commented Jan 7, 2025

This request is for libresdr

@F5OEO F5OEO added the libresdr label Jan 8, 2025
@VasylSamoilov
Copy link

I also have GPSDO, can help with testing. It's just unclear how to set refclock to external and how to read status is it locked on external clock or not...

@F5OEO
Copy link
Owner

F5OEO commented Jan 9, 2025

This is done by modifying the devicetree in u-boot-env : I plan to rewrite the UbootEnv.txt to be universal

@sq6emm
Copy link
Contributor Author

sq6emm commented Jan 11, 2025

I am ready for testing;P mmcx to sma jumper arrived;P

@lubuntu-l100
Copy link

I have tested the LibreSDR-Tezuka firmware of January 16 2025 with SDR Console v3.4 beta. SDR Console v3.4 is now running fine in RX as well as TX over the QO100.

I am waiting for the enablement of the 10 Mhz external clock, due to the fact that the internal VCTTXO is not on frequency and is drifting a littlebit during transmission on the QO100. Locking on 10 Mhz is a need during qso's. I am following the github discussion around the Renovate of the original HDL in LibreSDR and the incorporation in the LibreSDR Tezuka firmware.

I am able to test this configuration with 10 Mhz and the Libresdr due to the fact that I have running already several Pluto's Rev B for DATV and measurement activities with GPSDO's and OCXO's since 2019.

LibreSDR with 10 Mhz supported could be a good and cheap alternative for the AD Pluto's.

@lubuntu-l100
Copy link

I forgot my callsign in the previous post. My callsign is PA2JSA, see my QRZ.com pages.

@sly547
Copy link

sly547 commented Jan 22, 2025

I am following the github discussion around the Renovate of the original HDL in LibreSDR and the incorporation in the LibreSDR Tezuka firmware.

Sorry to hijack but I can't seem to find that discussion (too many places to check, I'm lost). Could you give me a pointer please?

Also I wonder if the currently unused DAC that controls the VCTCXO can help with the drift. Without a reference the LibreSDR cannot measure the drift and thus not regulate the frequency, right?

@lubuntu-l100
Copy link

lubuntu-l100 commented Jan 22, 2025 via email

@sly547
Copy link

sly547 commented Jan 22, 2025

Hi!

Some roughly explanation how the 10 Mhz needs to work. The 10 Mhz signals is connected to a driver IC and then connected to the FPGA. The 7z020 FPGA compares the 10 Mhz signal with the 40 Mhz from the VCTCXO. The differences in frequency is going to the DAC that corrects the VCTCXO. The output of the 40 Mhz is divided in 2 signals, 1 is going to the AD9363 and the other is going the FPGA.

Ahh right, the AD9363 gets the 40 MHz directly from the oscillator, not through the FPGA, so we can't just multiply the external 10 MHz in the FPGA and route that to the AD9363. Thanks for explaining!

Are you aware of another PlutoSDR variant that is already doing this correction with the FPGA? I checked Pluto rev.D and Pluto+, they use the external frequency directly on the AD9363.

Below some links where this discussion is going.

Thanks! I need to check maia-sdr, this I did not really have on my radar yet. I thought there might be a single place where this discussion is happening, but then it is still scattered. I started one myself here: #42

@lubuntu-l100
Copy link

lubuntu-l100 commented Jan 22, 2025 via email

@sly547
Copy link

sly547 commented Jan 23, 2025

Hello Jaap,

Thank you for clarifying some things. These devices are all new to me. I started looking into the Ettus repository a bit. It's great to find all of this as open source.

Communicating over QO100 looks like a good motivation to get the external clock working. Really nice that this QO100 is a thing now. I don't have a clear target application yet, but maybe something related to (mobile) telecom networks (see OSMOCOM / srsRAN). Also something with low drift requirements. But as I said, I'm new to this.

I will try to get the DAC working on my board, so I can control it from software and do simple tests.

@Notupus
Copy link

Notupus commented Feb 11, 2025

With the new commit apparently there is support for pps and 10mhz on tezuka now, but I dont know how to enable it since the led stays off when using my "gpsdo" which is the timepulse from a ublox gps receiver, which is a pps or 10mhz square wave . Not sure if that can work or be adapted to work.

@F5OEO
Copy link
Owner

F5OEO commented Feb 11, 2025

This is a very early try thanks to discussion with hz12opensource/libresdr#10 (comment)
It should be automatic as soon as you have a 10Mhz, >2.5vpp.
I don't have opportunity to test right now.

@sq6emm
Copy link
Contributor Author

sq6emm commented Feb 11, 2025

Testing it right now...
But how can I detect if it is fixed to my reference?:)
Any reaction I should expect from LED or some /sys file content?

I do not see any reaction on the waterfall/scope (movement of signals)

and btw this (LED) is a general issue with LibreSDR still... during the firmware update there is not blinking of anything like with Pluto... so maybe just some simple correction is needed to enable LEDs?

@lubuntu-l100
Copy link

lubuntu-l100 commented Feb 12, 2025 via email

@lubuntu-l100
Copy link

Image

Zyncsdr Layout and led function explanation. Chinese Source.

PA2JSA

@sq6emm
Copy link
Contributor Author

sq6emm commented Feb 12, 2025

It blinks/lights during the startup, but later not.

@lubuntu-l100
Copy link

lubuntu-l100 commented Feb 12, 2025 via email

@sq6emm
Copy link
Contributor Author

sq6emm commented Feb 12, 2025

Hey, well yes most probably.
I am using master branch of tezuka_fw - just reporting the state;) But I think it might be also connected with no LEDs are blinking during the firmware update... so maybe its just different pins are LEDs...

@lubuntu-l100
Copy link

lubuntu-l100 commented Feb 12, 2025 via email

@Notupus
Copy link

Notupus commented Feb 12, 2025

. I have a 10mhz at maybe 3 volts and 1pps at 3.3V. I do no see a difference in the tx frequency at 1.6ghz going to a rtl-sdr with or without the reference, it seems to not work, however turning the led on an off at whatever the vctcxo is being controlled with would make sense, and I would prefer PPS since I can measure that with a simple multimeter. I expect to see a small jump in frequency when plugging in the ref clock.

@lubuntu-l100
Copy link

lubuntu-l100 commented Feb 12, 2025 via email

@Notupus
Copy link

Notupus commented Feb 12, 2025

Okay, so you are claiming with tezuka_fw 0.1.0 and 10mhz input you can see the tuning? If so I will try to confirm this in due course maybe it doesnt like thats is a 10mpps signal.

@lubuntu-l100
Copy link

lubuntu-l100 commented Feb 12, 2025 via email

@lubuntu-l100
Copy link

The Link below on Github is a description of how to implement the 10 Mhz and 1PPS External clock reference in the Libresdr. Header is Renovate the original HDL in LibreSDR from SDY623.

I hope F5OEO can use these scripts as input for implementing the 10 Mhz and 1 PPS in the TAZUKA Firmware.

Link: sdy623/hdl@5b9bcef#diff-6b183c60e27cdb85d400546826482fe3e196d85e3abfe0e56d000736af943d7c

PA2JSA

@lubuntu-l100
Copy link

Hardware Modification: 40 Mhz External Reference Clock for AD9363 in ZyncSDR / LibrSDR

The Zyncsdr / Libresdr has a 10 Mhz external reference to lock the 40 Mhz internal VCTCXO via the FPGA 7Z020, however to support for this 10 Mhz synchronization is not available in current Tezuka Firmware for the Zyncsdr. With my experiences to modify the internal VTcxo of Adalm Pluto’s and replace that with an external 40 Mhz reference from a Leobodnar GPSDO. I decided to test if I can do the same with the Zyncsdr with the Tazuka FW 0.1.0.
Looking at the hardware diagram, you can see that the 40 Mhz VCTCXO is controlled by a PLL circuit in the FPGA 7Z020 where the 10 Mhz external reference is compared with the 40 Mhz of the VCTCXO. Differences in frequency are converted by a DAC5311 into a voltage that is steering the 40 MHZ VCTCXO.
The output of the 40 Mhz oscillator is buffered by a SN74AHC1G14DBVR and then split in two 40 Mhz signals and again buffered. 1 Signal is going back to the FPGA 7Z020 and the other part of the 40 Mhz signal is going to the AD9363 as 40Mhz internal clock signal.
At this point I decided to modify the 40 Mhz signal that is going to the AD9363 and replace that with a 40 Mhz signal from a 40 Mhz Leobodnar GPSDO signal.

In attached document:
ZyncSDR 40 Mhz External Reference.pdf

you can find how to modify the ZyncSDR to use an external 40 Mhz Reference signal for the AD9363. This hardware modification is equal to simular modifications in Adalm Pluto SDR transceivers. Test with the Tezuka 0.1.0 Firmware at the QO100 Satellite shows no difference between an AD Pluto or the Zyncsdr in terms of Stability and on Frequency.

Evenso at QRZ.com you can find the modification at PA2JSA page.

PA2JSA

@F5OEO
Copy link
Owner

F5OEO commented Feb 17, 2025

Thanks for this hardware mod @lubuntu-l100 . Could be useful until the 10Mhz input could work directly (work in progress - not trivial).

@lubuntu-l100
Copy link

lubuntu-l100 commented Feb 20, 2025 via email

@F5OEO
Copy link
Owner

F5OEO commented Feb 26, 2025

@sq6emm it could be very interesting that I could test the firmware from opensourcelabs. We need to extract it from qspi and save it to sd for example or in ram and then transfer them over ssh.

@sq6emm
Copy link
Contributor Author

sq6emm commented Feb 26, 2025

@F5OEO happy to help, but how?:) I still have not flashed the opensourcelabs so its possible;)

@F5OEO
Copy link
Owner

F5OEO commented Feb 26, 2025

I need to make a script to extract the firmware. As far as I know, it is the only one which is working with rf clck

@sq6emm
Copy link
Contributor Author

sq6emm commented Feb 26, 2025

Please remember that the original firmware is Linux (lubuntu) based....

@sq6emm
Copy link
Contributor Author

sq6emm commented Feb 26, 2025

dd of=boot.bin if=/dev/mtdblock0 bs=64k
dd of=u-boot-env.bin if=/dev/mtdblock1 bs=64k
dd of=firmware.frm if=/dev/mtdblock3 bs=64k

should do the job?

@F5OEO
Copy link
Owner

F5OEO commented Feb 26, 2025

Exactly !

@sq6emm
Copy link
Contributor Author

sq6emm commented Feb 26, 2025

@sq6emm
Copy link
Contributor Author

sq6emm commented Feb 26, 2025

Please remember that the original firmware is Linux (lubuntu) based....

I was wrong with it. This is firmware on the sd card.
But the one on flash is:

______ _       _        _________________
| ___ \ |     | |      /  ___|  _  \ ___ \
| |_/ / |_   _| |_ ___ \ `--.| | | | |_/ /
|  __/| | | | | __/ _ \ `--. \ | | |    /
| |   | | |_| | || (_) /\__/ / |/ /| |\ \
\_|   |_|\__,_|\__\___/\____/|___/ \_| \_|

v0.37-dirty
https://wiki.analog.com/university/tools/pluto

and password is "root", not "analog"

@F5OEO
Copy link
Owner

F5OEO commented Feb 26, 2025

Wow....Fantastic ! Will give it a try tomorrow !

@sq6emm
Copy link
Contributor Author

sq6emm commented Feb 26, 2025

# cat /opt/VERSIONS /etc/os-release 
device-fw v0.37-dirty
hdl dev_prj_2018_r1-1763-ge5660-dirty
buildroot 2021.02.7-adi-6643-g0d5db4-dirty
linux adi-xilinx-2020.1-98725-g3eae70-dirty
u-boot-xlnx v0.20-PlutoSDR-25-g90401c-dirty
NAME=Buildroot
VERSION=-g0d5db4a280-dirty
ID=buildroot
VERSION_ID=2022.02.3
PRETTY_NAME="Buildroot 2022.02.3"

@sq6emm
Copy link
Contributor Author

sq6emm commented Feb 26, 2025

This might help!

https://gitee.com/zyq-77/hdl/tree/dev_prj_2018_r1

@F5OEO
Copy link
Owner

F5OEO commented Feb 26, 2025

This is an hdl repo, but where is the buildroot project !

@F5OEO
Copy link
Owner

F5OEO commented Feb 27, 2025

Experimental version using 10Mhz (de18b11)
Put a 10Mhz source with at least 7dm, you should see led 10mhz ON.
If you have chance to have a vctxo (zynqsdr), it should pilot it. Not on my hamgeek libresdr.
Workaround :
Use a script /root/adj_10mhz.sh which should calculate and set xo_correction. (Need to check if the sign is ok).
Feedback welcomed !

@F5OEO
Copy link
Owner

F5OEO commented Feb 27, 2025

And seems that chrony adjustement is not far from value calculated by 10mhz ref in.

./adj_10mhz.sh

Xo Correction 40000042
Xo Correction 40000044
Xo Correction 40000042
Xo Correction 40000044
Xo Correction 40000042
^C

./adj_chrony.sh

High accurate ppm = 1.249 +/- 0.385 slow
Correct 40000050
High accurate ppm = 1.249 +/- 0.385 slow
Correct 40000050

@sq6emm
Copy link
Contributor Author

sq6emm commented Feb 27, 2025

make libre_maiasdr_defconfig && make
[...]

  Downloaded 23 crates (12.4 MB) in 4.08s (largest was `aws-lc-sys` at 8.3 MB)
error: rustc 1.79.0 is not supported by the following packages:
  [email protected] requires rustc 1.81
  [email protected] requires rustc 1.81
  [email protected] requires rustc 1.80.0
  [email protected] requires rustc 1.80.0
  [email protected] requires rustc 1.80.0
  [email protected] requires rustc 1.81
Either upgrade rustc or select compatible dependency versions with
`cargo update <name>@<current-ver> --precise <compatible-ver>`
where `<compatible-ver>` is the latest version supporting rustc 1.79.0

>>> maia-httpd sweep Building
xz: /home/dawszy/git/original/tezuka_fw/buildroot-2024.08/output/build/maia-httpd-sweep//maia-httpd/target/armv7-unknown-linux-gnueabihf/release/maia-httpd: No such file or directory
>>> maia-httpd sweep Installing to target
/usr/bin/install -D /home/dawszy/git/original/tezuka_fw/buildroot-2024.08/output/build/maia-httpd-sweep//maia-httpd/target/armv7-unknown-linux-gnueabihf/release/maia-httpd.xz /home/dawszy/git/original/tezuka_fw/buildroot-2024.08/output/target/usr/bin/
/usr/bin/install: cannot stat '/home/dawszy/git/original/tezuka_fw/buildroot-2024.08/output/build/maia-httpd-sweep//maia-httpd/target/armv7-unknown-linux-gnueabihf/release/maia-httpd.xz': No such file or directory
make[1]: *** [package/pkg-generic.mk:380: /home/dawszy/git/original/tezuka_fw/buildroot-2024.08/output/build/maia-httpd-sweep/.stamp_target_installed] Error 1
make: *** [Makefile:83: _all] Error 2

@F5OEO
Copy link
Owner

F5OEO commented Feb 27, 2025

You need to migrate to latest buildroot : wget https://buildroot.org/downloads/buildroot-2024.11.1.tar.gz

@sq6emm
Copy link
Contributor Author

sq6emm commented Feb 27, 2025

You need to migrate to latest buildroot : wget https://buildroot.org/downloads/buildroot-2024.11.1.tar.gz

Yeah my mistake;) Thanks, on it.

@sq6emm
Copy link
Contributor Author

sq6emm commented Feb 27, 2025

I dont have time to test more today, but LED is not ON as on original firmware;)

@sq6emm
Copy link
Contributor Author

sq6emm commented Feb 27, 2025

I confirm.
7dBm works. LED is on and ./adj_10mhz.sh is working fine!
Congrats!

@F5OEO
Copy link
Owner

F5OEO commented Feb 28, 2025

Could be a good idea to test with 1 pps also..I will try to use a low cost GPS pour that. Don't know if 3.3V pulse is not too much

@Notupus
Copy link

Notupus commented Feb 28, 2025

Is it in theory already supported?

@F5OEO
Copy link
Owner

F5OEO commented Feb 28, 2025

Yes...

@Notupus
Copy link

Notupus commented Feb 28, 2025

Well no led and adj 10mhz is not working

@F5OEO
Copy link
Owner

F5OEO commented Feb 28, 2025

Can you uncomment this line (directly with nano under /root/adj_10mhz.sh)

#echo "Reg $read_register"

And give me what it outputs...

@sq6emm
Copy link
Contributor Author

sq6emm commented Feb 28, 2025

Well no led and adj 10mhz is not working

7dBm of 10MHz signal is important.... below it wont work. Make sure you have that level. Unless you have opensourcelabsdr then it works from -10 dBm

@sq6emm
Copy link
Contributor Author

sq6emm commented Feb 28, 2025

firmware.frm.gz

u-boot-env.bin.gz

boot.bin.gz

@F5OEO based on those files... you think this version of software might be needed running yet for any tests yet or I can flash it to tezuka?:)

@F5OEO
Copy link
Owner

F5OEO commented Feb 28, 2025

I began to analyse it...but not yet compelety extracted. It is precious..keep it on the flash, and test tezuka on sd !

@sq6emm
Copy link
Contributor Author

sq6emm commented Feb 28, 2025

I began to analyse it...but not yet compelety extracted. It is precious..keep it on the flash, and test tezuka on sd !

Yes Sir!

@Notupus
Copy link

Notupus commented Feb 28, 2025

Can you uncomment this line (directly with nano under /root/adj_10mhz.sh)

tezuka_fw/board/pluto/overlay_maia/root/adj_10mhz.sh

Line 5 in 696b9be
#echo "Reg $read_register"

And give me what it outputs...

WIth PPS the register reads as such (noled)
devmem 0x41210000
0x00000008
10MHZ square wave from ublox( probably weak but I have the opensourcelabs version)(led on)
devmem 0x41210000
0x0000000A
and nothing
devmem 0x41210000
0x00000008
Maybe you can use a radiosonde to do pps for testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request libresdr
Projects
None yet
Development

No branches or pull requests

7 participants