Add a lead sentence |
Consistency: syntax highlighting for code, File: prefix |
||
| 第28行: | 第28行: | ||
</pre> | </pre> | ||
== Toolchain == | == Toolchain == | ||
< | <syntaxhighlight lang="bash"> | ||
git clone https://github.com/kendryte/kendryte-gnu-toolchain | git clone https://github.com/kendryte/kendryte-gnu-toolchain | ||
cd kendryte-gnu-toolchain | cd kendryte-gnu-toolchain | ||
git submodule update --init --recursive | git submodule update --init --recursive | ||
</ | </syntaxhighlight> | ||
=== Prerequisites === | === Prerequisites === | ||
< | <syntaxhighlight lang="bash"> | ||
sudo apt-get install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev | sudo apt-get install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev | ||
</ | </syntaxhighlight> | ||
=== Build === | === Build === | ||
< | <syntaxhighlight lang="bash"> | ||
./configure --prefix=/opt/kendryte-toolchain --with-cmodel=medany --with-arch=rv64imafc --with-abi=lp64f | ./configure --prefix=/opt/kendryte-toolchain --with-cmodel=medany --with-arch=rv64imafc --with-abi=lp64f | ||
make -j8 | make -j8 | ||
</ | </syntaxhighlight> | ||
== FW == | == FW == | ||
< | <syntaxhighlight lang="bash"> | ||
git clone https://github.com/sipeed/MaixPy.git | git clone https://github.com/sipeed/MaixPy.git | ||
git submodule update --recursive --init | git submodule update --recursive --init | ||
</ | </syntaxhighlight> | ||
=== Install dependencies === | === Install dependencies === | ||
< | <syntaxhighlight lang="bash"> | ||
sudo apt update | sudo apt update | ||
sudo apt install python3 python3-pip build-essential cmake | sudo apt install python3 python3-pip build-essential cmake | ||
sudo pip3 install -r requirements.txt | sudo pip3 install -r requirements.txt | ||
</ | </syntaxhighlight> | ||
=== Configure project === | === Configure project === | ||
< | <syntaxhighlight lang="bash"> | ||
cd MaixPy | cd MaixPy | ||
cd projects/maixpy_k210 | cd projects/maixpy_k210 | ||
python3 project.py --toolchain /opt/kendryte-toolchain/bin --toolchain-prefix riscv64-unknown-elf- config | python3 project.py --toolchain /opt/kendryte-toolchain/bin --toolchain-prefix riscv64-unknown-elf- config | ||
</ | </syntaxhighlight> | ||
=== Customize FW === | === Customize FW === | ||
<pre> | <pre> | ||
| 第77行: | 第77行: | ||
== Example == | == Example == | ||
< | <syntaxhighlight lang="python"> | ||
import sensor | import sensor | ||
import image | import image | ||
| 第90行: | 第90行: | ||
img=sensor.snapshot() | img=sensor.snapshot() | ||
lcd.display(img) | lcd.display(img) | ||
</ | </syntaxhighlight> | ||
[[Category:Boards and SoCs]] | [[Category:Boards and SoCs]] | ||
2026年8月23日 (日) 18:01的最新修訂
The Maixduino is a Kendryte K210 RISC-V board. These notes cover the toolchain, building and customising the firmware, and flashing it.
Booting message
[MAIXPY]Pll0:freq:832000000 [MAIXPY]Pll1:freq:398666666 [MAIXPY]Pll2:freq:45066666 [MAIXPY]cpu:freq:416000000 [MAIXPY]kpu:freq:398666666 [MAIXPY]Flash:0xc8:0x17 open second core... mallocmallocmallocmallocgc heap=0x8027ccb0-0x802fccb0(524288) [MaixPy] init end __ __ _____ __ __ _____ __ __ | \/ | /\ |_ _| \ \ / / | __ \ \ \ / / | \ / | / \ | | \ V / | |__) | \ \_/ / | |\/| | / /\ \ | | > < | ___/ \ / | | | | / ____ \ _| |_ / . \ | | | | |_| |_| /_/ \_\ |_____| /_/ \_\ |_| |_| Official Site : https://www.sipeed.com Wiki : https://maixpy.sipeed.com MicroPython v0.5.0 on 2019-12-11; Sipeed_M1 with kendryte-k210 Type "help()" for more information. >>>
Toolchain
git clone https://github.com/kendryte/kendryte-gnu-toolchain
cd kendryte-gnu-toolchain
git submodule update --init --recursivePrerequisites
sudo apt-get install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-devBuild
./configure --prefix=/opt/kendryte-toolchain --with-cmodel=medany --with-arch=rv64imafc --with-abi=lp64f
make -j8FW
git clone https://github.com/sipeed/MaixPy.git
git submodule update --recursive --initInstall dependencies
sudo apt update
sudo apt install python3 python3-pip build-essential cmake
sudo pip3 install -r requirements.txtConfigure project
cd MaixPy
cd projects/maixpy_k210
python3 project.py --toolchain /opt/kendryte-toolchain/bin --toolchain-prefix riscv64-unknown-elf- configCustomize FW
python3 project.py menuconfig
Build
python3 project.py build
Flash to the board
python3 project.py -B maixduino -p /dev/ttyUSB0 -b 1500000 -S flash or, kflash -B maixduino -p /dev/ttyUSB0 hello_world.bin
Example
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)