G2 Updated files and simplified update procedure

G2 operating system and special app's (e.g. p2app) discussion only--post Thetis and piHPSDR questions in their own sub-forums
Trucker
Posts: 487
Joined: Wed Nov 03, 2021 5:16 pm

Re: G2 Updated files and simplified update procedure

Post by Trucker »

I updated the FPGA in my Ultra just yesterday from Laurence's Github page.
No issues with the front panel display. Maybe a setting that your friend was using previously has changed?
James
WD5GWY


https://github.com/laurencebarker/Saturn/tree/main/FPGA
syracusepro
Posts: 27
Joined: Fri Oct 07, 2022 3:47 pm

Re: G2 Updated files and simplified update procedure

Post by syracusepro »

I got V17 of the firmware. Trying to upgrade to V25, but there is no folder called Saturn/scripts.
Saturn is there, but within Saturn, there is no folder called scripts.
Thanks.
WB9HKO
Posts: 9
Joined: Sun Nov 16, 2025 6:52 pm

Re: G2 Updated files and simplified update procedure

Post by WB9HKO »

syracusepro wrote: Sun Nov 09, 2025 4:30 pm I got V17 of the firmware. Trying to upgrade to V25, but there is no folder called Saturn/scripts.
Saturn is there, but within Saturn, there is no folder called scripts.
Thanks.
I also have V17 firmware in my non-display G2. I can easily enough create a "scripts" directory, just don't know where to go from there. I've watched @N4VFR's video quite a few times, but not I'm sure whether to start from the @LauerenceBarker github or the @KD4YAL github since the firmware is older and components are obviously missing.

Tom
WB9HKO
Posts: 9
Joined: Sun Nov 16, 2025 6:52 pm

Re: G2 Updated files and simplified update procedure

Post by WB9HKO »

Do I just need to create a local scripts directory, then copy the contents (*.sh's) of the script directory on Lauerance's github to my RPi4 and then execute "update-G2.sh" in terminal?

Then follow with the firmware update process to update the FPGA from v17 to v25?
laurencebarker
Posts: 329
Joined: Mon Nov 11, 2019 7:39 pm

Re: G2 Updated files and simplified update procedure

Post by laurencebarker »

I can't remember when the "scripts" folder was added but it is possible that you haven't pulled it in from git yet.

open a terminal window and type:
cd ~/github/Saturn
git pull



that should net you a scripts folder!
Laurence Barker G8NJJ
WB9HKO
Posts: 9
Joined: Sun Nov 16, 2025 6:52 pm

Re: G2 Updated files and simplified update procedure

Post by WB9HKO »

laurencebarker wrote: Mon Dec 01, 2025 9:17 am I can't remember when the "scripts" folder was added but it is possible that you haven't pulled it in from git yet.

open a terminal window and type:
cd ~/github/Saturn
git pull



that should net you a scripts folder!
Thanks, that bit worked great. I then ran only the update-G2.sh script, and looking through the log file it seemed to process everything ok. Unfortunately, the Flashwriter app does not seem to be among the desktop icons any more. There is just a text file (see pic). When I ran the P2app to re-check firmware, it says the firmware v17 (major version0) is not compatible because p2app requires major version = 1, so I may have a chicken and egg problem in that I can't flash the v25?

There is still a Flashwriter directory with what looks like everything in it. Do I just execute directly from there?

UPDATE: Rebooted the pi and Flashwriter was there on the desktop as it should be. I then ran the update to v25 with success.
Saturn p2app output - 1.jpeg
Saturn p2app output - 1.jpeg (390.69 KiB) Viewed 506 times
Last edited by WB9HKO on Mon Dec 01, 2025 3:40 pm, edited 1 time in total.
WB9HKO
Posts: 9
Joined: Sun Nov 16, 2025 6:52 pm

Re: G2 Updated files and simplified update procedure

Post by WB9HKO »

Text file on desktop
Flashwriter text file on desktop - 1.jpeg
Flashwriter text file on desktop - 1.jpeg (233.82 KiB) Viewed 504 times
Flashwriter directory
Flashwriter directory - 1.jpeg
Flashwriter directory - 1.jpeg (218.31 KiB) Viewed 504 times
Log file is also attached
Attachments
saturn-update-20251201-091503.log
(56.64 KiB) Downloaded 42 times
laurencebarker
Posts: 329
Joined: Mon Nov 11, 2019 7:39 pm

Re: G2 Updated files and simplified update procedure

Post by laurencebarker »

you can run flashwriter from its own folder:


cd ~/Saturn/sw_tools/flashwriter
./flashwriter


if there is no flashwriter application file:

make clean
make
Laurence Barker G8NJJ
WB9HKO
Posts: 9
Joined: Sun Nov 16, 2025 6:52 pm

Re: G2 Updated files and simplified update procedure

Post by WB9HKO »

laurencebarker wrote: Mon Dec 01, 2025 7:45 pm you can run flashwriter from its own folder:


cd ~/Saturn/sw_tools/flashwriter
./flashwriter


if there is no flashwriter application file:

make clean
make
Thanks Laurence. I figured out to reboot the RPi and everything worked perfectly after that. Flashwriter app icon appeared, so I was able to upgrade to v25 on the FPGA also. Already made a few contacts today :-)
DO7DV
Posts: 11
Joined: Fri Oct 31, 2025 7:19 pm

