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

How to populate firmware to QSPI flash (internal) ? #1

Open
kovalroma opened this issue Jan 9, 2024 · 12 comments
Open

How to populate firmware to QSPI flash (internal) ? #1

kovalroma opened this issue Jan 9, 2024 · 12 comments

Comments

@kovalroma
Copy link

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!

@hz12opensource
Copy link
Owner

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.

@bbjunkie
Copy link

bbjunkie commented Jan 15, 2024

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

@kovalroma
Copy link
Author

@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 ?

@hz12opensource
Copy link
Owner

@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.

@Quarmire
Copy link

@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?

@hz12opensource
Copy link
Owner

@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

+ grep -q "${MAGIC}" /opt/firmware.frm && dd if=/opt/firmware.frm of=/dev/mtdblock3 bs=64k && fw_setenv fit_size ${FRM_SIZE} && do_reset=1 && touch /mnt/msd/SUCCESS || touch /mnt/msd/FAILED

@Quarmire
Copy link

@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.

@alokot
Copy link

alokot commented Jan 29, 2024

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.

@kovalroma
Copy link
Author

@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
Copy link
Author

kovalroma commented Feb 11, 2024

@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.

@Quarmire
Copy link

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.

@Antowka
Copy link

Antowka commented Apr 22, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants