G2 Software and Firmware Updates

G2 operating system and special app's (e.g. p2app) discussion only--post Thetis and piHPSDR questions in their own sub-forums
laurencebarker
Posts: 225
Joined: Mon Nov 11, 2019 7:39 pm

G2 Software and Firmware Updates

Postby laurencebarker » Sun Aug 27, 2023 4:27 pm

Along with the new Thetis 2.10.1.0 release (see Scott's post) there have been updates to the Saturn software and firmware to address some of the issues that have been reported. As a group the CW issues with both Thetis and piHPSDR, RX2 and MON audio, line input and other issues have been addressed.

Thetis 2.10.1.0 and the newest piHPSDR releases also have settings to select the balanced microphone input, so there is no longer a need for the the -m xlr" command line switch.

To adopt the p2app and Saturn FPGA changes, please follow the procedures in the manual. Basically these are:

open a command line window

type these commands (remembering they are case sensitive):

cd ~/github/Saturn
git pull
cd sw_projects/P2_app
make clean
make


cd ../audiotest
make clean
make

cd ~/github/pihpsdr
git pull
make clean
make


Then run the "flashwriter" app. The program may already be installed onto your linux desktop. If not you can run it simply from a linux command prompt. Open a command window then type:

cd github/Saturn/sw_tools/flashwriter
./flashwriter

click open file
navigate to the file ~/github/Saturn/FPGA
select file saturnprimary.bin
makes sure the Primary radio button is selected
click Program

(DO NOT click Erase Device of select Fallback!)

You will get progress shown in the window; it will go through erase, program and verify steps then report success at the end.

Shut your G2 down, power off and back on; it will now run the new FPGA code and will load the new p2app.



If you want to check the new versions of p2app and FPGA:

open a terminal window
cd ~/github/Saturn/sw_projects/P2_app
./p2app

p2app will report the version numbers for the FPGA and its own software.

FPGA BIT file date code = 23082023
Product: Saturn; version = 2
FPGA firmware loaded: Saturn prototype, full function; FW version = 8

p2app client app software Version:13 Build date: 18 Aug 2023 18:53:07


(I think I need to remove that "prototype" now from the text!)
Laurence Barker G8NJJ
W7GES
Posts: 77
Joined: Sat Mar 13, 2021 6:56 pm
Location: Phoenix AZ

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby W7GES » Sun Aug 27, 2023 6:03 pm

I just tried to update my G2 Software and Firmware.

I was able to update P2_app and audiotest following these steps.

When I tried the gitpull in the pihpsdr directory I received a message that my email address and name were not set up but the error message said to add them by using git config --global email address and user name. After executing these steps I ran git pull again.

This time I received a lot of Merge conflict messages. zoompan.c, xvrtr_menu.c, waterfall.c, vox_menu.c, vox.c, vfo_menu.c, etc, etc, etc,

After all the merge conflict messages there is an instruction to fix conflicts and then commit the result.

If I try running git pull again there is a message that says Pulling is not possible because you have unmerged files.
There are two hints. Fix them up in the work tree, and then use 'git add/rm <file>'
as appropriate to mark resolution and make a commit.

Not sure if deleting the files in the github/pihpsdr directory and rerunning the git pull would work as I don't want to mess up anything further...

73,

George / W7GES
laurencebarker
Posts: 225
Joined: Mon Nov 11, 2019 7:39 pm

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby laurencebarker » Sun Aug 27, 2023 7:05 pm

OK, we'll have to check how that folder was created in the repository that Apache labs provided. I've just been given access to it, so I can create a new SD card and experience the same set of files you have.

I suspect it will need to wait until Rick returns (I think this week) to know how to proceed.

deleting all the files for the pihpsdr folder and doing a new "git clone" will work but will leave you with a different build standard which makes support harder.
Laurence Barker G8NJJ
User avatar
n1gp
Posts: 175
Joined: Sun Apr 09, 2017 6:34 pm

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby n1gp » Sun Aug 27, 2023 9:09 pm

Hi,

It looks like libgpiod-dev may not have been installed in this release.

I have tried to recreate this using the Apache-Labs image and these steps work for me:

(change to your email and name) (only needs to be done once)

git config --global user.email "test@youremail.com"
git config --global user.name "name lastname"

cd ~/github/pihpsdr
sudo apt-get install libgpiod-dev
git reset --hard origin/saturn
git pull
make clean
make -j9


-Rick / N1GP
KC2QMA
Posts: 104
Joined: Mon Jul 13, 2020 11:13 pm

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby KC2QMA » Sun Aug 27, 2023 9:29 pm

I hope someone can make a video showing step by step how you update Firmware/Software on the G2 100W.

I read the instructions but I don't understand how to find the file I need to download to the radio itself.
I downloaded the Thetis update and installed that as normal but am lost with the RasburyPI as I don't have any experience at all with Linux!

I am new to ANAN and don't want to brick my radio.
W7GES
Posts: 77
Joined: Sat Mar 13, 2021 6:56 pm
Location: Phoenix AZ

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby W7GES » Sun Aug 27, 2023 10:21 pm

I followed Rick's steps.

When I tried to install libgpiod-dev a message said it was already installed and not updated

I ran git reset --hard origin/saturn

git pull gave me a message nothing to pull
ran the make clean and make -j9 and install was completed.

I ran the flashwriter

Restarted the G2 and now the pihpsdr Build date is 2023-08-22, Build version is 2.0DL1YCF, WDSP version is 1.23

FPGA BIT file data code = 23082023
Product: Saturn; Version =2
FPGA firmware loaded: Saturn prototype, full function; FW version = 8
p2app client app software Version:13 Build Date: 23 Aug 2023 18:20:36

I updated Thetis also and now line in (L) works with my N1MM / Presonus Studio 192 configuration.

XLR / TRS Balanced mic input works as well.

Thank You!!

George / W7GES
JohnFT61
Posts: 69
Joined: Wed May 17, 2023 8:13 pm

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby JohnFT61 » Sun Aug 27, 2023 11:47 pm

I have tried this twice, but I am only getting FW version 7, not 8? And nothing about WDSP.



John
N2KBE
W7GES
Posts: 77
Joined: Sat Mar 13, 2021 6:56 pm
Location: Phoenix AZ

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby W7GES » Mon Aug 28, 2023 4:04 am

JohnFT61 wrote:I have tried this twice, but I am only getting FW version 7, not 8? And nothing about WDSP.



John
N2KBE


The Build Version and WDSP version are for the pihpsdr application. Click the about menu button.

The FPGA, etc information is displayed when you start the p2app. Don’t start Thetis before looking for the version info as it will scroll off the window.
laurencebarker
Posts: 225
Joined: Mon Nov 11, 2019 7:39 pm

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby laurencebarker » Mon Aug 28, 2023 10:06 am

KC2QMA wrote:I hope someone can make a video showing step by step how you update Firmware/Software on the G2 100W.

I read the instructions but I don't understand how to find the file I need to download to the radio itself.
I downloaded the Thetis update and installed that as normal but am lost with the RasburyPI as I don't have any experience at all with Linux!

I am new to ANAN and don't want to brick my radio.



If you have done the git pull, then the file for FPGA programming is already downloaded. it will be in folder ~/github/Saturn/FPGA and its name is saturnprimary.bin. Mine has a file date 23/08/2023. If the date is that or newer then it is the right file.
Laurence Barker G8NJJ
K5WC
Posts: 23
Joined: Sun Apr 16, 2023 10:59 pm

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby K5WC » Mon Aug 28, 2023 11:48 am

Update performed without issues following the steps above. Thank you for the detailed instructions from a non Linux experienced first time Anan owner. LOL

Guessing it will be possible to edit the startup program to have the G2 with screen NOT automatically start PIHPSDR on initial start up each time?

Thanks Best 73 John
KC2QMA
Posts: 104
Joined: Mon Jul 13, 2020 11:13 pm

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby KC2QMA » Mon Aug 28, 2023 11:57 am

Hello Laurence, Thank you very much for all of your hard work and time helping us get things sorted out.
I got everything working it reminds me of my days with dos command lines.

Just a thought, maybe a small updater application on the G2 in the future to automate the update process would be very helpful for many users :)
JohnFT61
Posts: 69
Joined: Wed May 17, 2023 8:13 pm

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby JohnFT61 » Mon Aug 28, 2023 7:32 pm

