Giter Club home page Giter Club logo

duo-buildroot-sdk's Introduction

English | 简体中文 | 日本語

Project Introduction

Milk-V Duo is an ultra-compact embedded development platform based on the CV1800B chip. It can run Linux and RTOS, providing a reliable, low-cost, and high-performance platform for professionals, industrial ODMs, AIoT enthusiasts, DIY hobbyists, and creators.

Hardware

  • CPU: CVITEK CV1800B (C906@1Ghz + C906@700MHz)
  • Dual RV64 Core up to 1GHz
  • 64MB RAM
  • Provides 10/100Mbps Ethernet via optional add-on board

SDK Directory Structure

├── build               // compilation scripts and board configs
├── build.sh            // one-click compilation script
├── buildroot-2021.05   // buildroot source code
├── freertos            // freertos system
├── fsbl                // fsbl firmware in prebuilt form
├── install             // temporary images stored here
├── isp_tuning          // camera effect parameters
├── linux_5.10          // linux kernel
├── middleware          // self-developed multimedia framework
├── device              // configuration files for milkv
├── opensbi             // opensbi library
├── out                 // final image for SD card
├── ramdisk             // prebuilt ramdisk
└── u-boot-2021.10      // u-boot source code

Quick Start

Tip

For the compilation and use methods of the SDK, you can also go to our official documentation for better information and eading experience. In addition, our official documentation website is also open source. If you are interested in enriching the content of the documentation or translating it into other languages, you can go to this repository submit your PR, and we will give out exquisite gifts to contributors from time to time.

Prepare the Compilation Environment. Using a local Ubuntu system, the officially supported compilation environment is Ubuntu Jammy 22.04.x amd64 only!

If you are using other Linux distributions, we strongly recommend that you use the Docker environment to compile to reduce the probability of compilation errors.

The following describes the compilation methods in the two environments.

1. Compiled using Ubuntu 22.04

Packages to be installed

Install the packages that compile dependencies:

sudo apt install -y pkg-config build-essential ninja-build automake autoconf libtool wget curl git gcc libssl-dev bc slib squashfs-tools android-sdk-libsparse-utils jq python3-distutils scons parallel tree python3-dev python3-pip device-tree-compiler ssh cpio fakeroot libncurses5 flex bison libncurses5-dev genext2fs rsync unzip dosfstools mtools tcl openssh-client cmake expect

Get SDK Source Code

git clone https://github.com/milkv-duo/duo-buildroot-sdk.git --depth=1

<1>. One-click Compilation

Execute one-click compilation script build.sh

cd duo-buildroot-sdk/
./build.sh

You will see tips on how to use the compiled script:

# ./build.sh
Usage:
./build.sh              - Show this menu
./build.sh lunch        - Select a board to build
./build.sh [board]      - Build [board] directly, supported boards as follows:
milkv-duo-sd
milkv-duo-spinand
milkv-duo-spinor
milkv-duo256m-sd
milkv-duo256m-spinand
milkv-duo256m-spinor
milkv-duos-emmc
milkv-duos-sd

Listed at the bottom is the list of currently supported target versions.

As shown in the prompt, there are two ways to compile the target version.

The first method is to execute ./build.sh lunch to bring up the interactive menu, select the version number to be compiled, and press Enter:

# ./build.sh lunch
Select a target to build:
1. milkv-duo-sd
2. milkv-duo-spinand
3. milkv-duo-spinor
4. milkv-duo256m-sd
5. milkv-duo256m-spinand
6. milkv-duo256m-spinor
7. milkv-duos-emmc
8. milkv-duos-sd
Which would you like:

The second method is to put the name of the target version after the script and compile it directly. For example, if you need to compile the image of milkv-duo, the command is as follows:

# ./build.sh milkv-duo

After a successful compilation, you can find the generated SD card burning image milkv-duo-*-*.img in the out directory.

Note: The first compilation will automatically download the required toolchain, which is approximately 840MB in size. Once downloaded, it will be automatically extracted to the host-tools directory in the SDK directory. For subsequent compilations, if the host-tools directory is detected, the download will not be performed again.

<2>. Step-by-step Compilation

If you have not executed the one-click compilation script, you need to manually download the toolchain host-tools and extract it to the SDK root directory:

tar -xf host-tools.tar.gz -C /your/sdk/path/

Then enter the following commands in sequence to complete the step-by-step compilation. Replace [board] and [config] in the command with the version that needs to be compiled. The currently supported board and corresponding config are as follows:


milkv-duo256m-sd        cv1812cp_milkv_duo256m_sd
milkv-duo256m-spinand   cv1812cp_milkv_duo256m_spinand
milkv-duo256m-spinor    cv1812cp_milkv_duo256m_spinor
milkv-duo-sd            cv1800b_milkv_duo_sd
milkv-duos-emmc         cv1813h_milkv_duos_emmc
milkv-duo-spinand       cv1800b_milkv_duo_spinand
milkv-duo-spinor        milkv-duo-spinor
milkv-duos-sd           cv1813h_milkv_duos_sd
source device/[board]/boardconfig.sh

source build/milkvsetup.sh
defconfig [config]
clean_all
build_all
pack_sd_image

For example, if you need to compile the image of milkv-duo, the step-by-step compilation command is as follows:

source device/milkv-duo/boardconfig.sh

source build/milkvsetup.sh
defconfig cv1800b_milkv_duo_sd
clean_all
build_all
pack_sd_image

Generated firmware location:

Duo:      install/soc_cv1800b_milkv_duo_sd/[board].img
Duo256M:  install/soc_cv1812cp_milkv_duo256m_sd/[board].img
Duos:     install/soc_cv1813cp_milkv_duos_sd/[board].img

2. Compiled using Docker

Docker support is required on hosts running Linux systems. For how to use Docker, please refer to the official documentation or other tutorials.

We put the SDK source code on the Linux host system and call the Docker image environment provided by Milk-V to compile it.

Pull SDK code on Linux host

git clone https://github.com/milkv-duo/duo-buildroot-sdk.git --depth=1

Enter the SDK code directory

cd duo-buildroot-sdk

Pull the Docker image and run

docker run -itd --name duodocker -v $(pwd):/home/work milkvtech/milkv-duo:latest /bin/bash

Description of some parameters in the command:

  • duodocker Docker name, you can use the name you want to use.
  • $(pwd) The current directory, here is the duo-buildroot-sdk directory that was 'cd' to in the previous step.
  • -v $(pwd):/home/work Bind the current code directory to the /home/work directory in the Docker image.
  • milkvtech/milkv-duo:latest The Docker image provided by Milk-V will be automatically downloaded from hub.docker.com for the first time.

After Docker runs successfully, you can use the docker ps -a command to view the running status:

$ docker ps -a
CONTAINER ID   IMAGE                        COMMAND       CREATED       STATUS       PORTS     NAMES
8edea33c2239   milkvtech/milkv-duo:latest   "/bin/bash"   2 hours ago   Up 2 hours             duodocker

<1>. One-click compilation using Docker

docker exec -it duodocker /bin/bash -c "cd /home/work && cat /etc/issue && ./build.sh [board]"

Note that the ./build.sh [board] at the end of the command is the same as the previous usage in the one-click compilation instructions in Ubuntu 22.04. Use ./build.sh can see how to use the command, use ./ build.sh lunch can bring up the interactive selection menu, use ./build.sh [board] to directly compile the target version, [board] can be replaced with:

milkv-duo-sd
milkv-duo-spinand
milkv-duo-spinor
milkv-duo256m-sd
milkv-duo256m-spinand
milkv-duo256m-spinor
milkv-duos-emmc
milkv-duos-sd

Description of some parameters in the command:

  • duodocker The name of the running Docker must be consistent with the name set in the previous step.
  • "*" In quotes is the shell command to be run in the Docker image.
  • cd /home/work Switch to the /home/work directory. Since this directory has been bound to the host's code directory during runtime, the /home/work directory in Docker is the source code directory of the SDK.
  • cat /etc/issue Displays the version number of the image used by Docker. It is currently Ubuntu 22.04.3 LTS and is used for debugging.
  • ./build.sh [board] Execute one-click compilation script.

For example, if you need to compile the image of milkv-duo, the command is as follows:

docker exec -it duodocker /bin/bash -c "cd /home/work && cat /etc/issue && ./build.sh milkv-duo"

After successful compilation, you can see the generated SD card burning image [board]-*-*.img in the out directory.

<2>. Compile step by step using Docker

If you have not executed the one-click compilation script, you need to manually download the toolchain host-tools and extract it to the SDK root directory:

tar -xf host-tools.tar.gz -C /your/sdk/path/

Step-by-step compilation requires logging into Docker to operate. Use the command docker ps -a to view and record the ID number of the container, such as 8edea33c2239.

Enter Docker:

docker exec -it 8edea33c2239 /bin/bash

Enter the code directory bound in Docker:

root@8edea33c2239:/# cd /home/work/

Then enter the following commands in sequence to complete the step-by-step compilation. Replace [board] and [config] in the command with the version that needs to be compiled. The currently supported board and corresponding config are as follows:

milkv-duo256m-sd        cv1812cp_milkv_duo256m_sd
milkv-duo256m-spinand   cv1812cp_milkv_duo256m_spinand
milkv-duo256m-spinor    cv1812cp_milkv_duo256m_spinor
milkv-duo-sd            cv1800b_milkv_duo_sd
milkv-duos-emmc         cv1813h_milkv_duos_emmc
milkv-duo-spinand       cv1800b_milkv_duo_spinand
milkv-duo-spinor        milkv-duo-spinor
milkv-duos-sd           cv1813h_milkv_duos_sd
source device/[board]/boardconfig.sh

source build/milkvsetup.sh
defconfig [config]
clean_all
build_all
pack_sd_image

For example, if you need to compile the image of milkv-duo, the step-by-step compilation command is as follows:

source device/milkv-duo/boardconfig.sh

source build/milkvsetup.sh
defconfig cv1800b_milkv_duo_sd
clean_all
build_all
pack_sd_image

Generated firmware location:

