-
1To compile the MAixPy firmware from scratch (on Ubuntu), clone the following repository:
git clone https://github.com/sipeed/MaixPy cd MaixPy git submodule update --recursive --init -
2Install the requirements:
sudo apt update sudo apt install python3 python3-pip build-essential cmake sudo pip3 install -r requirements.txt -
3Download and install the kendryte toolchain:
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 /optThe toolchain should be under
/opt, otherwise you need to change the path insideconfig_defaults.mk. -
4Connect the Sipeed M1w Dock suit to a USB port on your host machine and type the following:
cd MaixPy/projects/maixpy_k210_minimum python3 project.py menuconfig python3 project.py build python3 project.py flash -B dan -b 1500000 -p /dev/ttyUSB0 -t -
5Flash the kmodel!
-
6First, clone the kflash.py tool using:
git clone https://github.com/sipeed/kflash.py.gitkflash.py doesn't have the option to flash a file with an address offset, so you'll need to make a
.kfpkgfile. A.kfpkgpackage is just a.zipfile with a custom extension that contains the following files:flash-list.json: json file describing the files included in the package*.kmodel: – the model that will be flashed
The file
flash-list.jsonlooks like this:{ "version": "0.1.0", "files": [ { "address": 0x00300000, "bin": "m.kmodel", "sha256Prefix": false } ] }You can find an example of the
.kfpkgfile inside the repo: lemariva/uPyMaixYoloV2.Download the example and replace the
m.kmodelinside with yourweights.kmodelfile (rename it before). -
7Flash the model.kfpkg file to the MAix using:
./kflash.py -p /dev/ttyUSB0 -b 2000000 model.kfpkg
-
8Run the object detector!
The repository lemariva/uPyMaixYoloV2 includes an example to run the object detector on the Sipeed M1w Dock suit (includes Wi-Fi).
-
9Clone the repository:
git clone https://github.com/lemariva/uPyMaixYoloV2and
Open the Folderusing VSCode. You can connect to the board using thePyMakrextension. I wrote a tutorial for the ESP/WiPy boards but the extension can be also used with the MAix. However, you can only run files but you cannot upload them.Before you run the file, configure your Wi-Fi credentials:
# wlan access ssid_ = "" wpa2_pass = ""or remove the lines between
# wlan accessand## Sensor, if you don't want to connect the board to Wi-Fi. -
10If you want to upload the boot.py file to the board,
you can use uPyLoader. First, clone the repository:
git clone https://github.com/BetaRavener/uPyLoader.gitand install the following dependencies:
pip3 install PyQt5Then:
- Start the application: main.py
- Select the serial port and click on the
Connectbutton to connect the board. - The first time you run the software, you need to initialize it:
- Go to
File->Init transfer filesto complete the initialization. This creates two files on the board, __upload.py and __download.py.
- Go to
- Select the file that you want to upload (e.g. boot.py), and click on the
Transferbutton.
Mauro Riva
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.