I managed to update manually, deleting the files that weren't needed. I have FW 8 now, and WDSP 1.23. I was getting merge issues. Isn't "make clean" supposed to take care of that?


John
N2KBE
laurencebarker
Posts: 225
Joined: Mon Nov 11, 2019 7:39 pm

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby laurencebarker » Mon Aug 28, 2023 8:10 pm

Make clean removes files created in the build process. The merge issues suggest there are files in the folder that aren't the same as was in the git repository. normally there is a hidden file ".gitignore" that tells git to ignore build files but it's possible that isn't ignoring everything.

doing make clean first then git pull might have a different result?
Laurence Barker G8NJJ
JohnFT61
Posts: 69
Joined: Wed May 17, 2023 8:13 pm

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby JohnFT61 » Mon Aug 28, 2023 9:41 pm

Laurence,

Thank you for the reply and suggestion, I will try that next time!


John
N2KBE
KI4P
Posts: 65
Joined: Sat Jul 16, 2022 3:46 pm
Location: Chickamauga, GA

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby KI4P » Tue Aug 29, 2023 9:50 pm

Hey Guys
tried the update and went better than i expected as far as entering commands, didnt update though, tried twice. showed old version number when i checked this command

cd ~/github/Saturn/sw_projects/P2_app
./p2app

