Giter Club home page Giter Club logo

milkv-duo-experiments's Introduction

Milk-V Duo experiments

Milk-V Duo

This is a collection of my experiments with the Milk-V Duo board. It is based on RISC-V CPU and it runs Linux inside. So it’s not similar to Arduino or Raspberry Pi Pico where the board runs only your program that you flashed ont it. With Milk-V Duo you have an actual Linux with several dozen of processes running, and all the usual commands, including vi.

Out of the box it supports RNDIS networking (Ethernet over USB) so when I connected it to a USB cable connected to my Fedora Linux laptop I could ssh into it. I’m going to add an RJ-45 connector to it or a breakout board to use normal Ethernet.

I’m planning to use Go on this board so I made a couple of changes in the kernel configuration and rebuilt the image (see in the build-container directory).

hello is just a Hello, World program in Go compiled for this board (of course!).

http is a simple HTTP server running on this board (a dozen lines in Go).

montecarlo is a program calculating Pi using the Monte-Carlo method. I copied it from here: https://ggcarvalho.dev/posts/montecarlo/ and it seems to be a simple way to quickly measure CPU performance.

Also I collected some information about GPIO numbers (because I spent some time figuring it out myself so maybe it will save time for somebody else). Find the GPIO pins and numbers document in the docs directory.

Using gpiod

I started using the gpiod Go library written by @warthog618: https://github.com/warthog618/gpiod. Duo has a different pin naming scheme so I had to create my own mapping function.

In this board there are 5 GPIO chips (gpiochip0 to gpiochip4). The pins are named like GPIOA14, GPIOC9, or PWR_GPIO21 and they are served by different chips. In this case the names above would be translated to gpiochip0 + offset 14, gpiochip2 + offset 9, and gpiochip4 + offset 21 respectively.

The mapping function is located here: https://github.com/pavelanni/gpiod-milkvduo. You’ll find more details and a simple example there.

Board info

Here is the official Milk-V Duo documentation: https://milkv.io/docs/duo/overview

More information and guides are available here: https://spotpear.com/index/product/detail/id/1296.html (check the RESOURCES tab for the guides)

This repo contains datasheets and other info for the CPU/TPU used in Duo: https://github.com/sophgocommunity/Duo_Doc/tree/main

Pinout

pinout

milkv-duo-experiments's People

Contributors

pavelanni avatar

Watchers

 avatar

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.