• Stars
    star
    132
  • Rank 274,205 (Top 6 %)
  • Language
    C
  • License
    ISC License
  • Created over 5 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Kendryte K210 / MaixGo stuff

Maix Go / K210 stuff

Some demo projects (mostly in rust) for the Maix Go.

Building the C projects

First, get the Kendryte C toolchain and copy or symlink the contents of the src/ folder to a checkout of https://github.com/sipeed/LicheeDan_K210_examples.git.

Then to build a certain project do:

mkdir build && cd build
cmake .. -DPROJ=<ProjectName> -DTOOLCHAIN=/opt/riscv-toolchain/bin && make

You will get 2 files, build/<ProjectName> and build/<ProjectName>.bin. The former is an ELF executable, the latter a raw binary that can be flashed or written to address 0x80000000 in SRAM and directly executed.

Building the Rust projects

Note: it's possible that these projects require Rust nightly to build. I don't intentially use nightly features, however, I always test only using the latest one so it's likely that something will sneak in

Make sure the appropriate target has been added to the toolchain that you wish to use:

rustup target add riscv64gc-unknown-none-elf

Target configuration is set up in .cargo/config, so building is a matter of:

cd rust/<name_of_project>
cargo build --release

This will produce an ELF executable in the workspace's target directory named rust/target/riscv64gc-unknown-none-elf/release/<name_of_project>.

If you have openocd working for the board, the below should work:

cargo run

Otherwise, see next section.

Running ELF

There is no need anymore to convert to raw binary, as ELF executables can be executed directly on the device (without flashing) using a recent checkout of kflash

kflash.py -t -s -p /dev/ttyUSB1 -B goE "${ELF_NAME}"

This works for both the C and Rust-produced executables. It is also possible to upload and run code on the device through JTAG and OpenOCD, but I have never got this to work myself (openocd cannot find the device).

Documentation

Additional register documentation that is not in the datasheet can be found here:

External:

  • k210.svd - Peripheral description for rust K210 BSP (k210-pac project)
  • k210.dtsi - Device tree from u-boot

Projects

This is a general random sandbox with silly projects for me to play around with the Maix Go, some are in C and some are in Rust. It turns out that this cheap board is great for playing around with Rust embedded in an environment that has a fair amount of memory and number of peripherals available by default!

glyph_mapping

Variation of the DVP sample that processes the camera input through a simple DOS 8Γ—8 font glyph-mapping algorithm and shows it on the display.

README

dump_otp

Dumps the contents of the OTP (One-Time Programmable memory) of the K210 CPU to serial output in Intel HEX format.

README

secp256k1_{tests,bench}

Run tests and benchmarks for the secp256k1 elliptic curve cryptographic library on this RISC-V CPU.

rust/accelerometer

Read measurements from MSA300 accelerometer. Display a dot on the screen to visualize the current orientation and magnitude.

README

rust/k210-console

Console emulator written in Rust for the Maix Go.

Barely functional at the moment. This is really a test for some functionality like SPI and driving the display from Rust, and for playing with Rust RISC-V 64 in general.

README

rust/mandelbrot

Mandelbrot fractal zoom.

README

rust/game-of-life

"Game of life" cellular automata simulation. The state can be manipulated through the touch screen. The amount of pressure applied determines the radius of the state change.

README

rust/uart-passthrough

Pass through UART from host to the ESP8285 WIFI chip.

README

rust/rgbcontrol

Control the color of the RGB LED from the touch screen.

README

rust/esp8266at

A crate for communicating with WiFi using the ESP8266 using AT commands. TODO: move this to its own repository.

README

rust/weather

Uses the ESP8285 WiFi chip of the Maix Go to fetch weather data from wttr.in and print it to the display using k210-console.

README

rust/dvp-ov

A straightforward passthrough test for video handling, based on dvp_ov in the SDK: read frames from the OV2640 image sensor and display them on the LCD.

README

rust/glyph-mapping

Rust port of the glyph mapping demo.

README