Duo:      install/soc_cv1800b_milkv_duo_sd/[board].img
Duo256M:  install/soc_cv1812cp_milkv_duo256m_sd/[board].img
Duos:     install/soc_cv1813cp_milkv_duos_sd/[board].img

Generated firmware location: install/soc_cv1800b_milkv_duo_sd/milkv-duo.img.

After compilation is completed, you can use the exit command to exit the Docker environment:

root@8edea33c2239:/home/work# exit

The generated firmware can also be seen in the host code directory.

Stop Docker

After compilation is completed, if the above Docker running environment is no longer needed, you can stop it first and then delete it:

docker stop 8edea33c2239
docker rm 8edea33c2239

3. Other compilation considerations

If you want to try to compile this SDK in an environment other than the above two environments, the following are things you may need to pay attention to, for reference only.

cmake version

Note:cmake minimum version requirement is 3.16.5.

Check the version of cmake in the system:

cmake --version

For example, the version of cmake installed using apt in the Ubuntu 20.04 is:

cmake version 3.16.3

The minimum requirement of this SDK is not met. Manual installation of the latest version 3.27.6 is needed:

wget https://github.com/Kitware/CMake/releases/download/v3.27.6/cmake-3.27.6-linux-x86_64.sh
chmod +x cmake-3.27.6-linux-x86_64.sh
sudo sh cmake-3.27.6-linux-x86_64.sh --skip-license --prefix=/usr/local/

When manually installed, cmake is located in /usr/local/bin. To check its version, use the command cmake --version, which should display:

cmake version 3.27.6

Compiling with Windows Linux Subsystem (WSL)

If you wish to perform the compilation with WSL, there's an small issue building the image. The $PATH, due Windows interoperability, has Windows environment variables which include some spaces between the paths.

To solve this problem you need to change the /etc/wsl.conf file and add the following lines:

[interop]
appendWindowsPath = false

After that, you need to reboot the WSL with wsl.exe --reboot. Then you able to run the ./build.sh script or the build_all line in the step-by-step compilation method. To rollback this change in /etc/wsl.conf file set appendWindowsPath as true. To reboot the WSL, can you use the Windows PowerShell command wsl.exe --shutdown then wsl.exe, after that the Windows environment variables become avaliable again in $PATH.

SD card burning

Note: Writing the image to the microSD card will erase the existing data on the card. Remember to back up important data before burning!!!

  • To write the generated image to a microSD card on Windows, you can use tools like balenaEtcher, Rufus, or Win32 Disk Imager.
  • To write the generated image to a microSD card on Linux, use the dd command. Please make sure to carefully confirm that the of device /dev/sdX corresponds to the microSD card you want to burn:
    sudo dd if=milkv-duo-*-*.img of=/dev/sdX conv=fsync status=progress

Power ON

  • Insert the microSD card into the microSD card slot of the Milk-V Duo.
  • Connect the serial cable (optional).
  • Power on, the Duo will boot up and enter the system normally.
  • If a serial cable is connected, you can view the boot logs in the serial console (mobarXterm, Xshell or others). After entering the system, you can use the serial console to log in to the terminal and execute relevant Linux commands.

The method to log in to the Duo terminal

  • Using a serial cable.
  • Using a USB network (CDC-NCM).
  • Using the Ethernet interface (requires the IO-Board).

The username and password for logging into the Duo terminal are as follows:

root
milkv

To disable LED blinking

If you want to disable the LED blinking feature on the Duo, you can execute the following command in the Duo terminal:

mv /mnt/system/blink.sh /mnt/system/blink.sh_backup && sync

This means renaming the LED blinking script, and after restarting the Duo, the LED will no longer blink.

If you want to restore LED blinking, rename it back to its original name and restart the device:

mv /mnt/system/blink.sh_backup /mnt/system/blink.sh && sync

Using the IO-Board baseboard

Note that when using the IO-Board, the USB network (CDC-NCM) is not available, Please use the Ethernet interface on the IO-Board.

If you need to assign a fixed MAC address to the Ethernet port of the IO-Board, please execute the following command(Replace the MAC address in the command with the MAC address you want to set, and please note that MAC addresses of different devices within the same network segment must not be duplicated):

echo "pre-up ifconfig eth0 hw ether 78:01:B3:FC:E8:55" >> /etc/network/interfaces

then reboot the board.

Enable the 4 USB ports on the IO-Board:

ln -sf /mnt/system/usb-host.sh /mnt/system/usb.sh
sync

then reboot the board.

For example, if a USB flash drive is connected to the USB port on the IO-Board, you can use the command ls /dev/sd* to check if the device is detected.

To mount the USB drive and view its contents in the system (taking /dev/sda1 as an example):

mkdir /mnt/udisk
mount /dev/sda1 /mnt/udisk

Verify if the contents in the /mnt/udisk directory match the expectations:

ls /mnt/udisk

The command to unmount a USB flash drive:

umount /mnt/udisk

To restore the functionality of the USB network (CDC-NCM) when not using the IO-Board, you can follow these steps:

ln -sf /mnt/system/usb-ncm.sh /mnt/system/usb.sh
sync

then reboot the board.

FAQs

  1. Why is only a single core being displayed?

    The CV1800B chip adopts a dual-core design. Currently, the Linux system runs on one of the cores, while the other core is used for running a real-time system. For the use of this core, please see official documentation.

  2. Why does it only show 28M when viewing the RAM?

    Because a portion of the RAM is allocated to ION, which is the memory used when running algorithms with the camera. If you're not using the camera, you can modify the value of this ION_SIZE to 0 and then recompile to generate the image(Duo 256M: ION_SIZE).

Links to some documentation from the chip manufacturer

About Milk-V

FORUM

duo-buildroot-sdk's People

Contributors

apalrd avatar arielheleneto avatar arnout avatar carbonfix avatar ewpa avatar fantasygmm avatar jacmet avatar levitatingbusinessman avatar michael1413 avatar milkvnaoki avatar niwatori-chicken avatar oresk avatar oupton avatar pathakraul avatar pauloantuns avatar pevik avatar smaeul avatar smvoss-collins avatar sophgo-forum-service avatar sophgo-wangliang avatar sophgo-xiangsihan avatar u0076 avatar wojtess avatar yann-morin-1998 avatar yue-xiaomin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

duo-buildroot-sdk's Issues

Random MAC Address on every boot

Hello there,

I use a milkV Duo with an attached Ethernet Port. Unfortunately every time I boot the device it get's a new random MAC Address.

How can this be avoided?

How do I access the kernel configuration in the build root

I have the buildroot set up in a docker container and it works great to build the stock image. I need to make some changes to the kernel and the rootfs. I think I figured out how to use buildroot enough to add some app to the rootfs after loading a defconfig and running make menuconfig in the buildroot2021.05 folder. What I can't get is how to how to configure the kernel. I can go into the kernel folder and make a kernel but I have no idea what it's using as a config and where it's hidden. If I had it I could then just cross compile the kernel in the linux-5.10 folder just like any kernel. I'm glad milkv provided a buildroot but they hid everything under a thick layer of scripts and it makes it hard to change anything from the stock.

Debian不能使用ssh登录duo,提示密码不正确

使用官方镜像v1.0.5
使用登录命令ssh [email protected]后输入密码milkv后会出现以下提示:

ssh [email protected]
[email protected]'s password: 
Permission denied, please try again.
[email protected]'s password: 
Permission denied, please try again.
[email protected]'s password: 
[email protected]: Permission denied (publickey,password).

使用了boradIO扩展版连接网线

本机操作系统信息

uname -a
Linux debian01 6.1.0-13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) x86_64 GNU/Linux

使用ssh版本

ssh -V
OpenSSH_9.2p1 Debian-2+deb12u1, OpenSSL 3.0.11 19 Sep 2023

这可能是哪里出了问题?求解惑

Unable to login through SSH

Hi,

I've just bought the board and cannot login via SSH. I always get the:

ssh: connect to host 192.168.42.xxx port 22: Connection refused

I have followed the tutorial for setting up from the docs website.

I have also tried flashing the two last images and also a custom one for archlinux. But all have the same issue.
Also I have tried connecting from both my Mint installation and my Windows 11.

Currently, I cannot connect through the serial interface and could not find any other direction on the internet.

What could I do in this situation?

Duplicated Title in README?

It seems like there are duplicated title of "Tools to be installed on Ubuntu 20.04 LTS" in the README file. Maybe they can be combined?

GPIO26 and 27 has ADC, but does work?

The only "analogRead" function that i found on wiringx.h it's commented. (// int analogRead ... ) in duo-sdk/rootfs/usr/include/wiringx.h

There's any method to read analog data with the currently firmware version?
From the Duo Datasheet we can see the ADC pins.

image

u-boot build fails

OS: Kubuntu 22.04.4 LTS
run command: ./build.sh milkv-duo
I get a lot of errors like this:

/home/niyaz/soc-sdk/duo-buildroot-sdk/u-boot-2021.10/tools/imagetool.h:321:32: note: in definition of macro ‘U_BOOT_IMAGE_TYPE’
  321 |                 .header_size = _header_size, \
      |                                ^~~~~~~~~~~~
/home/niyaz/soc-sdk/duo-buildroot-sdk/u-boot-2021.10/tools/fit_image.c:950:9: error: ‘fit_print_contents’ undeclared here (not in a function); did you mean ‘fit_extract_contents’?
  950 |         fit_print_contents,
      |         ^~~~~~~~~~~~~~~~~~
/home/niyaz/soc-sdk/duo-buildroot-sdk/u-boot-2021.10/tools/imagetool.h:325:33: note: in definition of macro ‘U_BOOT_IMAGE_TYPE’
  325 |                 .print_header = _print_header, \
      |                                 ^~~~~~~~~~~~~
make[3]: *** [scripts/Makefile.host:112: tools/fit_image.o] Error 1
make[2]: *** [/home/niyaz/soc-sdk/duo-buildroot-sdk/u-boot-2021.10/Makefile:1828: tools] Error 2
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/home/niyaz/soc-sdk/duo-buildroot-sdk/u-boot-2021.10/build/cv1800b_milkv_duo_sd'
make[1]: *** [Makefile:178: sub-make] Error 2
make[1]: Leaving directory '/home/niyaz/soc-sdk/duo-buildroot-sdk/u-boot-2021.10'
make: *** [Makefile:210: u-boot-build] Error 2