Re: G2 Updated files and simplified update procedure

Post by DO7DV »

I successfully updated the FPGA to V25TTL using flashwriter.
In the source files there is a reference to a "command line tool" it was derived from. Where can I find this command line tool?

For a completley automated Anan-G2 update procedure the cli tool to program the FPGA should also be pulled into the /home/pi/github/Saturn folder.



I tried to create a new SD card for my CM4 with the most current "Trixie" release.
But I encountered problems when trying to build p2app. (everything else did compile correctly)
Below there is the output of make.

I suspect it has something to do with Trixie having libgpiod v2 (and gpiod 2.2), while in Bookworm you get libgpio v1 (and gpiod 1.6).
The new interface breaks compatibility.

Building a new SD card for CM4 with Bookworm does work.

Code: Select all

pi@raspberrypi:~/github/Saturn/sw_projects/P2_app $ make
gcc -c -o g2panel.o -Wall -Wextra -Wno-unused-function -g -D_GNU_SOURCE -D GIT_DATE='"3 Dec 2025 19:52:54"' g2panel.c
g2panel.c:100:8: error: variable ‘config’ has initializer but incomplete type
  100 | struct gpiod_line_request_config config = {"p2app", GPIOD_LINE_REQUEST_DIRECTION_INPUT, 0};
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~
g2panel.c:100:44: warning: excess elements in struct initializer
  100 | struct gpiod_line_request_config config = {"p2app", GPIOD_LINE_REQUEST_DIRECTION_INPUT, 0};
      |                                            ^~~~~~~
g2panel.c:100:44: note: (near initialization for ‘config’)
g2panel.c:100:53: error: ‘GPIOD_LINE_REQUEST_DIRECTION_INPUT’ undeclared here (not in a function); did you mean ‘GPIOD_LINE_DIRECTION_INPUT’?
  100 | struct gpiod_line_request_config config = {"p2app", GPIOD_LINE_REQUEST_DIRECTION_INPUT, 0};
      |                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                     GPIOD_LINE_DIRECTION_INPUT
g2panel.c:100:53: warning: excess elements in struct initializer
g2panel.c:100:53: note: (near initialization for ‘config’)
g2panel.c:100:89: warning: excess elements in struct initializer
  100 | struct gpiod_line_request_config config = {"p2app", GPIOD_LINE_REQUEST_DIRECTION_INPUT, 0};
      |                                                                                         ^
g2panel.c:100:89: note: (near initialization for ‘config’)
g2panel.c: In function ‘VFOEventHandler’:
g2panel.c:260:29: error: storage size of ‘Event’ isn’t known
  260 |     struct gpiod_line_event Event;
      |                             ^~~~~
g2panel.c:265:21: error: implicit declaration of function ‘gpiod_line_event_wait’; did you mean ‘gpiod_edge_event_cop’? [-Wimplicit-function-declaration]
  265 |         returnval = gpiod_line_event_wait(VFO1, &ts);
      |                     ^~~~~~~~~~~~~~~~~~~~~
      |                     gpiod_edge_event_copy
g2panel.c:268:25: error: implicit declaration of function ‘gpiod_line_event_read’; did you mean ‘gpiod_edge_event_fre’? [-Wimplicit-function-declaration]
  268 |             returnval = gpiod_line_event_read(VFO1, &Event);            // undocumented: this is needed to clear the event
      |                         ^~~~~~~~~~~~~~~~~~~~~
      |                         gpiod_edge_event_free
g2panel.c:269:28: error: implicit declaration of function ‘gpiod_line_get_value’; did you mean ‘gpiod_line_request_get_value’? [-Wimplicit-function-declaration]
  269 |             DirectionBit = gpiod_line_get_value(VFO2);
      |                            ^~~~~~~~~~~~~~~~~~~~
      |                            gpiod_line_request_get_value
g2panel.c:260:29: warning: unused variable ‘Event’ [-Wunused-variable]
  260 |     struct gpiod_line_event Event;
      |                             ^~~~~
g2panel.c: In function ‘G2PanelTick’:
g2panel.c:343:9: error: implicit declaration of function ‘gpiod_line_get_value_bulk’ [-Wimplicit-function-declaration]
  343 |         gpiod_line_get_value_bulk(&PBInLines, IOPinValues);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~
