New gateware for new SQUARE SDR 2

574 views
Skip to first unread message

sirok...@wideservis.cz

unread,
Jul 12, 2025, 4:29:58 PMJul 12
to Hermes-Lite
Hi Steve
I will be creating new Gateware for the new SQUARE SDR 2 https://www.wideservis.cz/square-sdr-2/#googtrans(cs|en)

The new variant will be based on the "hl2b5up_ak4951v4" variant.
The version will include a different audio chip.


I have a few questions to help me proceed correctly:

Do I have to strictly adhere to the Quartus-lite-19.1.0.670 version?
How should I name the new version (number etc..)?
How does the gateware validation work?
Will (can) the new version be stored on your Gitlab?
Or something else...?


Thank you for your support and best regards,
René OK1XTG

René Široký

unread,
Jul 13, 2025, 4:29:08 AMJul 13
to Hermes-Lite
Hi Steve,
He has another question:
I tested the gw variant "hl2b5up_ak4951v4" and the PA does not shut down when the temperature exceeds 55°C.

Is this correct?
If so, why was this protection removed?

Thank you for your answer.
René OK1XTG

Dne sobota 12. července 2025 v 22:29:58 UTC+2 uživatel sirok...@wideservis.cz napsal:

Steve Haynal

unread,
Jul 14, 2025, 12:44:52 AMJul 14
to Hermes-Lite
Hi Rene,

First, thank you for continuing in the Hermes-Lite 2 open source and open hardware tradition and expectation by releasing all the SquareSDR design files:

To answer your questions:
  1. Quartus-Lite 19.1.0.670 is not strictly required. The last time I rebuilt the gateware I used "20.1.1 Build 720 11/11/2020 SJ Lite Edition" as it is the version last installed on my system.
  2. You can assign any unique name to your gateware variant. For example, the codec part number or SquareSDR.
  3. There is no structured validation for a gateware release. Make sure no new unexpected timing violations are introduced. I usually operate with the updated gateware for several days before releasing.
  4. Yes, you can store your gateware variant in the main HL2 github repository. We use a standard git development methodology. Once you have made your changes and are happy with them, issue a pull request. If your changes only apply to your variant and are only enabled via if/def and/or Verilog generate statements so that the core HL2 variant is not disturbed, then I will accept the pull request. Look in the git history to see how the radioberry variant (a very popular derivative project with the largest Facebook group) and Taka's ak4951 support were added.
  5. I don't know if/how/why the ak4951v4 variant does not shut down when temperature exceeds 55C. I originally had an agreement with Taka to keep all changes for the ak4951 variant in github and then I would include it in every official release. But 2 years ago the other person involved with the ak4951 broke that agreement and hosted gateware on a custom website. Since then, I have stopped including ak4951 variants in any gateware build or official release, so I really don't know what state it is in or what RTL release v4 is based on.
Just in case you haven't studied this part of the HL2, there is no demodulation to audio inside the HL2 or for your case the SquareSDR derivative hardware. IQ samples are sent to the host and software on the host is the only place where demodulation occurs. When using an addon such as the ak4951 companion card, audio must be sent from the host back to the HL2. What you have is just a cheap network-based sound card. Some users are fooled that latency is reduced because most audio codecs offer a direct monitoring mode. What they hear is a low latency loop back of their mic audio or CW side tone. That is strictly a function of the audio codec and involves no HL2 hardware. It is possible to have the same direct monitoring with most sound cards, especially mid to high end sound cards. If someone is a real audiophile, why would the use the same or similar audio codec as found in ~$15 USB sound adapters just because it is integrated in the HL2? It is better to spend money on a quality sound card (for example, those used for home studios), learn how to enable and use direct monitoring, as well as configure for low latency. In the end, you then have a quality sound card which can be used for other purposes.

73,

Steve
kf7o
 



René Široký

unread,
Jul 14, 2025, 3:23:36 PMJul 14
to Hermes-Lite
Hi Steve,
thank you very much for your answers. I will have to delve deeper into the gateware code and understand the connections.