I tried branches 'Duo-V1.0.9' and 'develop'

New packages linking musl-xthead.so, others non-existing musl-riscv64.so

I did make menuconfig in buildroot-2021.05/ and enabled a few new packages:

  • qjs
  • lua
  • micropython
  • etc

saved it in configs/milkv_duo_musl_riscv64_defconfig.

Further also made changes to build/boards/cv180x/cv1800b_milkv_duo_sd/memmap.py#L43 to set ION_SIZE=0 to have more memory available.

I built the image with build_milkv.sh, copied the .img on the SD card, and started the board:

% cd /usr/bin/

% lua
Lua 5.3.6  Copyright (C) 1994-2020 Lua.org, PUC-Rio
> ^C
 
% qjs
-sh: qjs: not found

% ls -l qjs
-rwxr-xr-x    1 dhcpcd   dhcpcd     1019016 Oct 15  2023 qjs

% file lua
lua: ELF 64-bit LSB shared object, UCB RISC-V, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-riscv64v0p7_xthead.so.1, stripped

% file qjs
qjs: ELF 64-bit LSB shared object, UCB RISC-V, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-riscv64.so.1, stripped

where I noticed different shared libraries linked, I "fixed" it by:

% cd /lib/
% ln -s ld-musl-riscv64v0p7_xthead.so.1 ld-musl-riscv64.so.1

% qjs
QuickJS - Type "\h" for help
qjs > ^C

and it worked so far, so after that step the /lib looks like this:

% ls -l /lib
total 2037
drwxr-xr-x    3 dhcpcd   dhcpcd        1024 Oct 15  2023 dhcpcd
lrwxrwxrwx    1 root     root            31 Jan  1 00:06 ld-musl-riscv64.so.1 -> ld-musl-riscv64v0p7_xthead.so.1
lrwxrwxrwx    1 dhcpcd   dhcpcd          37 Oct 15  2023 ld-musl-riscv64v0p7_xthead.so.1 -> ../usr/lib64v0p7_xthead/lp64d/libc.so
lrwxrwxrwx    1 dhcpcd   dhcpcd          18 Oct 15  2023 libatomic.so.1 -> libatomic.so.1.2.0
-rwxr-xr-x    1 dhcpcd   dhcpcd       18064 Oct 15  2023 libatomic.so.1.2.0
lrwxrwxrwx    1 dhcpcd   dhcpcd          17 Oct 15  2023 libblkid.so.1 -> libblkid.so.1.1.0
-rwxr-xr-x    1 dhcpcd   dhcpcd      287208 Oct 15  2023 libblkid.so.1.1.0
-rwxr-xr-x    1 dhcpcd   dhcpcd       88256 Oct 15  2023 libgcc_s.so.1
lrwxrwxrwx    1 dhcpcd   dhcpcd          19 Oct 15  2023 libstdc++.so.6 -> libstdc++.so.6.0.28
-rwxr-xr-x    1 dhcpcd   dhcpcd     1639696 Oct 15  2023 libstdc++.so.6.0.28
-rwxr-xr-x    1 dhcpcd   dhcpcd        2717 Oct 15  2023 libstdc++.so.6.0.28-gdb.py
lrwxrwxrwx    1 dhcpcd   dhcpcd          16 Oct 15  2023 libuuid.so.1 -> libuuid.so.1.3.0
-rwxr-xr-x    1 dhcpcd   dhcpcd       30928 Oct 15  2023 libuuid.so.1.3.0
lrwxrwxrwx    1 dhcpcd   dhcpcd           6 Oct 15  2023 lp64d -> ../lib

Is this something I need to properly fix in menuconfig setting somewhere or what is the proper way?

PS: Thanks to all involved devs who made this duo-buildroot-sdk

Empty Partition

Hi! I just got my Duo, and I decided I wanted it to have my entire 120 GiB SD card. After poking through some files, I noticed that there's this empty partition, as shown in milkv/genimage-milkv-duo.cfg.

Is there any purpose to that empty partition? I deleted it to expand the rootfs/"linux 0x83" partition, but I'm not sure if it's used for anything.

Thanks for the great guide! :)

H26x Not supported by this SDK

This SDK works fine with MMF, but it doesn't have your features.

[root@milkv-duo]~# sample_venc -c 264
[initSysAndVb]-2733: [Pool 0] u32BlkSize: 12288, u32BlkCnt: 1
[   15.132331] [ERR] vidEnc_open = 566, cviVEncOpen
[   15.137758] [ERR] CVI_VENC_CreateChn = 1072, venc_init_encoder
[   15.144120] CVI_VENC_CreateChn with -1073250298
[ERR] CVI_VENC_CreateChn = 143, ioctl CVI_VC_VENC_CREATE_CHN fail with -1073250298
[ERR] SAMPLE_COMM_VENC_Create = 793, CVI_VENC_CreateChn [0] failed with -1073250298
[ERR] SAMPLE_COMM_VENC_Start = 2062, SAMPLE_COMM_VENC_Create failed with -1073250298
[ERR] _SAMPLE_VENC_INIT_CHANNEL = 2600, Venc Start failed for 0xffffffff!
[ERR] SAMPLE_VENC_START = 2237, [Chn 0]sample venc init failed
[ERR] venc_main = 703, SAMPLE_VENC_START

The call of CVI_VENC_CreateChn is failed with CVI_ERR_VENC_NULL_PTRNull. The original SDK works normally.

Persistent RNDIS MAC addresses - Solution

Sorry for not providing a PR but paste and explain the solution here.

For my use-case: in order to have the host get a "static" IP so the routing from the board to the internet being more simple, one has to make the MAC addresses persistent on the board for the RNDIS setup.

  • /etc/rndis-macs.sh: creates two MACs and stores them in /etc/rndis-macs.conf once, and persistently sets them when RNDIS is started
  • /etc/usb-rndis.sh: insert call for /etc/rndis-macs.sh after probe and before start

/etc/usb-rndis.sh add a new line with /etc/rndis-macs.sh call:

/etc/uhubon.sh device >> /tmp/rndis.log 2>&1
/etc/run_usb.sh probe rndis >> /tmp/rndis.log 2>&1
/etc/rndis-macs.sh >> /tmp/rndis.log 2>&1
/etc/run_usb.sh start rndis >> /tmp/rndis.log 2>&1

.... (existing code)

/etc/rndis-macs.sh:

#!/bin/bash

RNDIS_USB="/tmp/usb/usb_gadget/cvitek/functions/rndis.usb0"
MAC_FILE="/etc/rndis-macs.conf"

generate_random_mac() {
    printf "02:%02x:%02x:%02x:%02x:%02x\n" $((RANDOM%256)) $((RANDOM%256)) $((RANDOM%256)) $((RANDOM%256)) $((RANDOM%256))
}

# check if the MAC address file exists and has exactly two lines
if [[ -f "$MAC_FILE" ]] && [[ $(wc -l < "$MAC_FILE") -eq 2 ]]; then
    # read the two MAC addresses from the file
    IFS=$'\n' read -d '' -r -a macs < "$MAC_FILE"
    dev="${macs[0]}"
    host="${macs[1]}"
    echo "using existing MAC addresses:"
else
    # generate two new MAC addresses and store them in the file
    echo "generating new MAC addresses:"
    dev=$(generate_random_mac)
    host=$(generate_random_mac)
    echo "$dev" > "$MAC_FILE"
    echo "$host" >> "$MAC_FILE"
fi
echo "dev_addr: $dev"
echo "host_addr: $host"
echo "$dev" > "$RNDIS_USB"/dev_addr
echo "$host" > "$RNDIS_USB"/host_addr

I described the solution at https://xyzdims.com/3d-printers/misc-hardware-notes/iot-milk-v-duo-risc-v-esbc-running-linux/#Static_IP_for_Host_with_RNDIS

How can I read 7bytes in a row with wiringx

Sorry if this isn't the right place to ask but I'm very new to programming and looking for a little help. My Duo is connected to an aht21 temp and humidity sensor. Once the sensor is initialized and takes a measurement it wants to returns 7 bytes in a row. On my rpi pico I was able to get the sensor reading when I read the 7bytes in one shot. I've tried looping the wiringXI2CRead() function but I can only ready the 1st byte over and over again. I there a way to read that many bytes using wiringX. It seems that I can only read 1 or two bytes at a time. Thanks

使用 menuconfig 添加 python rootfs package 不生效

环境信息

  • OS: Ubuntu 20.04 LTS x86_64
  • sdk: 主线最新

复现步骤

添加选项

export PATH=/usr/sbin/:$PATH

export MILKV_BOARD=milkv-duo
source milkv/boardconfig-milkv-duo.sh
source build/milkvsetup.sh
defconfig cv1800b_milkv_duo_sd
menuconfig

menuconfig

diff_config

或直接添加

vim build/boards/cv180x/cv1800b_milkv_duo_sd/linux/cvitek_cv1800b_milkv_duo_sd_defconfig

# 在最后添加
CONFIG_TARGET_PACKAGE_PYTHON3.7=y

构建

clean_all
build_all
pack_sd_image

或者一键编译

./build_milkv.sh

复现结果

构建过程中没有构建 python ,生成的镜像中也不包含 python

更新到duo 1.0.5后,开机lcd点亮后遇到usb启动,lcd就息屏

背景:
更新代码到最新。
移植st7735后,发现开机时lcd会亮,但是一旦执行到

[ 3.718097] sh (119): drop_caches: 3

之后就会屏幕黑掉,后续log是usb加载。

不清楚是不是usb加载后拉掉了spi的电。

spi配置

