This project provides the minimum needed to build a project for all three versions of Milk -V Duo.
This setup has only been tested on Linux, I don't know if it works under Windows or macOS (please, open and issue if it doesn't, and we can look into that).
CLion users can also use this setup with ease.
This code depends on having milkv-duo/duo-examples downloaded and installed somewhere in your system. Follow the instructions in the repo to compile one example.
If you successfully compile one of the examples, note the path to where your examples are stored on your system, then add it to your environment variables as MILK_V_PATH.
On Linux, you can add the following line to your ~/.bashrc, ~/.zshrc or whichever shell you use:
export MILK_V_PATH='/home/USERNAME/SOME_PATH/duo-examples'Alternatively, you can comment out line 14 in CMakeLists.txt, uncomment the line 15 and write your path to duo-examples there.
Before compiling, you'll need to choose your board on lines 6~11 in CMakeLists.txt.
Choose the right combination of board name and architecture for what you're using.
Be sure to also change the project name on line 2 in CMakeLists.txt and in compile_and_run to suit your needs.
The easiest way to build and run the code is by using the provided script:
./compile_and_upload.shBy default, the scripts builds the project and uploads it to the board.
If you have sshpass installed, it uses the file ssh_password.txt and enters the password for you.
Supported flags for the script are --run, --no-upload and --help.
To build the project manually, enter the following commands in the root directory:
mkdir build
cd build
cmake ..
makeThe upload can then be done by running:
scp -O blink [email protected]:/root/