DUO development board combat - development environment initialization

This article first briefly introduces the Milk-V Duo development board , and then introduces the development environment initialization operation process of the development board, which specifically involves four parts: Linux environment preparation , development board image creation , TF card burning , and connection to the development board . Developers can refer to this tutorial to start developing and expanding the Milk-V Duo development board. Pre-preparation:

  • TF card
  • TF card reader
  • Type-C data cable

Introduction to Milk-V Duo Development Board

insert image description here

The Milk-V Duo development board (Figure 1) is an ultra-compact embedded development platform based on the CV1800B chip (RISC-V architecture, C906@1Ghz + C906@700MHz). It supports 64MB RAM, can be expanded to achieve 10/100Mbps Ethernet, can run Linux and RTOS systems, and provides a reliable, low-cost, high-performance platform for professionals, industrial ODMs, AIoT enthusiasts, DIY enthusiasts and creators. The hardware parameter information is as follows:

  • CVITEK CV1800B (C906@1Ghz + C906@700MHz)
  • Dual RV64 cores, up to 1GHz
  • 64MB memory
  • 10/100Mbps Ethernet via optional add-on board
  • Technical support to run Linux and RTOS at the same time

The pins of the Milk-V development board are shown in the figure below, and users can make rich DIY expansions.
insert image description here

.

Development environment initialization

This subsection involves the following four steps:

  1. Linux environment preparation: Image compilation needs to be carried out in a Linux development environment. This article introduces how to use docker to pull the Ubuntu image (version 20.04) in the win environment; if you already have VMware Workstation and install the Ubuntu system, you can skip this step step;
  2. Development board image production: install dependencies, obtain sdk and compile and create images in the Linux environment
  3. TF card burning: copy the prepared development board image, and use the rufus tool to write the image file into the TF card;
  4. Connect to the development board: remove the programmed TF card, insert it into the development board; update the driver, and connect to the development board with ssh.

The four steps are described in detail below.

Linux environment preparation

  1. In the windows environment, you can install Docker Desktop for Windows , pull the ubuntu image through docker and create a container to get the linux environment;
    insert image description here

    Running docker under Windows requires related dependencies, that is, as shown in the figure, you need to use the WSL2 backend or Hyper-V backend as the running dependency. The way to enable the Hyper-V backend is as follows:
    a. Control Panel - Programs - Enable or disable Windows features
    b. Find Hyper-V, check Hyper-V management tools and Hyper-V platform, and wait for the system file configuration to complete Restart the computer
    insert image description here

    Then you can install and download Docker Desktop for Windows, and check according to the selected backend in the installation guide; after the installation is complete, you need to restart the computer, and then you can use docker

  2. Enter in the command line to pull the Ubuntu image docker pull ubuntu:20.04, you can pull ubuntu20.04the image, and then use it docker imagesto view the pulled image;
    enter in the command line docker run -it ubuntu:20.04 /bin/bash, you can create and run a container, when it appears in the terminal root@<string>:/#, it means that the container is created Completed and entered the container, where stringis the id of the container, that is containerId,
    if you need to exit the container and exit the container, just enter it , and if you need to enter the container again outside the container, you can enter it exitin sequence in the terminal . (For more instructions, please refer to the official docker tutorial)docker start <containerId>docker attach <containerId>
    insert image description here

  3. Configure the container and install the necessary dependencies.

     sudo apt-get update
     sudo apt-get install sudo
     sudo apt-get install vim
    
     sudo apt install pkg-config 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 python3-distutils tclsh scons parallel ssh-client tree python3-dev python3-pip device-tree-compiler ssh cpio fakeroot libncurses5 flex bison libncurses5-dev genext2fs rsync unzip dosfstools mtools
     
     # 安装cmake
     wget https://github.com/Kitware/CMake/releases/download/v3.26.4/cmake-3.26.4-linux-x86_64.sh
     chmod +x cmake-3.26.4-linux-x86_64.sh
     sudo ./cmake-3.26.4-linux-x86_64.sh --skip-license --prefix=/usr/local/
    
     # 输入以下命令进行验证,若能输出对应版本号,则表示安装成功
     cmake --version 
    