got name and email in, i think. seems hitch came here

cd ~/github/pihpsdr
git pull (said already up to date)
make clean
make


seems it didnt download file. file in directory reads 31 july.
so question i need help on is how to get new file.
thanks in advance for advice
Richard - KI4P
dl4zbg
Posts: 164
Joined: Sun Apr 09, 2017 5:33 pm
Location: JO41QG

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby dl4zbg » Tue Aug 29, 2023 9:59 pm

download/file.php?mode=view&id=3730

yesterday my piHPSDR update was succesfull, but git pull of Saturn FW/p2app failes due to this attached error. Any idea?

TNX

Volker
Attachments
IMG_3096 2.png
IMG_3096 2.png (13.98 MiB) Viewed 20553 times
laurencebarker
Posts: 225
Joined: Mon Nov 11, 2019 7:39 pm

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby laurencebarker » Wed Aug 30, 2023 6:33 pm

I suspect you have done a git pull, built the code (creating a new p2app executable) then done a git pull again.

delete p2app executable and re-do git pull
Laurence Barker G8NJJ
Dennis
Posts: 26
Joined: Wed Sep 09, 2020 11:18 am
Location: Bundaberg QLD AU

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby Dennis » Wed Aug 30, 2023 8:32 pm

I also would to thank Laurence for all of his hours and dedication towards this new project,
simple plain explanations have assisted this Ole Man here, plus many kudos to George W7GES for quick replies.

Super impressed with G2 no face after FW update and XLR Balanced audio working,

Kind Regards and Thank you ,
Laurence & George
de Dennis vk4sx
dl4zbg
Posts: 164
Joined: Sun Apr 09, 2017 5:33 pm
Location: JO41QG

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby dl4zbg » Wed Aug 30, 2023 9:15 pm

TNX

all good now and new Thetis does now all what I've been missing....

73
Volker
KI4P
Posts: 65
Joined: Sat Jul 16, 2022 3:46 pm
Location: Chickamauga, GA

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby KI4P » Thu Aug 31, 2023 12:36 am

laurencebarker wrote:I suspect you have done a git pull, built the code (creating a new p2app executable) then done a git pull again.

delete p2app executable and re-do git pull



Thanks from me Laurence, realized I had same error as Volker, I just renamed it and everything fell into place.
Thanks again for you help!
Richard
Richard - KI4P
User avatar
DL1OF
Posts: 28
Joined: Tue Apr 11, 2017 12:38 pm

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby DL1OF » Thu Aug 31, 2023 11:43 am

