出自flip the world 檢視Maixduino的原始碼 頁面討論 閱讀檢視原始碼檢視歷史 ←Maixduino 您沒有權限執行編輯此頁面,由於以下原因: 您請求的操作只有這個群組的使用者能使用:使用者 您可以檢視並複製此頁面的原始碼。 The '''Maixduino''' is a Kendryte K210 RISC-V board. These notes cover the toolchain, building and customising the firmware, and flashing it. == 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 == <syntaxhighlight lang="bash"> git clone https://github.com/kendryte/kendryte-gnu-toolchain cd kendryte-gnu-toolchain git submodule update --init --recursive </syntaxhighlight> === 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 </syntaxhighlight> === Build === <syntaxhighlight lang="bash"> ./configure --prefix=/opt/kendryte-toolchain --with-cmodel=medany --with-arch=rv64imafc --with-abi=lp64f make -j8 </syntaxhighlight> == FW == <syntaxhighlight lang="bash"> git clone https://github.com/sipeed/MaixPy.git git submodule update --recursive --init </syntaxhighlight> === Install dependencies === <syntaxhighlight lang="bash"> sudo apt update sudo apt install python3 python3-pip build-essential cmake sudo pip3 install -r requirements.txt </syntaxhighlight> === Configure project === <syntaxhighlight lang="bash"> cd MaixPy cd projects/maixpy_k210 python3 project.py --toolchain /opt/kendryte-toolchain/bin --toolchain-prefix riscv64-unknown-elf- config </syntaxhighlight> === Customize FW === <pre> python3 project.py menuconfig </pre> === Build === <pre> python3 project.py build </pre> === Flash to the board === <pre> python3 project.py -B maixduino -p /dev/ttyUSB0 -b 1500000 -S flash or, kflash -B maixduino -p /dev/ttyUSB0 hello_world.bin </pre> == Example == <syntaxhighlight lang="python"> 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) </syntaxhighlight> [[Category:Boards and SoCs]] 返回到「Maixduino」。