`&spi2 {
status = "okay";

/delete-node/ spidev@0;


st7789v: st7789v@0{
	compatible = "sitronix,st7789v";
	reg = <0>;
	status = "okay";
spi-max-frequency = <48000000>;
	spi-cpol;
	spi-cpha;
	rotate = <90>;
	fps = <30>;
	rgb;
	buswidth = <8>;

	//dc-gpios = <&port 21 GPIO_ACTIVE_HIGH>;	//DC
	dc-gpios = <&porta 23 GPIO_ACTIVE_HIGH>;	//DC
	reset-gpios = <&porta 24 GPIO_ACTIVE_HIGH>; //RES
	led-gpios = <&porta 14 GPIO_ACTIVE_HIGH>; //BL

	debug = <0x0>;
};

};`

log如下:

[ 0.000000] Linux version 5.10.4-tag- (youkai@ubuntu) (riscv64-unknown-linux-musl-gcc (Xuantie-900 linux-5.10.4 musl gcc Toolchain V2.6.1 B-20220906) 10.2.0, GNU ld (GNU Binutils) 2.35) #1 PREEMPT Mon Nov 6 22:54:56 +08 2023 [ 0.000000] earlycon: sbi0 at I/O port 0x0 (options '') [ 0.000000] printk: bootconsole [sbi0] enabled [ 0.000000] efi: UEFI not found. [ 0.000000] Ion: Ion memory setup at 0x0000000082473000 size 26 MiB [ 0.000000] OF: reserved mem: initialized node ion, compatible id ion-region [ 0.000000] Zone ranges: [ 0.000000] DMA32 [mem 0x0000000080000000-0x0000000083f3ffff] [ 0.000000] Normal empty [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000080000000-0x0000000083f3ffff] [ 0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x0000000083f3ffff] [ 0.000000] On node 0 totalpages: 16192 [ 0.000000] DMA32 zone: 222 pages used for memmap [ 0.000000] DMA32 zone: 0 pages reserved [ 0.000000] DMA32 zone: 16192 pages, LIFO batch:3 [ 0.000000] SBI specification v0.3 detected [ 0.000000] SBI implementation ID=0x1 Version=0x9 [ 0.000000] SBI v0.2 TIME extension detected [ 0.000000] SBI v0.2 IPI extension detected [ 0.000000] SBI v0.2 RFENCE extension detected [ 0.000000] riscv: ISA extensions acdfimsuv [ 0.000000] riscv: ELF capabilities acdfimv [ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768 [ 0.000000] pcpu-alloc: [0] 0 [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 15970 [ 0.000000] Kernel command line: root=/dev/mmcblk0p2 rootwait rw console=tty0 console=ttyS0,115200 earlycon=sbi loglevel=9 riscv.fwsz=0x80000 [ 0.000000] Dentry cache hash table entries: 8192 (order: 4, 65536 bytes, linear) [ 0.000000] Inode-cache hash table entries: 4096 (order: 3, 32768 bytes, linear) [ 0.000000] Sorting __ex_table... [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off [ 0.000000] Memory: 28932K/64768K available (3946K kernel code, 498K rwdata, 1721K rodata, 152K init, 218K bss, 35836K reserved, 0K cma-reserved) [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ 0.000000] rcu: Preemptible hierarchical RCU implementation. [ 0.000000] rcu: RCU event tracing is enabled. [ 0.000000] Trampoline variant of Tasks RCU enabled. [ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies. [ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0 [ 0.000000] riscv-intc: 64 local interrupts mapped [ 0.000000] plic: interrupt-controller@70000000: mapped 101 interrupts with 1 handlers for 2 contexts. [ 0.000000] random: get_random_bytes called from start_kernel+0x2e0/0x41c with crng_init=0 [ 0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [0] [ 0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x5c40939b5, max_idle_ns: 440795202646 ns [ 0.000010] sched_clock: 64 bits at 25MHz, resolution 40ns, wraps every 4398046511100ns [ 0.008481] Console: colour dummy device 80x25 [ 0.014665] printk: console [tty0] enabled [ 0.018916] Calibrating delay loop (skipped), value calculated using timer frequency.. 50.00 BogoMIPS (lpj=100000) [ 0.029676] pid_max: default: 4096 minimum: 301 [ 0.034539] Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear) [ 0.042044] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear) [ 0.051671] ASID allocator initialised with 65536 entries [ 0.057447] rcu: Hierarchical SRCU implementation. [ 0.062874] EFI services will not be available. [ 0.068011] devtmpfs: initialized [ 0.077542] early_time_log: do_initcalls: 4664551us [ 0.083308] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns [ 0.093449] futex hash table entries: 16 (order: -4, 384 bytes, linear) [ 0.100407] pinctrl core: initialized pinctrl subsystem [ 0.106367] NET: Registered protocol family 16 [ 0.111512] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations [ 0.118900] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations [ 0.127940] thermal_sys: Registered thermal governor 'step_wise' [ 0.144109] OF: /gpio@03020000/gpio-controller@0: could not find phandle [ 0.157383] OF: /gpio@03021000/gpio-controller@1: could not find phandle [ 0.164374] OF: /gpio@03022000/gpio-controller@2: could not find phandle [ 0.171363] OF: /gpio@03023000/gpio-controller@3: could not find phandle [ 0.178347] OF: /gpio@05021000/gpio-controller@4: could not find phandle [ 0.187357] clk reset: nr_reset=64 resource_size=8 [ 0.192996] get audio clk=24576000 [ 0.196588] cvitek-i2s-subsys 4108000.i2s_subsys: Set clk_sdma_aud0~3 to 24576000 [ 0.218308] dw_dmac 4330000.dma: CVITEK DMA Controller, 8 channels, probe done! [ 0.226943] SCSI subsystem initialized [ 0.231299] usbcore: registered new interface driver usbfs [ 0.237139] usbcore: registered new interface driver hub [ 0.242783] usbcore: registered new device driver usb [ 0.251581] Ion: ion_parse_dt_heap_common: id 0 type 2 name carveout align 1000 [ 0.259698] Ion: rmem_ion_device_init: heap carveout base 0x0000000082473000 size 0x0000000001acd000 dev (____ptrval____) [ 0.271069] ion_carveout_heap_create, size=0x1acd000 [ 0.276342] cvi_get_rtos_ion_size, rtos ion_size get:0x0 [ 0.411908] platform carveout: [ion] add heap id 0, type 2, base 0x82473000, size 0x1acd000 [ 0.421009] Advanced Linux Sound Architecture Driver Initialized. [ 0.428759] clocksource: Switched to clocksource riscv_clocksource [ 0.448561] NET: Registered protocol family 2 [ 0.454220] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes, linear) [ 0.463017] TCP established hash table entries: 512 (order: 0, 4096 bytes, linear) [ 0.470895] TCP bind hash table entries: 512 (order: 0, 4096 bytes, linear) [ 0.478129] TCP: Hash tables configured (established 512 bind 512) [ 0.484731] UDP hash table entries: 128 (order: 0, 4096 bytes, linear) [ 0.491549] UDP-Lite hash table entries: 128 (order: 0, 4096 bytes, linear) [ 0.499011] NET: Registered protocol family 1 [ 0.504236] RPC: Registered named UNIX socket transport module. [ 0.510427] RPC: Registered udp transport module. [ 0.515282] RPC: Registered tcp transport module. [ 0.520201] RPC: Registered tcp NFSv4.1 backchannel transport module. [ 0.529610] Initialise system trusted keyrings [ 0.534544] workingset: timestamp_bits=62 max_order=13 bucket_order=0 [ 0.548891] squashfs: version 4.0 (2009/01/31) Phillip Lougher [ 0.556077] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc. [ 0.563340] Key type asymmetric registered [ 0.567604] Asymmetric key parser 'x509' registered [ 0.579088] Serial: 8250/16550 driver, 5 ports, IRQ sharing disabled [ 0.587890] printk: console [ttyS0] disabled [ 0.592472] 4140000.serial: ttyS0 at MMIO 0x4140000 (irq = 15, base_baud = 1562500) is a 16550A [ 0.601597] printk: console [ttyS0] enabled [ 0.610239] printk: bootconsole [sbi0] disabled [ 0.623176] cvi-spif 10000000.cvi-spif: unrecognized JEDEC id bytes: 00 00 00 00 00 00 [ 0.631497] cvi-spif 10000000.cvi-spif: device scan failed [ 0.637244] cvi-spif 10000000.cvi-spif: unable to setup flash chip [ 0.650222] libphy: Fixed MDIO Bus: probed [ 0.655945] dwc2 4340000.usb: axi clk installed [ 0.660769] dwc2 4340000.usb: apb clk installed [ 0.665533] dwc2 4340000.usb: 125m clk installed [ 0.670387] dwc2 4340000.usb: 33k clk installed [ 0.675149] dwc2 4340000.usb: 12m clk installed [ 0.680005] dwc2 4340000.usb: EPs: 8, dedicated fifos, 3072 entries in SPRAM [ 0.688009] dwc2 4340000.usb: DWC OTG Controller [ 0.692936] dwc2 4340000.usb: new USB bus registered, assigned bus number 1 [ 0.700274] dwc2 4340000.usb: irq 36, io mem 0x04340000 [ 0.706746] hub 1-0:1.0: USB hub found [ 0.710824] hub 1-0:1.0: 1 port detected [ 0.716702] usbcore: registered new interface driver usb-storage [ 0.723455] i2c /dev entries driver [ 0.729403] sdhci: Secure Digital Host Controller Interface driver [ 0.735897] sdhci: Copyright(c) Pierre Ossman [ 0.740471] sdhci-pltfm: SDHCI platform and OF driver helper [ 0.746653] cvi:sdhci_cvi_probe [ 0.796779] mmc0: SDHCI controller on 4310000.cv-sd [4310000.cv-sd] using ADMA 64-bit [ 0.805034] cvi_proc_init cvi_host 0x(____ptrval____) [ 0.811068] usbcore: registered new interface driver usbhid [ 0.820788] usbhid: USB HID core driver [ 0.825713] fb_st7789v spi0.0: fbtft_property_value: buswidth = 8 [ 0.832199] fb_st7789v spi0.0: fbtft_property_value: debug = 0 [ 0.838386] fb_st7789v spi0.0: fbtft_property_value: rotate = 0 [ 0.844649] fb_st7789v spi0.0: fbtft_property_value: fps = 30 [ 0.930629] mmc0: new high speed SDHC card at address aaaa [ 0.937335] mmcblk0: mmc0:aaaa SU08G 7.40 GiB [ 0.946527] mmcblk0: p1 p2 p3 [ 1.356494] random: fast init done [ 1.373156] Console: switching to colour frame buffer device 16x10 [ 1.380940] graphics fb0: fb_st7789v frame buffer, 128x160, 40 KiB video memory, 4 KiB buffer memory, fps=31, spi0.0 at 48 MHz [ 1.397126] cvitek-i2s 4100000.i2s: cvi_i2s_probe [ 1.403882] cvitek-i2s 4110000.i2s: cvi_i2s_probe [ 1.414475] cvitek-i2s 4120000.i2s: cvi_i2s_probe [ 1.427565] cvitek-i2s 4130000.i2s: cvi_i2s_probe [ 1.437222] cviteka-adc sound_adc: cviteka_adc_probe, dev name=sound_adc [ 1.445878] cviteka-adc sound_adc: cviteka_adc_probe start devm_snd_soc_register_card [ 1.461330] cvitekaadc 300a100.adc: cvitekaadc_probe [ 1.473553] cviteka-dac sound_dac: cviteka_dac_probe, dev name=sound_dac [ 1.485123] cvitekadac 300a000.dac: cvitekadac_probe [ 1.491848] cvitekadac_probe gpio_is_valid mute_pin_l [ 1.502790] cv1835-max98357a sound: snd card name = cv1835_max98357a [ 1.526922] NET: Registered protocol family 10 [ 1.534259] Segment Routing with IPv6 [ 1.545607] NET: Registered protocol family 17 [ 1.551737] random: crng init done [ 1.558855] Loading compiled-in X.509 certificates [ 1.603273] cviteka-adc sound_adc: cviteka_adc_probe, dev name=sound_adc [ 1.611808] cviteka-adc sound_adc: cviteka_adc_probe start devm_snd_soc_register_card [ 1.627825] cviteka-dac sound_dac: cviteka_dac_probe, dev name=sound_dac [ 1.642673] cfg80211: Loading compiled-in X.509 certificates for regulatory database [ 1.668252] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7' [ 1.677043] cfg80211: failed to load regulatory.db [ 1.683520] ALSA device list: [ 1.687740] dw-apb-uart 4140000.serial: forbid DMA for kernel console [ 1.715690] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null) [ 1.726136] VFS: Mounted root (ext4 filesystem) on device 179:2. [ 1.737466] devtmpfs: mounted [ 1.741510] Freeing unused kernel memory: 152K [ 1.747355] Kernel memory protection not selected by kernel config. [ 1.759179] Run /sbin/init as init process [ 1.769483] with arguments: [ 1.777022] /sbin/init [ 1.780446] with environment: [ 1.784627] HOME=/ [ 1.787724] TERM=linux [ 1.791158] early_time_log: run_init_process: 6378169us [ 1.878890] EXT4-fs (mmcblk0p2): re-mounted. Opts: errors=remount-ro [ 2.557255] cv180x_sys: bad vermagic: kernel tainted. [ 2.563788] Disabling lock debugging due to kernel taint [ 2.570885] cv180x_sys: loading out-of-tree module taints kernel. [ 2.600614] res-reg: start: 0xa0c8000, end: 0xa0c801f, virt-addr(ffffffd0040c1000). [ 2.619673] CVITEK CHIP ID = 22 [ 2.638827] cvi_rtos_cmdqu_probe start --- [ 2.649226] name=1900000.rtos_cmdqu [ 2.657030] res-reg: start: 0x1900000, end: 0x1900fff, virt-addr(ffffffd0040c5000). [ 2.666851] cvi_rtos_cmdqu_probe DONE [ 2.672188] [cvi_spinlock_init] success [ 2.896807] RTOS_CMDQU_SEND_WAIT timeout [ 2.901892] SYS_CMD_INFO_LINUX_INIT_DONE fail [ 2.907782] communicate with rtos fail [ 2.926365] cif a0c2000.cif: cam0 clk installed [ 2.932457] cif a0c2000.cif: cam1 clk installed [ 2.942807] cif a0c2000.cif: vip_sys_2 clk installed [ 2.955838] cif a0c2000.cif: clk_mipimpll clk installed 00000000833de2c3 [ 2.967266] cif a0c2000.cif: clk_disppll clk installed 00000000d25175b7 [ 2.976056] cif a0c2000.cif: clk_fpll clk installed 00000000805f969e [ 2.989682] cif a0c2000.cif: (0) res-reg: start: 0xa0c2000, end: 0xa0c3fff. [ 3.006362] cif a0c2000.cif: virt-addr(000000009c846059) [ 3.013568] cif a0c2000.cif: (1) res-reg: start: 0xa0d0000, end: 0xa0d0fff. [ 3.022592] cif a0c2000.cif: virt-addr(00000000ccabe0bb) [ 3.033643] cif a0c2000.cif: (2) res-reg: start: 0xa0c4000, end: 0xa0c5fff. [ 3.051410] cif a0c2000.cif: virt-addr(000000005eb7584c) [ 3.058559] cif a0c2000.cif: (3) res-reg: start: 0x3001c30, end: 0x3001c5f. [ 3.067584] cif a0c2000.cif: virt-addr(00000000e6740473) [ 3.078725] cif a0c2000.cif: no pad_ctrl for cif [ 3.091406] cif a0c2000.cif: request irq-26 as cif-irq0 [ 3.101042] cif a0c2000.cif: request irq-27 as cif-irq1 [ 3.108101] cif a0c2000.cif: rst_pin = 424, pol = 1 [ 3.129320] snsr_i2c snsr_i2c: i2c:-------hook 0 [ 3.138214] snsr_i2c snsr_i2c: i2c:-------hook 1 [ 3.145220] snsr_i2c snsr_i2c: i2c:-------hook 2 [ 3.151855] snsr_i2c snsr_i2c: i2c:-------hook 3 [ 3.158391] snsr_i2c snsr_i2c: i2c:-------hook 4 [ 3.222381] vi_core_probe:203(): res-reg: start: 0xa000000, end: 0xa07ffff, virt-addr(ffffffd004480000). [ 3.234335] vi_core_probe:216(): irq(28) for isp get from platform driver. [ 3.247718] vi_tuning_buf_setup:253(): tuning fe_addr[0]=0x8171f490, be_addr[0]=0x81717290, post_addr[0]=0x81700000 [ 3.270064] vi_tuning_buf_setup:253(): tuning fe_addr[1]=0x816df490, be_addr[1]=0x816d7290, post_addr[1]=0x816c0000 [ 3.289968] vi_tuning_buf_setup:253(): tuning fe_addr[2]=0x816ff490, be_addr[2]=0x816f7290, post_addr[2]=0x816e0000 [ 3.309777] sync_task_init:177(): sync_task_init vi_pipe 0 [ 3.317037] sync_task_init:177(): sync_task_init vi_pipe 1 [ 3.324287] sync_task_init:177(): sync_task_init vi_pipe 2 [ 3.340935] vi_core_probe:252(): isp registered as cvi-vi [ 3.411286] cvi_dwa_probe:487(): done with rc(0). [ 3.449977] cv180x-cooling cv180x_cooling: elems of dev-freqs=6 [ 3.466628] cv180x-cooling cv180x_cooling: dev_freqs[0]: 850000000 500000000 [ 3.475920] cv180x-cooling cv180x_cooling: dev_freqs[1]: 425000000 375000000 [ 3.489002] cv180x-cooling cv180x_cooling: dev_freqs[2]: 425000000 300000000 [ 3.507107] cv180x-cooling cv180x_cooling: Cooling device registered: cv180x_cooling [ 3.557705] jpu ctrl reg pa = 0xb030000, va = 000000002553fa1c, size = 256 [ 3.566939] end jpu_init result = 0x0 [ 3.700227] cvi_vc_drv_init result = 0x0 [ 3.718097] sh (119): drop_caches: 3 [ 3.919406] dwc2 4340000.usb: new device is high-speed [ 3.942269] using random self ethernet address [ 3.942290] using random host ethernet address [ 3.994692] usb0: HOST MAC da:6e:e0:d2:0c:45 [ 3.995030] usb0: MAC ce:9d:f5:ec:9e:27 [ 3.995107] dwc2 4340000.usb: bound driver configfs-gadget [ 4.135360] dwc2 4340000.usb: new device is high-speed [ 4.172829] dwc2 4340000.usb: new address 11 [ 4.351213] dwc2 4340000.usb: new device is high-speed [ 4.388549] dwc2 4340000.usb: new address 11 [ 5.016822] IPv6: ADDRCONF(NETDEV_CHANGE): usb0: link becomes ready