dl4zbg wrote:https://community.apache-labs.com/download/file.php?mode=view&id=3730

yesterday my piHPSDR update was succesfull, but git pull of Saturn FW/p2app failes due to this attached error. Any idea?

TNX

Volker


Hi Volker,

In this case you can perform a 'git stash' before the 'git pull' to save your current directory.

"
Use git stash when you want to record the current state of the working directory and the index, but want to go back to a clean working directory. The command saves your local modifications away and reverts the working directory to match the HEAD commit.
"

73 Bernhard , DL1OF
Torrey
Posts: 44
Joined: Tue Jan 17, 2023 11:57 pm
Location: West Des Moines, Iowa, USA

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby Torrey » Thu Aug 31, 2023 6:13 pm

KI4P wrote:
laurencebarker wrote:I suspect you have done a git pull, built the code (creating a new p2app executable) then done a git pull again.

delete p2app executable and re-do git pull



Thanks from me Laurence, realized I had same error as Volker, I just renamed it and everything fell into place.
Thanks again for you help!
Richard


Right now, my screen looks like your screen save of the error.
Please clarify what you mean by "I just renamed it and everything fell into place". What did you rename?

Tnx Torrey N9PY
KI4P
Posts: 65
Joined: Sat Jul 16, 2022 3:46 pm
Location: Chickamauga, GA

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby KI4P » Sat Sep 02, 2023 1:14 am

I just went into the folder that had the p2app executable in it and renamed that one file. And gitpull didn't see it and got the new file
Richard - KI4P
ct1iqi
Posts: 36
Joined: Thu Jul 06, 2023 4:01 pm

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby ct1iqi » Tue Sep 26, 2023 5:54 pm

@Laurence Barker G8NJJ
quick question: current Linux kernels have a Xilinx 'xdma' driver that one can choose. Yet the source code of the xdma module on github/Saturn is quite different. Would the current xdma module also interface to the Saturn FPGA, or are the two distinctly different, just sharing the name?
laurencebarker
Posts: 225
Joined: Mon Nov 11, 2019 7:39 pm

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby laurencebarker » Tue Sep 26, 2023 6:37 pm

I have absolutely no idea - first I've heard of it!

I presume this refers to the same thing:

The AMD-Xilinx XDMA code went through many rounds of review and addressing various upstream developer feedback. Waiting for this XDMA driver to be mainlined has held up other driver code relying on Xilinx FPGAs from being upstreamed. Other developers have sought for the XDMA driver to be mainlined to ease their general setup/deployments.

The XDMA driver was previously maintained by Xilinx out-of-tree so it's nice seeing it all come together finally upstream for Linux 6.3. The introduction of the XDMA driver is the most exciting aspect of today's DMA engine updates for the Linux 6.3 merge window. Linux 6.3 stable in turn should be out around April.


Is it available for ARM processors? If so, it is the same driver so try it. I have absolutely no idea how to install it from anywhere else. We have not modified that driver - just made two corrections to make it work on ARM. (Xilinx don't support it on ARM, or at least didn't).
Laurence Barker G8NJJ
Trucker
Posts: 308
Joined: Wed Nov 03, 2021 5:16 pm

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby Trucker » Tue Sep 26, 2023 7:29 pm

Laurance, if you didn't modify the driver, where did you make the "corrections " to make it work on ARM processors?
Not trying to be difficult. I just want to understand what needs to be done to make the XDMA interface work correctly.
James
WD5GWY
ct1iqi
Posts: 36
Joined: Thu Jul 06, 2023 4:01 pm

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby ct1iqi » Tue Sep 26, 2023 9:58 pm

