Coder Social home page Coder Social logo

cinco's Introduction

README

This repository allows you to program Freedom E300 boards using the Arduino IDE. You can install this repository in two ways:

  • Using the Arduino Boards Manager (Currently supported for Linux and macOS) to download precompiled binaries
  • Manually compiling the tools (Suggested for platforms not supported by the above).

Follow the instructions below to install the Board support package.

Please see the Getting Started Guides for more information on how to install and use the tools.

Freedom E310 Arty Dev Kit Getting Started Guide

HiFive1 Getting Started Guide

Setup

Install Arduino

Download and install Arduino IDE 1.6.12 tarball from the Arduino website. Unpack it and run their installation script as directed.

Install the SiFive Boards

Use one of the following methods:

Option 1: Installing Through the Arduino IDE

This is supported for macOS and Linux.

Add the http://static.dev.sifive.com/bsp/arduino/package_sifive_index.json to the Additional Board URLs.

Use the Board Manager to search for and install the "SiFive" boards.

Option 2: Install this Repo Manually

This is generally not supported. You can use this technique to install on platforms that aren't supported by the Board Manager, or if you want to work on the code in this repository.

  1. Clone this Repository

Clone this repo wherever you like. Assume that you set an environment variable CINCO to that location.

cd $CINCO
git clone --recursive http://github.com/sifive/cinco.git
  1. Create a simlink from your Arduino install location.
cd /opt/arduino-1.6.12/hardware/
ln -s $CINCO/hardware sifive
  1. Install RISC-V Tools and OpenOCD

If you have previously installed the Freedom E SDK, you do not need to do this step.

Follow the instructions in the Freedom E SDK README to install the SDK. You can use the version included in this repository or download and install it separately.

  1. Add the toolchain to your path
export PATH=$CINCO/hardware/freedom_e/freedom-e-sdk/toolchain/bin:$PATH

If you installed the Freedom E SDK some other way, use that installation location instead.

Select Your Board

Restart and launch the Arduino IDE.

Select the board (e.g. Freedom E300 Arty Dev Kit) on the Arduino Menu

Tools->Board->Freedom E 300 Dev Kit

Select Your Toolchain

If you installed the tools using the Arduino Package Manager, select Tools -> Tool Install Location -> Default.

If you compiled the Freedom E SDK manually, select Tools -> Tool Install Location -> Manual.

Select OpenOCD as the Programmer

If you installed the tools using the Arduino Package Manager, select Tools->Programmer->SiFive OpenOCD

If you installed the tools manually, select Tools->Programmer-> Manual SiFive OpenOCD

Write & Upload Your Program

Select an example program and modify it as usual.

For example, use the 'File->Examples->Basics->Blink' example, which needs no modifications.

Hit the "Verify" button to test the program compiles, then "Upload" to program to your board. The green LED should blink.

cinco's People

Contributors

a0u avatar alistair23 avatar mwachs5 avatar nimblemachines avatar palmer-dabbelt avatar scottj97 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cinco's Issues

Linux openocd binaries have a similar problem with libusb

As with the Darwin version of openocd (see issue #23) the Linux binaries are going to expect to find libusb somewhere. For all Linux users, this means they have to separately install libusb, and for users of non-mainstream Linux distros - such as NixOS - this requires several tedious steps to patch the ELF interpreter path and RPATH of the openocd executable before it can be used.

Because statically linking to libusb wouldn't add much to the binary, I'm going to suggest this as the simplest solution to this problem.

Can't upload sketch on Ubuntu 17.04 or macOS 10.12.6

I get the same error on Linux and Mac when I try to upload the blink sketch. Im using Arduino IDE 1.8.5. Is there only a specific version supported?

Build options changed, rebuilding all
Sketch uses 7814 bytes (0%) of program storage space. Maximum is 8388608 bytes.
java.lang.NullPointerException
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingProgrammer(SerialUploader.java:314)
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:89)
at cc.arduino.UploaderUtils.upload(UploaderUtils.java:78)
at processing.app.SketchController.upload(SketchController.java:713)
at processing.app.SketchController.exportApplet(SketchController.java:686)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2168)
at java.lang.Thread.run(Thread.java:748)

Must lift flash protection for Arty Dev Kit

We rely on the openocd.cfg scripts from freedom-e-sdk. For HiFive1, the script lifts the flash protection, but for Arty Dev Kit this is commented out. We either need to lift the flash protection from within the platform.txt, and/or modify freedom-e-sdk to be consistent

openocd binary for Darwin/OSX is built against Homebrew-installed libusb

The pre-built openocd binary (as of commit 9bab0782) for Darwin fails to work if the user doesn't have libusb installed in /usr/local/opt/.

otool -L openocd shows that it has been linked against libusb binaries in /usr/local/opt/, which suggests that the builder used Homebrew and hadn't "sanitized" the build environment to prevent these local-to-their-setup dependencies from creeping into the built binary.

Because the end user may not be using Homebrew, and may very well not have libusb installed, statically linking libusb (which isn't that big) into the binary seems like a simple solution, and will help to forestall confusion.

Support macOS

A few notes on getting the package to work on macOS

The package will download and install fine. The code will compile and OpenOCD will try to run.

Problem 1: You get LIBUSB_ERROR_ACCESS when loading the program

On some versions of macOS (10.11.6) I had to unload the default FTDI driver:
sudo kextunload -b com.apple.driver.AppleUSBFTDI

I don't know if this will break other things (e.g. maybe this is incompatible with also programming the FPGA dev kit in a VM, etc).

Problem 2: The ELF file is corrupted as its loaded to flash

Adding a 'verify' after the 'program' in "platform.txt" reveals that the data is read back incorrectly. So the programs all get exceptions after a while.

Problem 2 was consistent on two machines, including mine, and didn't seem to matter if you compiled from source or used the package.

I will try to debug this.

Need to update Arty Dev Kit flow for Packaged version

The freedom-e-sdk ' openocd.cfg file for the Arty Dev Kit tries to source the interface/ftdi/olimex-arm-usb-tiny-h.cfg. But it seems that our OpenOCD install in the package doesn't include these files (usually they are installed parallel to the OpenOCD executable). We can either remedy that in the Board Support Package flow, or we can change the Freedom E SDK's version of the file to be more like the HiFive1's, where it just explicitly states the relevant parts of the config file.

Lack of progress

Is this project retired? If not, how can we get things rolling again?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.