What exactly is meant by "copy all to a blank tf card.." in how_to_download.txt, which is generated by the spinand configuration?

There is about 35M in the directory where "how_to_download.txt" is found, but the total project is like 10G. There are lots of files compiled in build, in install, what is all?? I know a lot of it is redundant configurations/drivers for other devices, but I do not understand what or how to install.

The physical positioning of the optional NAND flash footprint is right in front of the microSD card reader is, and I physically cannot put an SD card in this device, there is a SMD flash block in the way, and I would need to snap the card to complete the "how_to_download.txt" instructions.

`undefined reference to '__atomic_compare_exchange_1'` when running `./build_milkv.sh`

After running ./build_milkv.sh, I got error like this:

[riscv64-unknown-linux-musl-gcc] sample_venc.o
/home/vitalyr/projects/dev/embed/duo-buildroot-sdk/host-tools/gcc/riscv64-linux-musl-x86_64/bin/../lib/gcc/riscv64-unknown-linux-musl/10.2.0/../../../../riscv64-unknown-linux-musl/bin/ld: /home/vitalyr/projects/dev/embed/duo-buildroot-sdk/middleware/v2/lib/libsys.a(cvi_vb.o): in function `CVI_VB_Init':
/root/.jenkins/workspace/v4.1.0_release_build/middleware/v2/modules/sys/src/cvi_vb.c:201: undefined reference to `__atomic_compare_exchange_1'
/home/vitalyr/projects/dev/embed/duo-buildroot-sdk/host-tools/gcc/riscv64-linux-musl-x86_64/bin/../lib/gcc/riscv64-unknown-linux-musl/10.2.0/../../../../riscv64-unknown-linux-musl/bin/ld: /home/vitalyr/projects/dev/embed/duo-buildroot-sdk/middleware/v2/lib/libsys.a(cvi_vb.o): in function `CVI_VB_Exit':
/root/.jenkins/workspace/v4.1.0_release_build/middleware/v2/modules/sys/src/cvi_vb.c:225: undefined reference to `__atomic_compare_exchange_1'
collect2: error: ld returned 1 exit status

