[lowrisc-dev] Errors regarding run bare metal exmaples

Wei Song ws327 at cam.ac.uk
Thu Jul 7 13:38:44 BST 2016

The line
    "elf2hex 16 4096 rv64ui-p-add > rv64ui-p-add.hex"
in the tutorial is just an example, which is not supposed to run literally.
'rv64ui-p-add' is an example program in elf format. It can be any RISC-V
program of any name.

The fd != -1 error means, the file 'rv64ui-p-add' does exist or cannot
be opened.

The function of this command is to generate a hex file from a RISC-V
program, basically translate binary elf to hex text file which is
readable by simulator.
This command will not be used for future vsim simulation (new releases).

As for downloading a bitstream to FPGA, there are many ways to do it.
You can open the vivado GUI and download bitstream to a connected FPGA
Or, you can put the bitstream into the SD card as long as there is only
one bitstream (*.bit) in the SD card.
Change the boot jumper on board to SD and the board will power on with
the bitstream downloaded to FPGA automatically.

In the latest release (will be public in days), a make target is
provided to download bitstream.

Sorry the tutorial did not make these issues more clear.

Best regards,

On 07/07/2016 01:29, Weizhong Huang wrote:
> Hello all! 
> Thank you gary for your advise.
> I have used gcc 4.8.5 to recompile the RISC-V tools
> and I tried "make hello" in kc705 folder
> There is no error in the progress.
> I still have one more confusion. When I do "elf2hex 16 4096 rv64ui-p-add > 
> rv64ui-p-add.hex"
> ---------------------------------------------------------------------------
> ~/newlowRISC/DIR/lowrisc-chip/vsim$ elf2hex 16 4096 rv64ui-p-add > rv64ui-p-
> add.hex
> elf2hex: ../fesvr/elfloader.cc:19: std::map<std::__cxx11::basic_string<char>, 
> long unsigned int> load_elf(const char*, memif_t*): Assertion `fd != -1' 
> failed.
> ---------------------------------------------------------------------------
> Not quite sure what does it mean.
> The other thing is about UART
> I was able to connect to ttyUSB2 port by 
> -------------------------------------------------------------------------
> ~/newlowRISC/DIR/lowrisc-chip/fpga/board/kc705$ microcom -p /dev/ttyUSB2 -s 
> 115200
> connected to /dev/ttyUSB2
> Escape character: Ctrl-\
> Type the escape character followed by c to get to the menu or q to quit
> -------------------------------------------------------------------------
> However, the tutorial states that "After downloading the bitstream, the UART 
> interface should print: Hello World!"
> WHat do I need to do in order to download the bitstream to UART?
> Please advise. I apologize for the silly questions.
> Thank you
> Weizhong

More information about the lowrisc-dev mailing list