Compilation

All AMP code has been merged into StarFive Linux 6.6 SDK. The compilation directory of the AMP image can coexist with the regular SDK directory, which means you can compile both AMP and regular images in the same SDK directory. If you haven't downloaded the Linux 6.6 SDK, please follow the steps in this link to download it first.

Then follow the steps below to compile:
  1. Execute the following commands to download the code and compile the AMP images:
    $ ./build-rtthread-amp-sdk.sh
    Note:
    • The RT-Thread tool chain will be downloaded from the github, which can support Ubuntu 18/20/22 versions. Please select the correct tool chain according to the Ubuntu version.
    • This process may take long time. Please be patient.
    Result:
    Finally, the sdcard_amp.img file will be generated under the work directory, and it can be directly written to the SD card to boot. For net boot, the other images are:
    work/u-boot-amp-spl.bin.normal.out   #uboot spl image
    work/visionfive2_fw_payload_amp.img   #sbi payload image, including rt-thread.bin
    work/amp/image.fit   #AMP kernel image
  2. If you only modify the RT-Thread, you can compile the visionfive2_fw_payload_amp.img independently:
    $ make amp-clean
    $ make ampuboot_fit -j8
  3. If you want to recompile the AMP image, execute the following command:
    $ make amp_img
  4. To configure the crop RT-Thread, enter the following command under JH-7110 directory:
    $ cd rtthread/bsp/starfive/jh7110
    $ cp configs/vf2_defconfig .config
    $ cp configs/vf2_rtconfig.h rtconfig.h
    $ scons --menuconfig
    Tip: Menuconfig is a graphical configuration tool that is a feature in RT-Thread 3.0 and above versions. It allows for free cropping of kernels, components, and software packages, allowing the system to be built in a building block manner.
    Figure 1. RT-Thread Configuration