# Beginner's Example

**URL:** <https://forums.sifive.com/t/beginners-example/3079>\
**Category:** HiFive1 Rev B\
**Created:** [December 1, 2019, 3:58am UTC](https://forums.sifive.com/t/beginners-example/3079 "2019-12-01T03:58:59Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Balaji](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/balaji/32/779_2.png) [@Balaji](https://forums.sifive.com/u/Balaji)\
**Post date:** [December 1, 2019, 3:58am UTC](https://forums.sifive.com/t/beginners-example/3079/1 "2019-12-01T03:58:59Z")

</div>

Hi SiFive team!  
I am new to SiFive’s HiFive01. I have worked on Arduinos and Arduino IDE for years.I find it difficult to use Freedom Studio with HiFive01 board.I cant even find any examples, like blinking led, temperature sensor output in terminal.

Please give me some examples and give me some functions like arduino’s

pinMode(pin,OUTPUT);  
pinMode(pin,INPUT);  
digitalWrite(pin,OUTPUT);  
digitalRead(pin,OUTPUT);

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Almindor](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/almindor/32/662_2.png) [@Almindor](https://forums.sifive.com/u/Almindor)\
**Post date:** [December 1, 2019, 4:03am UTC](https://forums.sifive.com/t/beginners-example/3079/2 "2019-12-01T04:03:54Z")

</div>

If you’re willing to try using Rust instead of C you can check out [this repo](https://github.com/riscv-rust/riscv-rust-quickstart) for all of those and some more.

NOTE: I’m not trying to “sell” Rust here, when I started playing around with the Hifive1/revB board I found the C code and their whole framework extremely confusing. I found out about the Rust side of things and never looked back (even as a Rust noob). Others might see things differently of course.

---

<div class="post-metadata">

**Author:** ![Balaji](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/balaji/32/779_2.png) [@Balaji](https://forums.sifive.com/u/Balaji)\
**Post date:** [December 1, 2019, 11:23am UTC](https://forums.sifive.com/t/beginners-example/3079/3 "2019-12-01T11:23:49Z")

</div>

So, there is No way to use Freedom Studio- HiFive01- C programming language …  
🙄

---

<div class="post-metadata">

**Author:** ![Almindor](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/almindor/32/662_2.png) [@Almindor](https://forums.sifive.com/u/Almindor)\
**Post date:** [December 1, 2019, 4:24pm UTC](https://forums.sifive.com/t/beginners-example/3079/4 "2019-12-01T16:24:42Z")

</div>

I’m sure there is. I got some basics working but the setup process and issues I faced were just offputting. It also seemed extremely heavy.

IIRC the freedom SDK (not the studio) had some examples in it that mostly worked ok.

---

<div class="post-metadata">

**Author:** ![Balaji](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/balaji/32/779_2.png) [@Balaji](https://forums.sifive.com/u/Balaji)\
**Post date:** [December 1, 2019, 4:51pm UTC](https://forums.sifive.com/t/beginners-example/3079/5 "2019-12-01T16:51:12Z")

</div>

How are you using HiFive01??  
Please i dont know anyone who knows about HiFive, Guide me please??

---

<div class="post-metadata">

**Author:** ![TaLucGiaHoang](https://avatars.discourse-cdn.com/v4/letter/t/54ee81/32.png) [@TaLucGiaHoang](https://forums.sifive.com/u/TaLucGiaHoang)\
**Post date:** [December 2, 2019, 3:02am UTC](https://forums.sifive.com/t/beginners-example/3079/6 "2019-12-02T03:02:47Z")

</div>

You can get example projects in Freedom Studio.  
Go to File \> New \> Freedom E SDK Software Project

Or you can view my tutorial video at [https://youtu.be/zp-xVC4vuoA](https://youtu.be/zp-xVC4vuoA)

---

<div class="post-metadata">

**Author:** ![Balaji](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/balaji/32/779_2.png) [@Balaji](https://forums.sifive.com/u/Balaji)\
**Post date:** [December 2, 2019, 4:14am UTC](https://forums.sifive.com/t/beginners-example/3079/7 "2019-12-02T04:14:23Z")

</div>

Thanks for the reply sir!

Can u please sent me the bare metal code.  
**Thanks a lot**

---

<div class="post-metadata">

**Author:** ![TaLucGiaHoang](https://avatars.discourse-cdn.com/v4/letter/t/54ee81/32.png) [@TaLucGiaHoang](https://forums.sifive.com/u/TaLucGiaHoang)\
**Post date:** [December 2, 2019, 7:10am UTC](https://forums.sifive.com/t/beginners-example/3079/8 "2019-12-02T07:10:10Z")

</div>

If you have downloaded the Freedom Studio  
You can find software examples in  
`<FreedomStudio directory>\SiFive\freedom-e-sdk-v201908\software`

and metal code in  
`<FreedomStudio directory>\SiFive\freedom-e-sdk-v201908\freedom-metal`

---

<div class="post-metadata">

**Author:** ![ikravets](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/ikravets/32/720_2.png) [@ikravets](https://forums.sifive.com/u/ikravets)\
**Post date:** [December 9, 2019, 9:55pm UTC](https://forums.sifive.com/t/beginners-example/3079/9 "2019-12-09T21:55:30Z")

</div>

Hi,

Please take a look at [PlatformIO]([https://platformio.org](https://platformio.org)]. It has an extension for VSCode which is easy for use. See demos [PlatformIO SiFive dev/platform 1.0.0: IP Core emulation and debugging without hardware!](http://forums.sifive.com/t/platformio-sifive-dev-platform-1-0-0-ip-core-emulation-and-debugging-without-hardware/2899)

---

<div class="post-metadata">

**Author:** ![MichaelZaidman](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/michaelzaidman/32/647_2.png) [@MichaelZaidman](https://forums.sifive.com/u/MichaelZaidman)\
**Post date:** [December 11, 2019, 9:51am UTC](https://forums.sifive.com/t/beginners-example/3079/10 "2019-12-11T09:51:31Z")

</div>

You are probably looking for the Arduino IDE for Windows. It comes with essential Arduino libraries ported to Hifive1 (Rev. A) board. [https://github.com/westerndigitalcorporation/cinco](https://github.com/westerndigitalcorporation/cinco)

---

<div class="post-metadata">

**Author:** ![lfolkerts](https://avatars.discourse-cdn.com/v4/letter/l/f9ae1b/32.png) [@lfolkerts](https://forums.sifive.com/u/lfolkerts)\
**Post date:** [June 12, 2020, 2:21pm UTC](https://forums.sifive.com/t/beginners-example/3079/11 "2020-06-12T14:21:32Z")

</div>

The example projects in the IDE are using bare metal (no OS), so it is hard to run anything. Here is FreeRTOS guide:

> **[RISC-V RTOS demo targeting the SiFive HiFive1 development board - FreeRTOS -...](https://freertos.org/RTOS-RISC-V-FreedomStudio-IAR-HiFive-RevB.html)**
>
> SiFive HiFive1 RTOS demo (RISC-V) \[RTOS Ports\] This page documents pre-configured Freedom Studio (GCC) and IAR Embedded Workbench for RISC-V projects that build and runs a FreeRTOS RISC-V demo on the HiFive11 RevB evaluation board. IMPORTANT! Notes...

For linux/MAC systems, you need may need to edit PATH, "" to “/”, and .exe extensions in the project files. See:

> [@Cannot build RISC-V\_RV32\_SiFive\_HiFive1-RevB\_FreedomStudio](https://forums.sifive.com/t/cannot-build-risc-v-rv32-sifive-hifive1-revb-freedomstudio/3275):
>
> Hello, I’m trying to build the freeRTOS demo in Freedom Studio on macOS. I am getting build errors. The instructions I am following are listed here. One of the errors I’m getting is this. /bin/sh: riscv64-unknown-elf-gcc.exe: command not found The .exe makes me think that this demo is configured for Windows instead of macOS? Can anyone help me to get this to build? Thanks