It seems to be already fixed by gcc toolchains([1], [2], [3]), but duo-build root-SDK will download an older gcc toolchain (gcc 10) to build the image. How about updating the toolchain?

  1. riscvarchive/riscv-gcc#12
  2. https://www.overleaf.com/project/624c33c4e2d49b02be626e13
  3. advancedtelematic/aktualizr#1427 (comment)

apt-get: not found

I get this error after first login in to Duo-V1.0.6. where from I can start?

How to make change to config of buildroot?

I am trying to add dtc to my target image of milk-duo.
When I want to change the config of kernel, I can run menuconfig_kernel. But I can't find a way to change the config of buildroot.
Is there any way I can achieve this?

Looking forward to your reply~

Kernel CPU load average math is messed up!

The load average should be nearer to 0.00. htop reports a correct CPU %, but the load average comes from the kernel itself:

  CPU[*                                       1.3%]   Tasks: 13, 0 thr; 1 running
  Mem[|||||||||||##******              13.8M/55.4M]   Load average: 3.11 3.07 2.78 
  Swp[                                       0K/0K]   Uptime: 00:34:59

 PID USER      PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command                                       
 297 root       20   0  1384  1148   892 R  1.3  2.0  0:00.33 htop                                          
   1 root       20   0  1184   516   496 S  0.0  0.9  0:00.98 init            
  99 root       20   0  1184   472   452 S  0.0  0.8  0:00.03 /sbin/syslogd -n
 103 root       20   0  1172   516   500 S  0.0  0.9  0:00.02 /sbin/klogd -n              
 133 dhcpcd     20   0  1172   872   696 S  0.0  1.5  0:00.01 dhcpcd: [master] [ip4] [ip6]  
 134 root       20   0  1180   852   692 S  0.0  1.5  0:00.05 dhcpcd: [privileged actioneer]
 135 dhcpcd     20   0  1160   776   640 S  0.0  1.4  0:00.00 dhcpcd: [network proxy]
 136 dhcpcd     20   0  1160   656   520 S  0.0  1.2  0:00.00 dhcpcd: [control proxy]
 171 root       20   0   984   664   620 S  0.0  1.2  0:01.30 /usr/sbin/dropbear -R
 175 nobody     20   0  1088   804   692 S  0.0  1.4  0:00.01 /usr/sbin/dnsmasq
 214 root       20   0  1204   684   636 S  0.0  1.2  0:00.01 -sh                  
 284 root       20   0  1008   680   624 S  0.0  1.2  0:01.99 /usr/sbin/dropbear -R
 285 root       20   0  1204   688   640 S  0.0  1.2  0:00.02 -sh

I know I saw a post about Linus not wanting people to mess with the load average math because it was written specially in integer math (because you have to avoid FPU math inside kernel calls).

Looks like some optimizations inside the kernel for x86/x86_64 are causing issues on the RISCV CPU. I don't recall the code, but I know it was highly hand optimized code from what I vaguely remember.

P.S.> even disabled ntp as the cpu has no access to internet

Enabling spidev2 instructions

I am having trouble enabling SPIdev2 on this MilkV Duo device. I have followed a number of forum posts related to compiling spidev, and after compiling a new image in buildroot and entering the device via ssh, there is no spidev2.0 device available.

[root@milkv-duo]~# ls /dev/spi*
/dev/spidev0.0  /dev/spidev1.0

I do not know if I am updating the device tree incorrectly or what else is wrong.

I have updated the files:

build/boards/cv180x/cv1800b_milkv_duo_sd/dts_riscv/cv1800b_milkv_duo_sd.dts
u-boot-2021.10/board/cvitek/cv180x/board.c

and then ran this command in the ubuntu 22.04 docker image:

cd /home/work
./build milkv-duo

Can you let me know the files to update for a basic usage of SPIdev2, and have it appear in the device tree?

It seems like many people need SPI, and it is unclear if spi0 and spi1 are earmarked for something or if I can use them. I am not using the NAND/NOR. Can spidev2 be enabled by default in a future release?

References:
https://community.milkv.io/t/st7789v3-screen-working/519
https://community.milkv.io/t/enable-spi2-and-the-corresponding-spidev-on-milk-v-duo/122

epoll_wait() failed! return -1, errno = 38, ENOSYS

使用系统调用epoll_wait() 失败,返回值为-1,错误码为38,ENOSYS,意为系统不支持/未实现此调用。这么常见的系统调用真的没有支持吗?

Translation: The system call epoll_wait() failed with a return value of -1 and error code 38. ENOSYS means that the system does not support/implement this call. Is it true that such common system calls are not supported?

No interrupts from the FT6236 touch panel (i.e. standard Linux drivers do not process interrupts from GPIO)

Milk-V Duo:

The Focaltech touch panel driver does not process interrupts, although the settings in the cv1800b_milkv_duo_sd.dts file are complete:

&i2c0 {
status = "okay";
clock-frequency = <100000>;

    touchscreen@38 {
    compatible = "focaltech,ft6236";
    reg = <0x38>;

    interrupt-parent = <&porta>;
    interrupts = <14 2>;

    touchscreen-size-x = <320>;
    touchscreen-size-y = <480>;
    touchscreen-swapped-x-y;
    touchscreen-inverted-y;
    status = "okay";
    reset-gpios = <&porta 15  GPIO_ACTIVE_LOW>;
    };

};

Of course, GPIOA15 is configured as GPIO and the FT6235 is compiled with the kernel.

Solution:

Please add the "#interrupt-cells=<2>" line for porta in the cv180x_base_riscv.dtsi file:

gpio0: gpio@03020000 {
        porta: gpio-controller@0 {
                interrupt-controller;
                interrupts = <60 IRQ_TYPE_LEVEL_HIGH>;
                interrupt-parent = <&plic0>;
                #interrupt-cells = <2>;
        };
};

Now interrupts from GPIO are correctly propagated to the interrupt controller driver.

https://community.milkv.io/t/gpio/1251/4

makefile 9 all error 1

collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:78: sample_venc] Error 1
make[1]: se sale del directorio '/home/icelon/risck/duo-buildroot-sdk/middleware/v2/sample/venc'
make: *** [Makefile:9: all] Error 1

CONFIG_RTL8821CS does not produce anything.

In the kernel config, there is an option config RTL8821CS. However, this config does not control anything. Setting it to m will not produce any .ko kernel modules.
Please check if there anything related to this missing in this sdk.

Build Failure make: *** [scripts/fip_v2.mk:32: fsbl-build] Error 2

Env: WSL2 + Ubuntu22.04

Attempting to rebuild the kernel for the milkvduo, using WSL2 with Ubuntu22.04. I wanted to rebuild the kernel with gdbserver added so I set CONFIG_TARGET_PACKAGE_GDBSERVER to y in build/boards/cv180x/cv1800b_milkv_duo_sd/cv1800b_milkv_duo_sd_defconfig. But when attempting to build the kernel using the build_milkv.sh script, or the "step-by-step" way described here I get the following error:

make[1]: *** [Makefile:196: duo-buildroot-sdk/fsbl/build/cv1800b_milkv_duo_sd/bl2/bl2.elf] Error 1
make[1]: Leaving directory 'duo-buildroot-sdk/fsbl'
make: *** [scripts/fip_v2.mk:32: fsbl-build] Error 2
Error: Build board milkv-duo failed!

I get this error regardless what I set CONFIG_TARGET_PACKAGE_GDBSERVER to, what could be the issue here? The error is referring to

	${Q}$(MAKE) -j${NPROC} -C ${FSBL_PATH} O=${FSBL_OUTPUT_PATH} BLCP_2ND_PATH=${BLCP_2ND_PATH} \
		LOADER_2ND_PATH=${UBOOT_PATH}/${UBOOT_OUTPUT_FOLDER}/u-boot-raw.bin

So I cannot really tell what the issue is

camera_test.sh crashes immediately on milkv-dup 256m

Hello, both on individual board and using the carrier board the camera_test.sh starts and then crashes immediately with similar messages, both using the compiled image and the binary release milkv-duo256m-v1.0.8-2024-0130.img, please help:

[root@milkv-duo]~# camera-test.sh
[SAMPLE_COMM_SNS_ParseIni]-1950: Parse /mnt/data/sensor_cfg.ini
[parse_source_devnum]-1605: devNum = 1
[parse_sensor_name]-1686: sensor = GCORE_GC2083_MIPI_2M_30FPS_10BIT
[parse_sensor_busid]-1714: bus_id = 2
[parse_sensor_i2caddr]-1725: sns_i2c_addr = 37
[parse_sensor_mipidev]-1736: mipi_dev = 0
[parse_sensor_laneid]-1747: Lane_id = 1, 0, 2, -1, -1
[parse_sensor_pnswap]-1758: pn_swap = 0, 0, 0, 0, 0
MMF Version:7e0cc6a08-musl_riscv64
Create VBPool[0], size: (3110400 * 3) = 9331200 bytes
Create VBPool[1], size: (3110400 * 3) = 9331200 bytes
Create VBPool[2], size: (2764800 * 1) = 2764800 bytes
Total memory of VB pool: 21427200 bytes
Initialize SYS and VB
Initialize VI
ISP Vipipe(0) Allocate pa(0x8c771000) va(0x0x3fe736d000) size(291120)
stSnsrMode.u16Width 1920 stSnsrMode.u16Height 1080 25.000000 wdrMode 0 pstSnsObj 0x3fe7ea2400
[SAMPLE_COMM_VI_StartMIPI]-483: sensor 0 stDevAttr.devno 0
awbInit ver 6.8@2021500
0 R:1400 B:3100 CT:2850
1 R:1500 B:2500 CT:3900
2 R:2300 B:1600 CT:6500
Golden 1024 1024 1024
WB Quadratic:0
isWdr:0
ViPipe:0,===GC2083 1080P 30fps 10bit LINE Init OK!===


