libresdr icon indicating copy to clipboard operation
libresdr copied to clipboard

How to populate firmware to QSPI flash (internal) ?

Open kovalroma opened this issue 1 year ago • 17 comments

Hello,

Could you please provide more details on how to write firmware to the internal flash drive? I've successfully run your firmware from the SD Card and now want to transfer it to the QSPI flash.

In your instructions, you mentioned:

Once it is running, the software can be updated using a mounted drive, just like with PlutoSDR. This will populate the QSPI flash, and LibreSDR will be able to run without an SD Card, with USB OTG acting as the normal PlutoSDR.

However, I am having trouble with DFU not working in my case. Could you please direct me to some documentation for LibreSDR?

Thanks!

kovalroma avatar Jan 09 '24 17:01 kovalroma

Thank you for the question, and glad to know the firmware works for you!

Actually I never tried the reprogram the SPI flash, so I am not sure about the procedure. I assume the standard procedure of PlutoSDR should work similarly. Unfortunately I don't have time recently to test this out.

If you figure it out, it will be great if you can update the instructions on the README page and submit a pull request. Your contribution will be greatly appreciated.

hz12opensource avatar Jan 15 '24 10:01 hz12opensource

I have successfully programmed the custom image to QSPI recently. From memory I did the following;

  1. Write the contents of build_sdimg to the root of SD card and insert it in the radio.
  2. Boot the Libre SDR with USB cable in the left hand socket of the radio (In windows) the radio is automatically then recognised as a flashdrive, Drop the contents of build_sdimg into the root of the "flashdrive" <edit - forgot this step>
  3. "eject" the card by rightclicking the USB device (in windows) the radio will reboot and flash the files
  4. Power down the radio, remove the SD card and power up. Done

Thanks once again to those who have provided the custom image.

73 Pete Mi0VAX

bbjunkie avatar Jan 15 '24 20:01 bbjunkie

@hz12opensource I found that to be able to populate the QSPI flash, I need both build_sdimg as well as frm files. Could you please also attach frm files to release section ?

kovalroma avatar Jan 18 '24 18:01 kovalroma

@kovalroma I uploaded the libre.frm and boot.frm here firmware.tar.gz for your testing. It was built using non-overclocking firmware. However I have not got a chance to test them and cannot guarantee them to work. If you manage to get success, I can try to compile other overclocking firmwares.

hz12opensource avatar Jan 21 '24 03:01 hz12opensource

@hz12opensource Thank you for you work on this firmware! Correct me if I'm wrong, but I don't think official PlutoSDR firmware works with the LibreSDR. Unfortunately, I recently messed up my LibreSDR's u-boot somehow and have only got my device to enter DFU mode by flashing your boot.frm. The SDR shows up as "Analog Devices, Inc. USB download gadget" which I can then use dfu-util to attempt flashing PlutoSDR's official DFU firmware. Would you happen to have dfu files I could use to attempt a recovery?

Quarmire avatar Jan 25 '24 04:01 Quarmire

@Quarmire You can boot from SD Card and flash the original firmware back.

You can take a look at /sbin/update.sh, which contains the actual update procedure. It will be executed once you copy firmware to the virtual "flashdrive". The firmware update was done using some dd commands to /dev/mtdblockX https://github.com/hz12opensource/libresdr/blob/380307610ba56403268c664afddba88bc9d326b3/patches/buildroot.diff#L7610

hz12opensource avatar Jan 26 '24 07:01 hz12opensource

@hz12opensource I utilized all the dd commands in the update.sh file. The firmware seems to have been written to the QSPI flash successfully; however, upon powering off the device and removing the SD card, the SDR shows up as an "Analog Devices, Inc. USB download gadget". This proves that the firmware flashes properly, but it does not boot properly. As of now, I can still utilize the SDR via SD card, but if you come up with a solution, then I'm all ears.

Quarmire avatar Jan 26 '24 17:01 Quarmire

I have the same issue with my LibreSDR. It's working only from SD. But in addition my LibreSDR not working on 192.168.2.1 a diagnostic_report.txt nd looks like some issue with ethernet.

alokot avatar Jan 29 '24 16:01 alokot

@kovalroma I uploaded the libre.frm and boot.frm here firmware.tar.gz for your testing. It was built using non-overclocking firmware. However I have not got a chance to test them and cannot guarantee them to work. If you manage to get success, I can try to compile other overclocking firmwares.

Hello, I've checked your firmware. An error occurred.

# update_frm.sh ./libre.frm 
239+1 records in
239+1 records out
Warning: Bad CRC, using default environment
Done

Something wrong.

md5sum libre.frm 
075599e6b16630d2826aec8034304666  libre.frm

kovalroma avatar Jan 31 '24 20:01 kovalroma

@Quarmire hello, You can try this firmware Archive was built based on this repo

  1. Boot with SD card from this repo

  2. Log in to SSH and run

    update_frm.sh ./pluto.frm
    

    /pluto.frm file in archive

  3. Then turn off you device. Eject SD card and turn it on. After this it should boot from internal MMC.

kovalroma avatar Feb 11 '24 10:02 kovalroma

Thank you, @kovalroma ! Your solution worked, and the LibreSDR is booting from the QSPI again. I simply flashed the LibreSDR with libre.frm using the mass storage device method one would use for a PlutoSDR.

Quarmire avatar Feb 12 '24 04:02 Quarmire

I solved a bit another way:

  1. unpack libre_base_release_0.37.zip on sdcard and runed with it

  2. When LibreSDR was started from sdcard, I copy from libre_base_release_0.37.zip all files *.frm to pluto virtual disk

  3. Eject pluto virtual disk and wait when it started again.

  4. When Libre was started I disconnect power and remove sdcard from device

libre_base_release_0.37.zip

It's work for me

Antowka avatar Apr 22 '24 12:04 Antowka

Thanks. It worked for me as well.

However the blue LED did not blink like in the original Pluto. Had to just wait...

4Z1ZV avatar Jan 10 '25 11:01 4Z1ZV