MaixPy

用于 Sipeed Maix 板的 Micropython 环境(K210 RISC-V)。「Micropython env for Sipeed Maix boards(K210 RISC-V)」

Github stars Tracking Chart

MaixPy, 让 AIOT 更简单~

Maixpy 的目的是让 AIOT 编程更简单, 基于 Micropython 语法, 运行在一款有着便宜价格的高性能芯片 K210 上.

K210 简介 :

  • 拥有硬件加速的图像识别
  • 带硬件浮点运算的双核处理器
  • 8MB(6MB+2MB) 内存
  • 16MB 外置 Flash
  • 芯片 CPU 最高可达 800MHz 主频 (开发板支持最高主频具体看开发板介绍)
  • 麦克风阵列支持(8个麦克风)
  • 硬件 AES SHA256 支持
  • FPIOA (每个外设可以映射到任意引脚)
  • 外设: I2C, SPI, I2S, WDT, TIMER, RTC, UART, GPIO 等等

简单易懂的代码

寻找 I2C 设备:

from machine import I2C
i2c = I2C(I2C.I2C0, freq=100000, scl=28, sda=29)
devices = i2c.scan()
print(devices)

拍照:

import sensor
import image
import lcd
lcd.init()
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.run(1)
while True:
    img=sensor.snapshot()
    lcd.display(img)

固件发布

发布版本固件: 固件发布页面

最新提交(开发中)的固件: master 分支的固件

文档

查看 maixpy.sipeed.com

例示代码

MaixPy_scripts

从源码构建自己的固件

参考 构建文档

旧的构建版本请见 historic 分支 (不再维护,仅仅为了保留提交记录)

开源协议

查看 LICENSE 文件

其它: 使用本仓库作为 SDK 用 C 语言开发

本仓库除了作为 MaixPy 工程的源码存在以外, 由于 MaixPy 作为一个组件存在, 可以配置为不参与编译, 所以也可以作为 C SDK 来进行开发, 使用方法见 构建文档, 可以从编译下载 projects/hello_world 开始

大致上编译下载过程如下:

wget http://dl.cdn.sipeed.com/kendryte-toolchain-ubuntu-amd64-8.2.0-20190409.tar.xz
sudo tar -Jxvf kendryte-toolchain-ubuntu-amd64-8.2.0-20190409.tar.xz -C /opt
cd projects/hello_world
python3 project.py menuconfig
python3 project.py build
python3 project.py flash -B dan -b 1500000 -p /dev/ttyUSB0 -t

Main metrics

Overview
Name With Ownersipeed/MaixPy
Primary LanguagePython
Program languageC (Language Count: 9)
PlatformEmbedded Systems, Linux, Windows
License:Other
所有者活动
Created At2024-01-20 05:00:16
Pushed At2025-04-21 07:47:19
Last Commit At
Release Count44
Last Release Namev4.10.3 (Posted on )
First Release Namev4.0.10 (Posted on )
用户参与
Stargazers Count292
Watchers Count8
Fork Count56
Commits Count470
Has Issues Enabled
Issues Count80
Issue Open Count15
Pull Requests Count45
Pull Requests Open Count0
Pull Requests Close Count7
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

中文

Let's Sipeed up, Maximize AI's power!

MaixPy, makes AIOT easier!

Maixpy is designed to make AIOT programming easier, based on the Micropython syntax, running on a very powerful embedded AIOT chip K210.

K210 brief:

  • Image Recognition with hardware acceleration
  • Dual core with FPU
  • 8MB(6MB+2MB) RAM
  • 16MB external Flash
  • Max 800MHz CPU freq (see the dev board in detail)
  • Microphone array(8 mics)
  • Hardware AES SHA256
  • FPIOA (Periphrals can map to any pins)
  • Peripherals: I2C, SPI, I2S, WDT, TIMER, RTC, UART, GPIO etc.

Simple code

Find I2C devices:

from machine import I2C

i2c = I2C(I2C.I2C0, freq=100000, scl=28, sda=29)
devices = i2c.scan()
print(devices)

Take picture:

import sensor
import image
import lcd

lcd.init()
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.run(1)
while True:
    img=sensor.snapshot()
    lcd.display(img)

Release

See Releases page

Get latest commit firmware: master firmware

Documentation

Doc refer to maixpy.sipeed.com

Examples

MaixPy_scripts

Build From Source

See build doc

The historic version see historic branch (No longer maintained, just keep commit history)

License

See LICENSE file

Other: As C SDK for C developers

In addition to the source code of the MaixPy project, since MaixPy exists as a component, it can be configured to not participate in compilation, so this repository can also be developed as C SDK. For the usage details, see Building Documentation, which can be started by compiling and downloading projects/hello_world.

The compilation process is briefly as follows:

wget http://dl.cdn.sipeed.com/kendryte-toolchain-ubuntu-amd64-8.2.0-20190409.tar.xz
sudo tar -Jxvf kendryte-toolchain-ubuntu-amd64-8.2.0-20190409.tar.xz -C /opt
cd projects/hello_world
python3 project.py menuconfig
python3 project.py build
python3 project.py flash -B dan -b 1500000 -p /dev/ttyUSB0 -t