cvi_bin_isp message
gerritId: 36403 commitId: c69c5863e
md5: cab880835a2ad5184de5ed7762404b84
sensorNum 1
sensorName0 2083

PQBIN message
gerritId: 80171 commitId: 5c9d8fc5d
md5: ba5a510e093ad42db6788e6c2d13169e
sensorNum 3
sensorName0 2053

author: wanqiang.he desc: 思博慧CV1812H_GC2083_RGB_mode_V1.0.0
createTime: 2023-08-04 16:48:08version: V1.1
tool Version: v3.0.5.24 mode:


sensorName(0) mismatch, mwSns:2083 != pqBinSns:2053
[SAMPLE_COMM_ISP_Thread]-95: ISP Dev 0 running!
Initialize VPSS
---------VPSS[0]---------
Input size: (1920x1080)
Input format: (19)
VPSS physical device number: 1
Src Frame Rate: -1
Dst Frame Rate: -1
--------CHN[0]-------
Output size: (1920x1080)
Depth: 1
Do normalization: 0
Src Frame Rate: -1
Dst Frame Rate: -1
----------------------
--------CHN[1]-------
Output size: (1920x1080)
Depth: 1
Do normalization: 0
Src Frame Rate: -1
Dst Frame Rate: -1
----------------------

Bind VI with VPSS Grp(0), Chn(0)
Attach VBPool(0) to VPSS Grp(0) Chn(0)
Attach VBPool(1) to VPSS Grp(0) Chn(1)
Initialize VENC
venc codec: h264
venc frame size: 1920x1080
Initialize RTSP
rtsp://10.42.0.216/h264
prio:0
version: 1.4.0
scrfd768432 Build at 2023-12-25 01:21:44 For platform cv181x
Max SharedMem size:1658880
anchor:-8,-8,8,8
anchor:-16,-16,16,16
bbox:bbox_8_Conv_dequant
landmark:kps_8_Conv_dequant
score:score_8_Sigmoid_dequant
anchor:-32,-32,32,32
anchor:-64,-64,64,64
bbox:bbox_16_Conv_dequant
landmark:kps_16_Conv_dequant
score:score_16_Sigmoid_dequant
anchor:-128,-128,128,128
anchor:-256,-256,256,256
bbox:bbox_32_Conv_dequant
landmark:kps_32_Conv_dequant
score:score_32_Sigmoid_dequant
Enter TDL thread
Enter encoder thread
0 R:1165 B:3087 CT:2688
1 R:1464 B:2327 CT:3937
2 R:1974 B:1613 CT:7225
Golden 1464 1024 2327
wdrLEOnly:1
face count: 0
face count: 0
face count: 0
face count: 0
face count: 0
face count: 0
face count: 0
face count: 0
face count: 0
face count: 0
face count: 0
face count: 0
face count: 0
face count: 0
face count: 0
face count: 0
face count: 0
face count: 0
face count: 0
face count: 0
face count: 0
face count: 0
face count: 0
face count: 0
face count: 0
face count: 0
face count: 0
[ 451.777711] Unable to handle kernel NULL pointer dereference at virtual address 00000000000002a2
[ 451.786796] Oops [#1]
[ 451.789142] Modules linked in: cv181x_pwm(FO) cv181x_ive(FO) cvi_vc_driver(FO) cv181x_jpeg(FO) cv181x_vcodec(FO) cv181x_tpu(FO) cv181x_clock_cooling(FO) cv181x_rgn(FO) cv181x_mipi_tx(FO) cv181x_vo(FO) cv181x_dwa(FO) cv181x_vpss(FO) cv181x_vi(FO) snsr_i2c(FO) cvi_mipi_rx(FO) cv1)
[ 451.817022] CPU: 0 PID: 0 Comm: swapper Tainted: GF O 5.10.4-tag- #1
[ 451.824839] epc: 00000000000002a2 ra : ffffffe00061fb8c sp : ffffffe0007eff10
[ 451.832207] gp : ffffffe0008632c0 tp : ffffffe0007f4440 t0 : 0000000000000000
[ 451.839665] t1 : ffffffe000620798 t2 : 0000000000000000 s0 : ffffffe0007eff70
[ 451.847122] s1 : ffffffe0007f4440 a0 : 0000000000000000 a1 : 0000000000000000
[ 451.854580] a2 : 0000000000000000 a3 : 0000000000000001 a4 : ffffffffffffffff
[ 451.862037] a5 : 0000000000000000 a6 : 0000000000000000 a7 : 0000000054494d45
[ 451.869494] s2 : 0000000000000000 s3 : ffffffe0007fbdc0 s4 : ffffffe0008640a8
[ 451.876952] s5 : 0000000000000001 s6 : 0000000000000000 s7 : 0000000000000000
[ 451.884409] s8 : 000000008b0c90b2 s9 : 0000000081ae02f8 s10: 0000000000000000
[ 451.891866] s11: 0000000000000003 t3 : 0000000000000000 t4 : 0000000000000150
[ 451.899322] t5 : 0000003fe6c89d80 t6 : 0000000000040000
[ 451.904808] status: 0000000200000100 badaddr: 00000000000002a2 cause: 000000000000000c
[ 451.912980] Call Trace:
[ 451.915530] [] schedule_idle+0xe/0x22
[ 451.920935] [] cpu_startup_entry+0x8/0xe
[ 451.926607] [] start_kernel+0x3f2/0x41c
[ 451.932211] vi_irq_handler:7325(): pre_fe_0 sof chn_num=0 frm_num=49
[ 451.938846] cvi_vip_job_finish:844(): img(1) grp(0) finish
[ 451.945852] ---[ end trace 8c9141ee810fbd9b ]---
[ 451.950657] Kernel panic - not syncing: Attempted to kill the idle task!
[ 451.957585] ---[ end Kernel panic - not syncing: Attempted to kill the idle task! ]---

如何使Linux使用2个内核?

我看到cv1800b不支持SMP,只支持AMP,所以无论如何一个任务也无法同时使用两个内核吗?而且大核貌似被锁了850Mhz?有办法解决么

Lack of an arm build option

