LimeSDR Mini 2.0: Issues After Upgrading Gateware to v3.4

I noticed that the gateware version on my LimeSDR Mini 2.0 was quite old, so I upgraded it to the latest version (3.4) from the LimeSDR_GW GitHub repository using the limeFlash CLI.

The upgrade itself completed successfully, but when I run limeDevice --full, the GPS Lock indicators show “Glonass – 3D”, even though the LimeSDR Mini 2.0 has no GNSS connection at all.

Since this looked strange, I attempted to roll back the gateware to version 3.3, but I encountered the following error:

limeFlash --target="FPGA/FLASH" limesdr_mini_v2.bit
File size : 508640 bytes.
Programming failed! Unknown command
Device programming failed.

It appears that there may be some incompatibility between limeFlash and the latest gateware.

Is there any alternative method to write a gateware bitstream to the FPGA flash on the LimeSDR Mini 2.0?

It’s not an issue, the limeDevice simply reads FPGA registers and interprets them, even if those registers don’t exists a value is returned.

It seems the latest gateware bitstream was built without FLASH writing command. Most likely caused by a bad source merge. LimeSDR_GW/firmware/main.c at c84c1500be6af5db1a2dc796e702fe102447ad5b · myriadrf/LimeSDR_GW · GitHub

Thank you for the clarification. If the latest gateware bitstream was built without the FLASH writing command, what is the recommended way to write a correct gateware image to the flash?

Tagging @VytautasB

Hi,

looks like issue was caused by update on LiteX side where spiflash_core was renamed to spiflash:

Latest gateware was build using latest LiteX version and mentioned change caused that GW update command was not included in the build. I will fix this.

In your case gateware can be updated via JTAG cable:

I understand that recovering the LimeSDR Mini 2.0 requires writing the flash via JTAG. Could you please clarify one point? Do I need to generate the limesdr_mini_v2.mcs iHex file myself in order to reprogram the board, or can I simply use the prebuilt limesdr_mini_v2.bin file provided in the bitstream/LimeSDR_Mini_V2 folder of the LimeSDR_GW repository?

Hi @osqzss,

The .mcs file is generated during the flash process using this command:

python3 -m boards.targets.limesdr_mini_v2 --flash

but it requires the project to be built first:
python3 -m boards.targets.limesdr_mini_v2 --build

If you want to use one of the prebuilt bitstreams you can comment this line in mcs generation script and run it from tools/ directory:

then mcs file will be generated in bitstream directory and you can run openFpgaLoader from main project directory to program your board:

openFPGALoader --cable ft2232 --write-flash --bitstream bitstream/LimeSDR_Mini_V2/limesdr_mini_v2.mcs

Thanks. Suggest we include a step to test flash functionality before making a new release and publishing programming files.

I have pushed fix for GW update command:

Since 3.4 was not tagged release thus not fully tested I have updated README to clearly state where to find stable and tested work and corresponding programming files - Tagged Releases. Also I would like to encourage users to try latest updates in master/develop branches but recommend to have JTAG cable prepared just in case you need to revert to last working state.

Hi @VytautasB,

Since building the gateware from source requires a large number of tools, I plan to follow your instructions and generate the .mcs file from the prebuilt bitstream instead. Could you clarify what the minimum required tools are for this process? From what I understand, I will need Lattice Diamond to generate the .mcs file from the .bit and golden.bit files, and openFPGALoader to write the .mcs file to the flash. Are there any additional tools that I need to install before performing these steps?

Also, is there any particular reason why the GitHub repository provides prebuilt .bit files but not the corresponding .mcs files needed for flashing?

Hi @osqzss,

together with FLASH programming command fix I have also included .mcs file, so you should be able to programm using just opeFPGALoader.

1 Like

I received the FT2232H mini module from DigiKey today and proceeded to update the faulty gateware on my LimeSDR Mini v2. I also picked up a pogo-pin probe clip, which is very convenient since it avoids the need to solder anything directly onto the LimeSDR board:

I essentially followed the LimeSDR Mini v2 gateware build instructions, but there is one important note regarding the connection between the LimeSDR Mini v2 and the FT2232H mini module. If the VCCIO pin of the FT2232H is not powered correctly, the device will appear as an FT4232H instead. Because the VCCIO pin is powered only by the 3.3V output on the LimeSDR Mini v2, you must first connect the LimeSDR Mini v2 to the PC via USB so that it provides 3.3V, and then connect the FT2232H mini module.

Aside from that detail, the programming process was straightforward, and I was able to successfully update the gateware.

Many thanks to everyone here for the advice and support throughout this issue. It was extremely helpful :slight_smile:

2 Likes