# HiFive1 Getting Started Guide and Other Docs are available!

**URL:** <https://forums.sifive.com/t/hifive1-getting-started-guide-and-other-docs-are-available/197>\
**Category:** HiFive1 Rev B\
**Created:** [December 21, 2016, 9:53am UTC](https://forums.sifive.com/t/hifive1-getting-started-guide-and-other-docs-are-available/197 "2016-12-21T09:53:22Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![jackckang](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/jackckang/32/831_2.png) [@jackckang](https://forums.sifive.com/u/jackckang)\
**Post date:** [December 21, 2016, 9:53am UTC](https://forums.sifive.com/t/hifive1-getting-started-guide-and-other-docs-are-available/197/1 "2016-12-21T09:53:22Z")

</div>

> **[Documentation - SiFive](https://www.sifive.com/documentation/)**
>
> Manuals, user guides, and other documentation for SiFive's RISC-V Core IP, chips, development boards, and tools.

Please share with us what you’re doing with your board! We’re looking forward to seeing them in action!

---

<div class="post-metadata">

**Author:** ![dagema](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/dagema/32/59_2.png) [@dagema](https://forums.sifive.com/u/dagema)\
**Post date:** [December 21, 2016, 11:14am UTC](https://forums.sifive.com/t/hifive1-getting-started-guide-and-other-docs-are-available/197/2 "2016-12-21T11:14:46Z")

</div>

Hi Jack,

I see a typo in the hifive1-getting-started-guide: The vendor ID for the Olimex debugger is **15ba** , and **NOT 1b5a** as listed.

---

<div class="post-metadata">

**Author:** ![dgrubb](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/dgrubb/32/23_2.png) [@dgrubb](https://forums.sifive.com/u/dgrubb)\
**Post date:** [December 21, 2016, 6:00pm UTC](https://forums.sifive.com/t/hifive1-getting-started-guide-and-other-docs-are-available/197/3 "2016-12-21T18:00:38Z")

</div>

The colour-coded pinout on the last page of the Getting Started Guide is a really nice touch.

---

<div class="post-metadata">

**Author:** ![rxia](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@rxia](https://forums.sifive.com/u/rxia)\
**Post date:** [December 21, 2016, 8:17pm UTC](https://forums.sifive.com/t/hifive1-getting-started-guide-and-other-docs-are-available/197/4 "2016-12-21T20:17:49Z")

</div>

Thanks for reporting the typo. I’ve fixed the guide to use the correct vendor ID.

---

<div class="post-metadata">

**Author:** ![donb](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/donb/32/41_2.png) [@donb](https://forums.sifive.com/u/donb)\
**Post date:** [December 22, 2016, 4:42am UTC](https://forums.sifive.com/t/hifive1-getting-started-guide-and-other-docs-are-available/197/5 "2016-12-22T04:42:13Z")

</div>

Congratulations on the release!

Best,  
D

---

<div class="post-metadata">

**Author:** ![mwachs5](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/mwachs5/32/13_2.png) [@mwachs5](https://forums.sifive.com/u/mwachs5)\
**Post date:** [December 22, 2016, 7:35pm UTC](https://forums.sifive.com/t/hifive1-getting-started-guide-and-other-docs-are-available/197/6 "2016-12-22T19:35:32Z")

</div>

Glad you like it! It’s based on [https://github.com/Bouni/Arduino-Pinout](https://github.com/Bouni/Arduino-Pinout). I realized it’s missing the critical information of which pin goes to each of the R,G,B LEDs! Will add.

---

<div class="post-metadata">

**Author:** ![sflin](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@sflin](https://forums.sifive.com/u/sflin)\
**Post date:** [December 24, 2016, 5:20am UTC](https://forums.sifive.com/t/hifive1-getting-started-guide-and-other-docs-are-available/197/7 "2016-12-24T05:20:24Z")

</div>

Hi,

I received a shipment notice for my HiFiave1 board. I am checking [USPS.com](http://USPS.com) every day but it still says “Pre-Shipment Info Sent to USPS, USPS Awaiting Item”. I can’t wait…

I started preparing the SDK toolchain following to the Getting Started Guide.  
Here are what I did. I hope this helps for other readers.

* * *

download Ubuntu 16.04 VMware image from [http://www.osboxes.org/ubuntu/](http://www.osboxes.org/ubuntu/)

In addition to packages described in [https://riscv.org/software-tools/;](https://riscv.org/software-tools/;)  
`sudo apt-get install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc`

I had to;  
`sudo apt-get install zit zlib1g-dev libusb-1.0`

Compiling the SDK toolchain and demo\_gpio works fine, but I got link error for dhrystone.  
By checking Makefiles I found that I had to  
`make software_clean PROGRAM=demo_gpio`  
or  
`rm bsp/env/freedom-e300-hifive1/init.o`  
before making dhrystone.

The init.o is compiled with `"-DUSE_PLIC -DUSE_M_TIME`" and the init.o calls interrupt-handling functions which are defined in demo\_gpio.c.

You may add some descriptions about this in the document (or to modify Makefiles to put init.o under working directories).

* * *

BTW how can I build a binary using “C” Standard Extension for Compressed Instructions?  
I checked [https://riscv.org/software-tools/risc-v-gnu-compiler-toolchain/](https://riscv.org/software-tools/risc-v-gnu-compiler-toolchain/) but found no clue.

---

<div class="post-metadata">

**Author:** ![mwachs5](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/mwachs5/32/13_2.png) [@mwachs5](https://forums.sifive.com/u/mwachs5)\
**Post date:** [December 24, 2016, 5:37am UTC](https://forums.sifive.com/t/hifive1-getting-started-guide-and-other-docs-are-available/197/8 "2016-12-24T05:37:09Z")

</div>

Thanks for all your feedback and reports for making it easier for other users! All the HiFive1 Founders Edition & Early Access have been shipped out, so hopefully your tracking is updated soon.

To compile with ‘C’ extension, you will want to modify the Makefile. Look for the part where it specifies the arch:

```auto
--with-arch=rv32ima

```

Change it to:

```auto
--with-arch=rv32imac

```

We have it disabled by default because GDB gets confused by mis-aligned instructions.

---

<div class="post-metadata">

**Author:** ![sflin](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@sflin](https://forums.sifive.com/u/sflin)\
**Post date:** [December 24, 2016, 6:42am UTC](https://forums.sifive.com/t/hifive1-getting-started-guide-and-other-docs-are-available/197/9 "2016-12-24T06:42:29Z")

</div>

Thank you for your prompt reply!

It seems that Santa is working under US time. He cannot come to me by the Christmas night in Japan:-)

I see that I have to rebuild whole toolchain with the rv32imac option. It makes sense.

> [@mwachs5](#):
>
> We have it disabled by default because GDB gets confused by mis-aligned instructions.

Does this mean that the current GDB cannot handle mis-aligned instructions for RISC-V with the C extension yet?

---

<div class="post-metadata">

**Author:** ![mwachs5](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/mwachs5/32/13_2.png) [@mwachs5](https://forums.sifive.com/u/mwachs5)\
**Post date:** [December 24, 2016, 6:47am UTC](https://forums.sifive.com/t/hifive1-getting-started-guide-and-other-docs-are-available/197/10 "2016-12-24T06:47:34Z")

</div>

Right… it mostly works (like you can step through code, examine registers, etc). The main issue is that you can’t set a breakpoint on an instruction which isn’t at a 32-bit aligned address. You can see this issue here with a note on how you can hack GDB to work (but then it won’t work if your core is not C-capable):

> <https://github.com/sifive/freedom-e-sdk/issues/15>
>
> The current FE300 systems support the 'C' compressed extension, but the Makefile doesn't use it. Modify the Makefile to use compressed...

---

<div class="post-metadata">

**Author:** ![sflin](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@sflin](https://forums.sifive.com/u/sflin)\
**Post date:** [December 24, 2016, 2:49pm UTC](https://forums.sifive.com/t/hifive1-getting-started-guide-and-other-docs-are-available/197/11 "2016-12-24T14:49:00Z")

</div>

I could build dhrystone with rv32imac toolchain.

```
freedom-e-sdk$ toolchain/bin/riscv32-unknown-elf-size software/dhrystone/dhrystone 
   text data bss dec hex filename
  14416 1076 12296 27788 6c8c software/dhrystone/dhrystone

freedom-e-sdk-rv32imac$ toolchain/bin/riscv32-unknown-elf-size software/dhrystone/dhrystone 
   text data bss dec hex filename
  10892 1076 12296 24264 5ec8 software/dhrystone/dhrystone

```

Really great…

> [@](#):
>
> The main issue is that you can’t set a breakpoint on an instruction which isn’t at a 32-bit aligned address.

If I understand correctly, I can.  
The issue is that if we replace a 16-bit instruction with a 32-bit ebreak instruction, a branch to the following instruction does not work.

---

<div class="post-metadata">

**Author:** ![sflin](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@sflin](https://forums.sifive.com/u/sflin)\
**Post date:** [December 25, 2016, 2:35pm UTC](https://forums.sifive.com/t/hifive1-getting-started-guide-and-other-docs-are-available/197/12 "2016-12-25T14:35:17Z")

</div>

FYI

I found a way for gcc to select RISC-V architecture by `-march=XXX` command-line option .

According to the source code, [https://github.com/riscv/riscv-gcc/blob/riscv-gcc-6.1.0/gcc/common/config/riscv/riscv-common.c](https://github.com/riscv/riscv-gcc/blob/riscv-gcc-6.1.0/gcc/common/config/riscv/riscv-common.c), XXX can be;

`rv{32|64}g[c]` or `rv{32|64}i[mafd]*[c]`

---

<div class="post-metadata">

**Author:** ![dagema](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/dagema/32/59_2.png) [@dagema](https://forums.sifive.com/u/dagema)\
**Post date:** [December 31, 2016, 11:36am UTC](https://forums.sifive.com/t/hifive1-getting-started-guide-and-other-docs-are-available/197/13 "2016-12-31T11:36:33Z")

</div>

I am getting a 404 when trying to look at the code link on page 15 ([http://github.com/sifive/cinco](http://github.com/sifive/cinco))

---

<div class="post-metadata">

**Author:** ![sflin](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@sflin](https://forums.sifive.com/u/sflin)\
**Post date:** [January 1, 2017, 5:27am UTC](https://forums.sifive.com/t/hifive1-getting-started-guide-and-other-docs-are-available/197/14 "2017-01-01T05:27:17Z")

</div>

Hi,

I finally got HiFIve1 on the New Years’ Eve.  
I can access to the board from VMware by just connecting “Future Devices Dual RS232-HS” using pull down menu.

By creating `/etc/udev/rules.d/99-openocd.rules` as documented, `screen` works without `sudo`.  
But `"make upload"` still needs `sudo`. I don’t know why.

```
$ groups
osboxes adm cdrom sudo dip plugdev lpadmin sambashare
$ ls -l /dev/ttyUSB* 
crw-rw-r-- 1 root plugdev 188, 1 Jan 1 13:26 /dev/ttyUSB1
osboxes@osboxes:~/Work/riscv/sifive/freedom-e-sdk-rv32imac$ make upload PROGRAM=dhrystone BOARD=freedom-e300-hifive1
/home/osboxes/Work/riscv/sifive/freedom-e-sdk-rv32imac/bsp/tools/openocd_upload.sh /home/osboxes/Work/riscv/sifive/freedom-e-sdk-rv32imac/software/dhrystone/dhrystone /home/osboxes/Work/riscv/sifive/freedom-e-sdk-rv32imac/bsp/env/freedom-e300-hifive1/openocd.cfg
+ openocd -f /home/osboxes/Work/riscv/sifive/freedom-e-sdk-rv32imac/bsp/env/freedom-e300-hifive1/openocd.cfg -c 'flash protect 0 64 last off; program /home/osboxes/Work/riscv/sifive/freedom-e-sdk-rv32imac/software/dhrystone/dhrystone; resume 0x20400000; exit'
+ tee openocd_upload.log
Open On-Chip Debugger 0.10.0-dev-gb474c22 (2016-12-24-09:29)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
adapter speed: 10000 kHz
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Error: libusb_open() failed with LIBUSB_ERROR_ACCESS
Error: no device found
Error: unable to open ftdi device with vid 0403, pid 6010, description 'Dual RS232-HS', serial '*' at bus location '*'

$ 

```

I hope this helps users who only have Windows machine.

Anyway I can upload a program by using `sudo`.  
Here is the dhrystone numbers w/o and w/ the C extension.

```
rv32ima:
Microseconds for one run through Dhrystone: 1344.0 
Dhrystones per Second: 744.0 

rv32imac:
Microseconds for one run through Dhrystone: 1448.0 
Dhrystones per Second: 690.6
```

---

<div class="post-metadata">

**Author:** ![sflin](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@sflin](https://forums.sifive.com/u/sflin)\
**Post date:** [January 2, 2017, 6:44am UTC](https://forums.sifive.com/t/hifive1-getting-started-guide-and-other-docs-are-available/197/15 "2017-01-02T06:44:15Z")

</div>

The dhrystone numbers above was wrong. See [Poor Dhrystone performance](http://forums.sifive.com/t/poor-dhrystone-performance/233) for details and the correct numbers.

---

<div class="post-metadata">

**Author:** ![mwachs5](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/mwachs5/32/13_2.png) [@mwachs5](https://forums.sifive.com/u/mwachs5)\
**Post date:** [January 2, 2017, 2:22pm UTC](https://forums.sifive.com/t/hifive1-getting-started-guide-and-other-docs-are-available/197/16 "2017-01-02T14:22:06Z")

</div>

Yes, this repo is still private as I mentioned. We will resolve it soon.

---

<div class="post-metadata">

**Author:** ![hamster](https://avatars.discourse-cdn.com/v4/letter/h/a8b319/32.png) [@hamster](https://forums.sifive.com/u/hamster)\
**Post date:** [January 4, 2017, 12:57am UTC](https://forums.sifive.com/t/hifive1-getting-started-guide-and-other-docs-are-available/197/17 "2017-01-04T00:57:38Z")

</div>

I’ve got my board up and running. A few notes:

- When you set up the udev rules to allow ‘screen’ to run as a non-root user you more than likely need to remove and re-attach the board to have the device file’s permissions update. Pretty obvious but will trip somebody up.

- the making “software\_clean” between making the different demo apps to avoid linkage errors is, um, a bit obscure. It would be worthwhile to add it to the README file

- If you use Windows on your PC, use the HiFive1 from a VirtualBox VM running Ubuntu with minimal issues. This is working very well for me.
