Git Product home page Git Product logo

gd32vf103-demo's Introduction

gd32vf103-demo

A small example for running Rust code on RISC-V.

The specific hardware used is:

  • GD32VF103CBT6 on a custom board
  • Segger J-Link EDU Mini debugger for flashing

Installation

First of all, you need to install the rust-std components (pre-compiled core crate) for RISC-V.

$ rustup target add riscv32imac-unknown-none-elf

That covers Rust, but you also need the RISC-V GNU compiler toolchain, specifically the riscv64-unknown-elf-gdb executable. There may already be a package for your distribution, but for me on Arch Linux that was not the case (except for an outdated AUR entry). You may need to compile it yourself from source. For the installation, follow the instructions from the Newlib section.

Finally, if you're using the J-Link EDU Mini like me, you need to get the J-Link Software and Documentation Pack for that. Extract it somewhere, copy the 99-jlink.rules file to /etc/udev/rules.d/ and reload the rules with

$ sudo udevadm control --reload-rules

If you hook up your board to the J-Link and power it, you should be able to verify that it works with

$ ./JLinkExe -device GD32VF103CBT6 -if JTAG -speed 4000 -JTAGConf -1,-1
J-Link> connect
J-Link> q

Building

From the directory with the J-Link software, start the GDB server.

$ ./JLinkGDBServer -device GD32VF103CBT6 -if JTAG -speed 4000 -port 3333

In the project directory, build, flash and enter GDB with

$ cargo run

This will break at the main function, so you need to

(gdb) continue

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

gd32vf103-demo's People

Contributors

martindisch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gd32vf103-demo's Issues

Try this code piece instead? :) v2

Ping @luojia65.

I accidentally deleted this repository instead of my HAL fork (that's why they make you type in the name, but that doesn't help if you just copy it without thinking ๐Ÿ˜†). I've been able to easily recreate the repo from my local checkout, but I did lose your original issue. I've recreated it just to tell you that I updated my example to use your new Delay in 0879ab5. It's much nicer now. Thanks 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.