rust/term-server

Uses the ESP8285 WiFi chip of the Maix Go to listen for incoming connections, displaying the data on the terminal.

README

rust/secp256k1-test

Test for using the elliptic curve cryptography library secp256k1, written in C, from rust on a RISC-V device.

README

rust/sdtest

Read and write to a SD card using SPI.

README

rust/emdgfx

Experiments with embedded-graphics crate.

README

rust/voxel

Old-school voxel-based landscape renderer.

README

rust/cryptest

Test the cryptographic acceleration engines of the K210.

README

rust/interrupt

Test for interrupts and use of the MMU.

ROM re'ing

Annotated radare2 config files for the Boot ROM and OTP can be found under r2.

Other projects

Some interesting K210-based projects and demos by other people:

More Repositories

1

etna_viv

Etnaviv is a project to build a FOSS driver for the Vivante GCxxx series of embedded GPUs - laanwj's personal fork - upstream is https://github.com/etnaviv/etna_viv
C
211
star
2

decuda

Decuda and cudasm, the CUDA binary utilities package. Low-level tools for NVidia G80 GPUs.
Python
87
star
3

bitcoin-submittx

Stand-alone Bitcoin transaction submission tool
Python
71
star
4

cln4rust

Crate that provides an RPC binding from rust code to the c-lightning daemon
Rust
60
star
5

sundog

A port of the Atari ST game SunDog: Frozen Legacy (1984) by FTL software
C
59
star
6

bitcoin-qt

Original Bitcoin-Qt repository. No longer used, Bitcoin-Qt was merged upstream.
C++
55
star
7

dwarf_to_c

Tool to recover C headers (types, function signatures) from DWARF debug data
Python
40
star
8

mesa

Laanwj's fork of the FOSS OpenGL ES1 and ES2 driver for Vivante GCxxxx series. This has been merged upstream: https://cgit.freedesktop.org/mesa/drm/ : this repo is for historical purposes only
C
26
star
9

yosys-ice-experiments

Experiments for iCEstick evaluation board with iCE40HX-1k FPGA - using open source toolchain
Verilog
14
star
10

Purecoin

Git mirror of Haskell Bitcoin implementation "Purecoin" by Russell O'Connor (darcs http://r6.ca/Purecoin)
Haskell
11
star
11

hw2view

Viewer for Relic Entertainment Homeworld 2 backgrounds
Python
10
star
12

ast_pickler

Proof of concept serialization library that generates the Python code to construct objects.
Python
9
star
13

blockdb-troubleshoot

Bitcoin block database troubleshooting tools
C++
9
star
14

gltron

gltron - patched for SDL2/etnaviv
C
8
star
15

gcw0_vpu_poc

Proof of concept for using the Ingenic JZ4770 vpu core on GCW Zero
C
8
star
16

deluge

My changes and fixes to Deluge torrent
JavaScript
7
star
17

rust-riscv-disasm

RISC-V disassembler crate for Rust
Rust
6
star
18

etnaviv_gpu_tests

Etnaviv GPU tests: This repository contains various tests for Vivante GPUs based on the Etnaviv DRM driver
C
6
star
19

pmodoled

Demo: Drive a Digilent pmodOLED module from a HiFive board through SPI
C
5
star
20

xray6502

Python
5
star
21

crcbench

Benchmark CRC32C performance with specific instructions on various architectures
C++
5
star
22

sxflash

Ethernet-based flasher/unbricker for Silex boards (such as the Belkin Homebase F5L049)
C
4
star
23

mesatest_gles

Simple Open GL ES 2 programs for exercising the etnaviv Mesa driver
C
4
star
24

guix-mes

Personal fork of GNU Mes
Scheme
3
star
25

psindustrializer

Power Station Industrializer is a program for generating percussion sounds for musical purposes
C
3
star
26

laanwj

2
star
27

linux-freedreno-a20x

Linux freedreno a20x
C
2
star
28

nips-json

Machine-readable versions of nostr NIPs tables
Python
2
star