As for local audio, it is to some extent also the wish of some radio amateurs. Following the example of HL2+. As I also tested Thetis on hardware of different speeds and different sound cards (internal and external), in some cases the latency of the audio chain was quite large and it was not possible to reduce it. In the case of local audio in the radio, the latency was always minimal, almost imperceptible during operation. This is also understandable in the context of the operating system in relation to the hardware and the allocation of access time via drivers, etc.

René OK1XTG
Dne pondělí 14. července 2025 v 6:44:52 UTC+2 uživatel Steve Haynal napsal:

René Široký

unread,
Jul 15, 2025, 7:16:40 AMJul 15
to Hermes-Lite
Hi Steve,
After a thorough analysis of the gateware, I found out why the PA excitation is not turned off in the gateware variant "hl2b5up_ak4951v4" when the temperature exceeds ~55°C and I am reporting this:

The Hermes Lite 2 Plus companion boards use the "io_db1_4" signal (connector head DB1 PIN-4, FPGA PIN-80) as an alternative PTT input, instead of its original purpose as an output for BVO or FAN.

Which would probably not be that critical.
But someone set the FAN parameter to 0 in the "hl2b5up_ak4951v4" variant in the "hermeslite.v" file in the "hermeslite_core" structure. This results in the exclusion of the entire fan functionality from conditional compilation, including the control of the "temp_enabletx" bit (line 644 in the rtl\control.v file). Probably in human thinking that the FAN is not used.

It is interesting that in the gateware variant "hl2b5up_ak4951v3" the FAN parameter is set to 1 as in the main variant, where the PA excitation shutdown when the temperature exceeds ~55°C works correctly.

Attention! From this it is clear that for users using the gateware variant "hl2b5up_ak4951v4" the PA thermal protection DOES NOT WORK.

Dne pondělí 14. července 2025 v 6:44:52 UTC+2 uživatel Steve Haynal napsal:
Hi Rene,

Steve Haynal

unread,
Jul 20, 2025, 3:29:11 PMJul 20
to Hermes-Lite
Hi René,

The ak4951v3 variant has the FAN parameter set. My guess is that Taka set the FAN parameter to 0 for v4 as there was no longer enough space in the FPGA for it after enabling the antenna tuner.

If you are interested in latency measurements, I'd suggest the following 4 latency measurements for an audio adapter embedded in the HL2 and a regular sound card:
  1. RF RX signal present at antenna connector to tone heard in speaker/headphones
  2. Tone present at microphone to RF TX signal present at antenna connector
  3. CW key press to CW sidetone heard in speaker/headphones
  4. Audio present at microphone to same audio heard in speaker/headphones
For 3 and 4, use a decent sound card and a proper cmASIO, ASIO, low latency WASAPI or pipewire/jack setup. Also, enable direct monitoring for 3 and 4 above, with the keyer sidetone output connected to the microphone input so that the sidetone is heard directly (direct monitoring) and mixed with RX audio.

For 1 and 2 above, latencies will be long and similar but not human noticeable as everything goes through software on the host. For 3 and 4 above, I expect latencies will be less than 10ms (typical time for which a human can't notice) or less, even less than 3ms, for all implementations. Since they are the same, I would much rather have a quality audio card which can be used for other purposes, such as modular uses with VST/AU plugins and other SDRs, than a cheap integrated codec in the HL2. I know some people are reluctant to change or learn and want the integrated sound, but I don't believe that is a good direction for SDR in the long run.

73,

Steve
kf7o
Message has been deleted

René Široký

unread,
Jul 20, 2025, 6:21:27 PMJul 20
to Hermes-Lite
Hi Steve,
Thank you for your answer.

I tried compiling V4 with different FAN parameter settings. The difference between them in the logic elements used is 1%.

FAN 0 = Total logic elements 21,010 / 22,320 ( 94 % )
FAN 1 = Total logic elements 21,143 / 22,320 ( 95 % )
(Do you have the same results?)

So I would be interested in what led him to change the FAN parameter.

Thanks for clarifying the procedure for measuring latency when using the built-in audio interface. I will try with the new chip when I finish editing the gateware.

René OK1XTG.


I tried compiling V4 with different FAN parameter settings. The difference between them in the logic elements used is 1%.
Dne neděle 20. července 2025 v 21:29:11 UTC+2 uživatel Steve Haynal napsal:
Reply all
Reply to author
Forward
0 new messages