@Laurence; encountered the xdma code in kernel 6.5. The xdma.c code starts with this intro:
/*
* The DMA/Bridge Subsystem for PCI Express allows for the movement of data
* between Host memory and the DMA subsystem. It does this by operating on
* 'descriptors' that contain information about the source, destination and
* amount of data to transfer. These direct memory transfers can be both in
* the Host to Card (H2C) and Card to Host (C2H) transfers. The DMA can be
* configured to have a single AXI4 Master interface shared by all channels
* or one AXI4-Stream interface for each channel enabled. Memory transfers are
* specified on a per-channel basis in descriptor linked lists, which the DMA
* fetches from host memory and processes. Events such as descriptor completion
* and errors are signaled using interrupts. The core also provides up to 16
* user interrupt wires that generate interrupts to the host.
*/
This topic is rather specialistic and I wonder whether the current FPGA programming is compatible with this mainline xdma driver, or just an entirely different and earlier approach to the same end effect, but requiring the driver you publish on github/ laurencebarker /
Saturn .
laurencebarker
Posts: 225
Joined: Mon Nov 11, 2019 7:39 pm

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby laurencebarker » Fri Sep 29, 2023 4:57 pm

We didn't modify the functionality of the driver; we simply fixed errors that prevented it working in an ARM processor. Xilinx have never supported it on ARM. There are details of the changes somewhere in the github repository. One (that I found) related to a 64 bit word being written into a 32 bit variable, because the ARM and Intel compilers generate different integer sizes by default. Another related to the DMA engine. Both fixes were reported to Xilinx, who really didn't care.

If it turns of that the linux build comes with native support then perhaps the local copy can be discontinued. I don't know how to get it to use the one shipped in the linux build though. I wouldn't expect it to do anything different, and may not be available for ARM anyway.
Laurence Barker G8NJJ
ct1iqi
Posts: 36
Joined: Thu Jul 06, 2023 4:01 pm

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby ct1iqi » Sun Oct 01, 2023 11:47 am

@laurence:
tnx for background info!
Using the Armbian environment made an image on basis of arm64 architecture and kernel 6.5, but with just enough in the OS to let pihpsdr show its GUI. So basically just cli plus X11 and Openbox Have patched 'your' xdma driver into it and for now called it xdma2 as the xdma name is already used in that kernel. Had to add some small patches to make it compile as some functions, deprecated in kernel 5, were removed or changed in 6. I add the patches, just remove the .txt as .patch does not upload here.
The good news: the audio chopping is gone, using embedded pihpsdr
The bad news: 384 k rate with two receivers is the max. That brings CPU load close to 100%. The massive calculus that wdsp has to do is just to much at higher rates.
p2app works fine and even copes with 1.5 M rate. At 2 x 768k rate it gets the CPUs in the 30-40 % load range. So xdma as such works just fine.
When using embedded pihpsdr there is some effect noticeable in the audio from events in the GUI. When by mouse movement in a menu over a clickable box that box changes color, some effect in the audio is audible. So there are some issues with interrupt priorities it seems.
For some reason with embedded pihpsdr the microphone input is not working while using p2app and an external pihpsdr it works. wdsp, pihpsdr, and p2app are all 100% the current github ones, no changes made.
Attachments
0003-xdma2_kernel_revert.patch.txt
(2.55 KiB) Downloaded 204 times
0002-xdma2_kernel6.patch.txt
(5.22 KiB) Downloaded 220 times
0001-xdma2.patch.txt
(247.3 KiB) Downloaded 210 times
laurencebarker
Posts: 225
Joined: Mon Nov 11, 2019 7:39 pm

Re: G2 Software and Firmware Updates 27 Aug 2023

Postby laurencebarker » Sun Oct 01, 2023 4:17 pm

We are in the process of changing the firmware, p2app and piHPSDR to work with enlarged FIFO buffers in the FPGA. Debug code has identified that we were stalling the software waiting for a speaker FIFO to empty. Hopefully a combination of enlarged buffers and a different way for the software to transfer data will fix that.

Yes, I noticed the GUI activity can cause lost data problems with Thetis too. As at today it is very stable - no lost data packets - in normal operation at FS=1536KHz with one receiver; if RX2 is enabled a tiny amount of data may be lost.

2 receivers at 384KHz is at the upper end of what I'd expect from piHPSDR, I consider that to be success. Hopefully in a few months there will be news of a pi5 compute module.
Laurence Barker G8NJJ

Return to “G2 Operating System & Applications”