[The 3rd Xuantie Cup RISC-V Application Innovation Competition] Huashan School Development Environment Configuration
[Copy link]
This post was last edited by eew_dy9f48 on 2023-10-4 15:25
This week we will try to configure the required development environment and compile the firmware required to burn the development board. The previous firmware can also be compiled from the development environment.
The official documentation is completed in a virtual machine. I personally recommend doing it in Docker, which makes it easier to isolate each project.
First install docker desktop and create a new ubuntu docker in vscode. Since 20.04 is used in the official tutorial, I also use the focal version.
After creating docker and connecting through vscode, the first step is to open the terminal and update the software package in ubuntu
After the update is complete, use the following command to install the required dependencies:
sudo apt install -y build-essential ninja-build automake autoconf libtool wget curl git gcc libssl-dev bc slib squashfs-tools android-sdk-libsparse-utils android-sdk-ext4-utils jq cmake python3-distutils tclsh scons parallel ssh-client tree python3-dev python3-pip device-tree-compiler libssl-dev ssh cpio squashfs-tools fakeroot libncurses5 flex bison
After everything is installed, the next step is to install cmake. There is a problem with the official documentation. The version number required is not 3.16, but 3.16.5. The default version in Ubuntu is 3.16.2, so you need to uninstall and reinstall it.
# 注意先删除低版本cmake
sudo apt autoremove cmake
wget https://cmake.org/files/v3.16/cmake-3.16.5.tar.gz
tar zxvf cmake-3.16.5.tar.gz
cd cmake-3.16.5/
./configure
make
sudo make install
The next step is to get the source code from GitHub:
git clone https://github.com/sophgo/sophpi-huashan.git
But I don't know why, this step always fails to complete, showing the following error:
I have ruled out network problems, so other large github projects can be successfully pulled, but this one can't. In the end, I had no choice but to manually download the master zip package and pass it into docker to decompress it using unzip.
After getting the source code, we need to start configuring the compilation environment. Here is a step missing in the official documentation. First, we need to download and install the Risc-v compilation toolchain online:
cd sophpi-huashan
./download_host-tools.sh
tar -xvf host-tools.tar.gz
After completion, enter the SDK folder, configure the compilation environment, and compile the SDK
cd cvi_mmf_sdk
source build/cvisetup.sh
defconfig cv1812h_wevb_0007a_emmc
build_all
When you see the following output, the compilation has been completed successfully:
The compiled files are all in the install folder under the main source code directory. Then we copy the corresponding files to the TF card and we can flash the device happily.
|