Development board image production

  1. Download the SDK

     git clone https://github.com/milkv-duo/duo-buildroot-sdk.git
    
  2. Run build_milkv.shthe script to compile

     cd duo-buildroot-sdk
     ./build_milkv.sh
    

    After the compilation is successful, the file can /duo-buildroot-sdk/outbe found in the directory milkv-duo-xxxxxxxx-xxxx.img, which is the successful image file.
    At this point, the basic image file can be used for the next step of TF card burning and subsequent operations. 3.配置制作预装Python3的镜像Will configure the script to make a mirror with Python3

  3. Configure and make a mirror image of pre-installed Python3 (optional)

     cd duo-buildroot-sdk
     # 导入环境变量
     export MILKV_BOARD=milkv-duo  
     source milkv/boardconfig-milkv-duo.sh  
     source build/milkvsetup.sh  
     defconfig cv1800b_milkv_duo_sd
    

    Modify the configuration file and configure Python3

     cd ./buildroot-2021.05/configs  
     vim milkv_duo_musl_riscv64_defconfig
    

    Add the following two lines of code to the file

     BR2_PACKAGE_PYTHON3=y
     BR2_PACKAGE_PYTHON3_PYC_ONLY=y
    

insert image description here

After saving and exiting, compile and package the file again

    cd duo-buildroot-sdk
    build_all
    pack_sd_image

After executing the above command, the milkv-duo.img image file will be generated in the duo-buildroot-sdk/install/soc_cv1800b_milkv_duo_sd directory
insert image description here

TF card burning

File copy: Open a new terminal, enter in the terminal docker cp <containerNAMES>:/duo-buildroot-sdk/out/milkv-duo-xxxxxxxx-xxxx.img <path>/<file_name>.imgto copy the file container to the local Windows system, which is the NAMES of the container, which can be viewed with the relevant commands of docker ps. It is the path to save the file in the local Windows system, <file_name> is the name of the saved file

Install the TF card into the TF card reader and insert it into the computer interface. Note : writing the image to the TF card will clear the original data in the card. Be sure to save the original data before this. Download the rufus burning tool to write the image into the TF card
insert image description here

Click 开始, and the burning will be completed when the progress bar is finished.

Connect the development board

Remove the burned TF card, insert it into the TF card slot on the Milk-V Duo development board, and use the Type-C data cable to connect the development board and the computer; when the blue LED light on the development board flashes, it means the connection is successful.
insert image description here

insert image description here

Update the driver. In the device manager, find RNDIS from the column of other devices , select and update the driver, select the device type of network adapter when updating, and use Microsoft ’s USB RNDIS Adapter to update. After the update is completed, create a new terminal and Enter ping 192.168.42.1the test network in the terminal , and refer to the link for specific operations .

After the network test is passed, you can use IP 192.168.42.1to connect to the development board for development. For example, use mobaxterm and ssh to connect to the development board; enter the login name rootand password milkvto enter the visual programming environment of the Milkv Duo development board:
insert image description here

If the image produced is pre-installed with Python3, you can use Python3 directly on the board for testing:
insert image description here

write at the end

This tutorial introduces the development environment initialization process of the Duo development board. Open source developers and hardware DIY enthusiasts are welcome to participate in our exploration of open source hardware development, and use more beautiful open source programs, more sophisticated hardware extensions, and more interesting oddities. Think wonderfully to create more exciting applications and enrich the RISC-V open source ecosystem together!
More Milk-V Duo development board development materials are as follows:

  1. Docker
  2. Github
  3. SDK
  4. Docs

Guess you like

Origin blog.csdn.net/lily_19861986/article/details/131687174