g2panel.c: In function ‘SetupG2PanelGPIO’:
g2panel.c:442:16: error: implicit declaration of function ‘gpiod_chip_get_line’; did you mean ‘gpiod_chip_get_info’? -Wimplicit-function-declaration]
  442 |         VFO1 = gpiod_chip_get_line(chip, 17);
      |                ^~~~~~~~~~~~~~~~~~~
      |                gpiod_chip_get_info
g2panel.c:442:14: error: assignment to ‘struct gpiod_line *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  442 |         VFO1 = gpiod_chip_get_line(chip, 17);
      |              ^
g2panel.c:443:14: error: assignment to ‘struct gpiod_line *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  443 |         VFO2 = gpiod_chip_get_line(chip, 18);
      |              ^
g2panel.c:445:9: error: implicit declaration of function ‘gpiod_line_request_rising_edge_events’; did you mean ‘gpiod_line_request_read_edge_events’? [-Wimplicit-function-declaration]
  445 |         gpiod_line_request_rising_edge_events(VFO1, "VFO 1");
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |         gpiod_line_request_read_edge_events
g2panel.c:446:9: error: implicit declaration of function ‘gpiod_line_request_input’; did you mean ‘gpiod_line_request_get_fd’? [-Wimplicit-function-declaration]
  446 |         gpiod_line_request_input(VFO2, "VFO 2");
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
      |         gpiod_line_request_get_fd
g2panel.c:449:9: error: implicit declaration of function ‘gpiod_chip_get_lines’; did you mean ‘gpiod_chip_get_info’? -Wimplicit-function-declaration]
  449 |         gpiod_chip_get_lines(chip, PBIOPins, VNUMGPIO, &PBInLines);
      |         ^~~~~~~~~~~~~~~~~~~~
      |         gpiod_chip_get_info
g2panel.c:450:9: error: implicit declaration of function ‘gpiod_line_request_bulk’; did you mean ‘gpiod_line_request_get_fd’? [-Wimplicit-function-declaration]
  450 |         gpiod_line_request_bulk(&PBInLines, &config, IOPinValues);
      |         ^~~~~~~~~~~~~~~~~~~~~~~
      |         gpiod_line_request_get_fd
g2panel.c: In function ‘ShutdownG2PanelHandler’:
g2panel.c:531:9: error: implicit declaration of function ‘gpiod_line_release’; did you mean ‘gpiod_line_request_release’? [-Wimplicit-function-declaration]
  531 |         gpiod_line_release(VFO1);
      |         ^~~~~~~~~~~~~~~~~~
      |         gpiod_line_request_release
g2panel.c:533:9: error: implicit declaration of function ‘gpiod_line_release_bulk’ [-Wimplicit-function-declaration]
  533 |         gpiod_line_release_bulk(&PBInLines);
      |         ^~~~~~~~~~~~~~~~~~~~~~~
g2panel.c: At top level:
g2panel.c:99:24: error: storage size of ‘PBInLines’ isn’t known
   99 | struct gpiod_line_bulk PBInLines;
      |                        ^~~~~~~~~
g2panel.c:100:34: error: storage size of ‘config’ isn’t known
  100 | struct gpiod_line_request_config config = {"p2app", GPIOD_LINE_REQUEST_DIRECTION_INPUT, 0};
      |                                  ^~~~~~
make: *** [Makefile:31: g2panel.o] Error 1
laurencebarker
Posts: 329
Joined: Mon Nov 11, 2019 7:39 pm

Re: G2 Updated files and simplified update procedure

Post by laurencebarker »

Martin CT1IQI has already reported the issue with newer kernels and libgpiod. Yesterday he sent me code to try, but I don't know yet if I can test it. If I can it won't be till next week because my access to the radio is blocked by visitors.

The command line flash programmer is available in ~/github/Saturn/sw_tools/spiload. I will need to work out the offset address that the flash device should be written to (it isn't zero, or the "fall back boot" process will be lost).
Laurence Barker G8NJJ
kd4yal
Posts: 7
Joined: Tue Apr 09, 2024 11:17 am

Re: G2 Updated files and simplified update procedure

Post by kd4yal »

Hi all,

I’ve been running Raspberry Pi OS Trixie since its release and have developed several patches in my GitHub repo to address the issues I encountered getting Trixie working on the G2 CM module. I think the bigger long-term concern is how GPIO will be handled to maintain compatibility across OS versions. Also, please note that my patches have not been tested on an Ultra I have only tested with the (black face) unit.

https://github.com/kd4yal2024/Saturn/tree/main/scripts

I also have a Trixie image that’s currently being tested by several users. So far, the only issue being reported is IPv4 link-local (APIPA). It was widely expected that IPv4 link-local behavior would be “fixed” in Trixie, but reports still indicate cases where IPv4LL/APIPA is not assigned correctly, depending on the configuration and how NetworkManager is provisioned. I have a patch for this as well, but I’m continuing to validate it before publishing it to GitHub.


Jerry, KD4YAL
Post Reply

Return to “G2 Operating System & Applications”