Milk V Duo (256mb) has an arm core on it, However there is no info about it in the documentation,
Nor any build options (as far as i'm aware) in this repo.

Is there any way to compile things for arm instead of riscv?

_call_kconfig_script:11: no such file or directory: /tmp/duo-buildroot-sdk/build/scripts/.py

I'm using default develop branch (commit: be2a695), the script path is not correct.

/tmp$ git clone https://github.com/milkv-duo/duo-buildroot-sdk.git
/tmp$ cd duo-buildroot-sdk
/tmp/duo-buildroot-sdk$ git log -1
commit be2a69546e05700f669c758bf4540831555716ef (HEAD -> develop, tag: Duo-V1.0.3, origin/develop, origin/HEAD)
Author: carbon <[email protected]>
Date:   Thu Aug 17 14:21:24 2023 +0800

    camera: support sensor gc2083
/tmp/duo-buildroot-sdk$ 
/tmp/duo-buildroot-sdk$ 
/tmp/duo-buildroot-sdk$ 
/tmp/duo-buildroot-sdk$ export MILKV_BOARD=milkv-duo
/tmp/duo-buildroot-sdk$ source milkv/boardconfig-milkv-duo.sh
/tmp/duo-buildroot-sdk$ source build/milkvsetup.sh
/proc/self/fd/14:8: cv1800b_board_sel: assignment to invalid subscript range
  -------------------------------------------------------------------------------------------------------
    Usage:
    (1) menuconfig - Use menu to configure your board.
        ex: $ menuconfig

    (2) defconfig $CHIP_ARCH - List EVB boards($BOARD) by CHIP_ARCH.
       ** cv183x ** -> ['cv1829', 'cv1832', 'cv1835', 'cv1838', 'cv9520', 'cv7581']
       ** cv182x ** -> ['cv1820', 'cv1821', 'cv1822', 'cv1823', 'cv1825', 'cv1826', 'cv7327', 'cv7357']
       ** cv181x ** -> ['cv181x', 'cv1823a', 'cv1821a', 'cv1820a', 'cv1811h', 'cv1811c', 'cv1810c', 'cv1810h', 'cv1812cp', 'cv1812h', 'cv1813h']
       ** cv180x ** -> ['cv180x', 'cv1800b', 'cv1800c', 'cv1801b', 'cv1801c', 'cv180zb']
        ex: $ defconfig cv183x

    (3) defconfig $BOARD - Choose EVB board settings.
        ex: $ defconfig cv1835_wevb_0002a
        ex: $ defconfig cv1826_wevb_0005a_spinand
        ex: $ defconfig cv181x_fpga_c906
  -------------------------------------------------------------------------------------------------------
/tmp/duo-buildroot-sdk$ menuconfig                 
 Run  function 
boards  common_functions.sh  cvisetup.sh  Kconfig  Makefile  milkvsetup.sh  output  panels  scripts  sensors  tools
_call_kconfig_script:11: no such file or directory: /tmp/duo-buildroot-sdk/build/scripts/.py

在按照官方文档编译uboot时出现问题

在编译官方uboot时执行build_uboot报错
https://doc.sophgo.com/cvitek-develop-docs/master/docs_latest_release/CV180x_CV181x/zh/01.software/OSDRV/U-boot_Porting_Development_Guide/build/html/3_U-boot_Transplant.html
duo-buildroot-sdk/u-boot-2021.10/arch/riscv/cpu/mtrap.S: Assembler messages: duo-buildroot-sdk/u-boot-2021.10/arch/riscv/cpu/mtrap.S:65: Error: unrecognized opcodecsrr a0,scause', extension zicsr' required
我以前遇到过这个错误,显示缺少zicsr模块,无法使特权指令,但是当我用自己的riscv64-unknown-elf-gcc和riscv64-unknown-linux-musl-gcc编译我自己写的一个简单的测试c文件时却显示没有问题,我的测试C文件如下
`
// test.c
int main(int argc, char *argv[])
{
asm volatile ("csrr t0, misa");
return 0;
}

`

make: *** [Makefile:605: br-rootfs-pack] Error 2

2024-03-09T20:23:57 >>> linux-firmware 20201022 Installing to images directory
2024-03-09T20:23:58 >>> subversion 1.14.1 Installing to target
Done in 14min 01s (error code: 2)
make: *** [Makefile:605: br-rootfs-pack] Error 2
Error: Build board milkv-duo failed!
root@74ef18797463:/home/work#

LANGAGES

Hi,
Why not include LUA or a BASIC like GAMBAS.

Best regards
Georges

编译img镜像,在ld链接时出现collect2: error: ld returned 1 exit status并蹦出,(CVI_VB_Exit)

环境信息

  • OS: Endeavouros(Arch-Linux)
  • SDK: 最新

复现步骤

由于是Arch,所以我尽量跟着sdk中需要的库和环境在Pacman和yay中进行安装。

#执行命令 ./build_milkv.sh

等待链接ld链接时出现:

123

好像是在link中middleware/v2/sample/venc的时候蹦出来的。

1234

最后终端弹出collect2: error: ld returned 1 exit status,然后编译就终止蹦出来了,我该怎么办。:sob:,求指点是缺少什么库吗?

等待开发者的回信ing................

Mounting DATA partition Error

Hello.
I meet issue when Mounting DATA partition. Please help

Log: kernel boot error.log
Mounting DATA partition
[ 3.117185] ubi3: attaching mtd7
[ 3.124463] ubi3 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 6:0, read only 0 bytes, retry
[ 3.136230] ubi3 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 6:0, read only 0 bytes, retry
[ 3.148351] ubi3 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 6:0, read only 0 bytes, retry
[ 3.160337] ubi3 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 6:0, read 0 bytes
[ 3.170804] CPU: 0 PID: 153 Comm: ubiattach Not tainted 5.10.4-tag- #1
[ 3.177831] Call Trace:
[ 3.180662] [] walk_stackframe+0x0/0x6c
[ 3.186546] [] ubi_io_read+0x1ea/0x2c6
[ 3.192344] [] ubi_io_read_ec_hdr+0x8a/0x24e
[ 3.198679] [] ubi_attach+0x2bc/0xefa
[ 3.204393] [] __vmalloc_node_range+0xf8/0x17a
[ 3.210905] [] ubi_attach_mtd_dev+0x78c/0xb18
[ 3.217327] [] ctrl_cdev_ioctl+0xbc/0x19c
[ 3.223397] [] ioctl_file_clone+0x7c/0x80
[ 3.229464] [] vfs_ioctl+0xc/0x22
[ 3.234808] [] ioctl_file_clone+0x7c/0x80
[ 3.240869] [] sys_ioctl+0xae/0x538
[ 3.246396] [] ioctl_file_clone+0x7c/0x80
[ 3.252470] [] check_syscall_nr+0x1e/0x22
[ 3.258529] UBI assert failed in ubi_io_read at 190 (pid 153)
[ 3.264757] CPU: 0 PID: 153 Comm: ubiattach Not tainted 5.10.4-tag- #1
[ 3.271784] Call Trace:
[ 3.274340] [] walk_stackframe+0x0/0x6c
[ 3.280328] [] ubi_io_read+0x220/0x2c6
[ 3.286127] [] ubi_io_read_ec_hdr+0x8a/0x24e
[ 3.292464] [] ubi_attach+0x2bc/0xefa
[ 3.298172] [] __vmalloc_node_range+0xf8/0x17a
[ 3.304687] [] ubi_attach_mtd_dev+0x78c/0xb18
[ 3.311148] [] ctrl_cdev_ioctl+0xbc/0x19c
[ 3.317246] [] ioctl_file_clone+0x7c/0x80
[ 3.323348] [] vfs_ioctl+0xc/0x22
[ 3.328703] [] ioctl_file_clone+0x7c/0x80
[ 3.334769] [] sys_ioctl+0xae/0x538
[ 3.340300] [] ioctl_file_clone+0x7c/0x80
[ 3.346366] [] check_syscall_nr+0x1e/0x22
[ 3.352450] ubi3 error: ubi_attach_mtd_dev: failed to attach mtd7, error -5
ubiattach: error!: cannot attach mtd7
error 5 (I/O error)
ubiformat: mtd7 (nand), size 5505024 bytes (5.2 MiB), 42 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 6 -- 16 % complete

no RNDIS on win10

When I connected to duo using Windows 10, the RNDIS device was not displayed

image

no RNDIS on milkv duo 64MB Ram

Hello,

I have installed the img version 1.0.7 for my device, I can access the board over serial, I can also see the defaul ip adress, but I do not have any RNDIS connection under my Ubuntu dmesg.

Regards,
Alexandru

拉取代码失败

Checking connectivity: 127057, done.
error: invalid path 'buildroot-2021.05/dl/musl-compat-headers/queue.h?rev=1.70'
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

Using opkg starting to create a repo with all packages in buildroot, or alternative distributions

I have been using buildroot now quite often to fine-tune my disk image to deploy, and I realized it would be more efficient to provide a repo with precompiled packages and add and remove those individually, instead to run make menuconfig and all those steps.

  • opkg: my first thought would be to pseudo select a single package, build it, and then make a snapshot of output/milkv_duo_musl_riscv64/target/ and feed the "new" files into .ipkg, then clean up output/milkv.../target/ again, repeat with next package - based on how making ipkg
  • Debian/riscv64 and try to get apt/aptitude/dpkg work with low memory usage
  • Fedora/riscv64, see this repo: https://github.com/chainsx/fedora-riscv-builder first steps taken, perhaps rpm package could be used directly?

Any thoughts & comments welcome.

serial bootloader scripts results in CRC errors

i try to use the serial boot ROM to speed up u-boot development.

however, i'm not able to download the /fsbl/build/cv1800b_milkv_duo_sd/fip.bin file by using python3 cv181x_dl.py --serial --image_dir duo-buildroot-sdk/fsbl/build/cv1800b_milkv_duo_sd/fip.bin

i modified the VID:PID parameters to match my USB2UART bridge controllers. however, i allways get CRC errors using the scripts

INFO: Using serial
INFO: CV181X USB download start

fip_path: duo-buildroot-sdk/fsbl/build/cv1800b_milkv_duo_sd/fip.bin/fip.bin
CV181X USB download start
Connecting to ROM
/dev/ttyUSB0USB port:  \    
USB VID:PID=10C4:EA60 SER=0001 LOCATION=1-1.3.2

done
Send cv_dl_magic.bin...
ACK_CRC_ERROR cmd_crc 9b8; ret_crc 2e43
ACK_CRC_ERROR cmd_crc 9b8; ret_crc 504c
ACK_CRC_ERROR cmd_crc 9b8; ret_crc 5053
ACK_CRC_ERROR cmd_crc 9b8; ret_crc 3120
ACK_CRC_ERROR cmd_crc 9b8; ret_crc 6f61
ACK_CRC_ERROR cmd_crc 9b8; ret_crc d0a
ACK_CRC_ERROR cmd_crc 9b8; ret_crc 616d
ACK_CRC_ERROR cmd_crc 9b8; ret_crc 3a6c
ACK_CRC_ERROR cmd_crc 9b8; ret_crc 3829
ACK_CRC_ERROR cmd_crc 9b8; ret_crc 6172
ACK_CRC_ERROR cmd_crc 9b8; ret_crc 2045
ACK_CRC_ERROR cmd_crc 9b8; ret_crc 2d37
ACK_CRC_ERROR cmd_crc 9b8; ret_crc 2070

i tried this with the Silicon Labs CP210x UART Bridge (CR2102) found on an ESP32 as well as with an standalone FTDI FT232RL.

hope someone can help since the offical documentation (e.g. CvitekBareandNon-BareChipBurningUpgradeOperationGuide_en.pdf) doesn't provide useful information about this topic..

thx

pre-up ifconfig eth0 hw ether .... Not providing persistent MAC Address on IO Board

I have followed the directions for providing a fixed MAC Address when using the IO Board modifying /etc/network/interfaces and adding:

[02:00 milkv-duo:~] # cat /etc/network/interfaces
# interface file auto-generated by buildroot

auto lo
iface lo inet loopback

# added persistent hardware ethernet MAC
pre-up ifconfig eth0 hw 72:a2:bb:83:cf:12

And I've configured dhcpd.conf to send hostname so the server can update the local DNS with forward and reverse mapping for the IP address handed out to the duo. However, on reboot, the MAC address is different resulting in a different address being assigned each time.

With /etc/network/interfaces as shown above, the local dhcp server sees:

Jan 14 19:18:40 valkyrie dhcpd[810]: DHCPOFFER on 192.168.6.164 to 16:a7:65:c0:63:f3 (milkv-duo) via enp5s0
Jan 14 19:18:40 valkyrie dhcpd[810]: DHCPREQUEST for 192.168.6.164 (192.168.6.14) from 16:a7:65:c0:63:f3 (milkv-duo) via enp5s0
Jan 14 19:18:40 valkyrie dhcpd[810]: DHCPACK on 192.168.6.164 to 16:a7:65:c0:63:f3 (milkv-duo) via enp5s0

So despite having pre-up ifconfig eth0 hw 72:a2:bb:83:cf:12 set in /etc/network/interfaces, the server sees the MAC Address of the duo as 16:a7:65:c0:63:f3.

Is there something else required to have the IO Board appear at a fixed MAC?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.