Forum Discussion

FabianL's avatar
FabianL
Icon for Occasional Contributor rankOccasional Contributor
9 hours ago

RiscFree IDE may download corrupted .elf without warning

Hello,

I have noticed, that in case the JTAG frequency is too high for the target, downloading a .elf via RiscFree for debugging may cause corrupted data:

Preconditions:

  • Use a off-board USB-Blaster-II 
  • Arria 10 FPGA
  • Select 24 MHz JTAG frequency (off-board USB-Blaster II is not capable of 24 MHz with Arria 10 designs, see here )

Steps to reproduce:

  • With the cable at the default 24 MHz, start a debug session that downloads the ELF (load).
  • Run compare-sections .text.
  • Expected: The section matches, or load reports an error.
  • Actual: load completes with no error, but the section does not match:
(gdb) compare-sections .text
Section .text, range 0x20080380 -- 0x2008c1c8: MIS-MATCHED!
warning: One or more sections of the target image does not match
the loaded file

Environment

  • Quartus Prime Pro 25.1 Standard & 25.3 Pro
  • RiscFree IDE v25.2.1, 9th May 2025
  • Ashling GDB server ash-riscv-gdb-server v25.2.1, 09-May-2025
  • GDB riscv32-unknown-elf-gdb shipped with RiscFree
  • Device Arria 10 GX
  • Cable USB-Blaster II
  • CPU Nios V/m, pipelined, debug enabled, 200 MHz
  • Host OS Windows 11

Workaround:

Adding the compare-sections to run command and abort in case of any mismatch leads to the expected error in case of corrupted download:

python o = gdb.execute("compare-sections", to_string=True); assert "MIS-MATCHED" not in o, o

 

Summary:

This is a critical error in the behavior of RiscFree. Downloading a corrupted .elf without any warnings/error could cause a large variety of errors.

The corrupted data can be assumed to be random. Hence 2 subesquent downloads won't result in the same behavior. This makes debugging extremely hard. Since data and code sections may be affected this could even cause harmfull behavior of the NIOS application or security risks.

Altera: Please considere this as critical!

I would be thankful for any news on when this will be fixed.

 

best regards

Fabian

 

1 Reply

  • ai_responder's avatar
    ai_responder
    Icon for Community Manager rankCommunity Manager

    Thank you for your inquiry. To ensure an accurate response, your request has been routed to an Altera application engineer for further review and assistance.


    Note: To continue using AI Responder, please start your next inquiry with ai_responder

    Disclaimer: AI-generated responses may contain errors or omissions. Please verify technical guidance with official Altera documentation before implementation.

    Thank you very much.