"Maixduino" 修訂間的差異
(未顯示同一使用者於中間所作的 5 次修訂) | |||
行 1: | 行 1: | ||
+ | == Booting message == | ||
+ | <pre> | ||
+ | [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. | ||
+ | >>> | ||
+ | </pre> | ||
== Toolchain == | == Toolchain == | ||
<pre> | <pre> | ||
− | git clone | + | git clone https://github.com/kendryte/kendryte-gnu-toolchain |
+ | cd kendryte-gnu-toolchain | ||
+ | git submodule update --init --recursive | ||
</pre> | </pre> | ||
+ | === Prerequisites === | ||
+ | <pre> | ||
+ | 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 | ||
+ | </pre> | ||
+ | === Build === | ||
+ | <pre> | ||
+ | ./configure --prefix=/opt/kendryte-toolchain --with-cmodel=medany --with-arch=rv64imafc --with-abi=lp64f | ||
+ | make -j8 | ||
+ | </pre> | ||
+ | |||
== FW == | == FW == | ||
<pre> | <pre> | ||
行 32: | 行 70: | ||
<pre> | <pre> | ||
python3 project.py -B maixduino -p /dev/ttyUSB0 -b 1500000 -S flash | python3 project.py -B maixduino -p /dev/ttyUSB0 -b 1500000 -S flash | ||
+ | or, | ||
+ | kflash -B maixduino -p /dev/ttyUSB0 hello_world.bin | ||
</pre> | </pre> | ||
− | == | + | == Example == |
+ | <pre> | ||
+ | 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) | ||
+ | </pre> |
於 2019年12月29日 (日) 18:05 的最新修訂
目錄
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 --recursive
Prerequisites
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
Build
./configure --prefix=/opt/kendryte-toolchain --with-cmodel=medany --with-arch=rv64imafc --with-abi=lp64f make -j8
FW
git clone https://github.com/sipeed/MaixPy.git git submodule update --recursive --init
Install dependencies
sudo apt update sudo apt install python3 python3-pip build-essential cmake sudo pip3 install -r requirements.txt
Configure project
cd MaixPy cd projects/maixpy_k210 python3 project.py --toolchain /opt/kendryte-toolchain/bin --toolchain-prefix riscv64-unknown-elf- config
Customize 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)