Build middleware failed ! when building

was trying to build v2, got this error anyone was able to fix this?

uo-buildroot-sdk-v2/cvi_mpi/modules/isp/cv181x/isp-daemon2/src/cvi_ispd2_callback_funcs_apps.c:2582:35: error: ‘pqtool_definition_json’ undeclared (first use in this function); did you mean ‘pqtool_definition_json_len’?
  memcpy(ptToolDefData->pu8Buffer, pqtool_definition_json, ptToolDefData->u32Size);
                                   ^~~~~~~~~~~~~~~~~~~~~~
                                   pqtool_definition_json_len
make[4]: *** [Makefile:60: tmp/cvi_ispd2_callback_funcs_apps.o] Error 1
make[4]: *** Waiting for unfinished jobs....
[aarch64-linux-gnu-gcc] cvi_ispd2_callback_funcs_apps_bin.o
[aarch64-linux-gnu-gcc] cvi_ispd2_callback_funcs_3a.o
[aarch64-linux-gnu-gcc] cvi_ispd2_callback_funcs_apps_rawreplay.o
make[4]: Leaving directory '/home/vamzi/Documents/duo/duo-buildroot-sdk-v2/cvi_mpi/modules/isp/cv181x/isp-daemon2'
make[4]: Entering directory '/home/vamzi/Documents/duo/duo-buildroot-sdk-v2/cvi_mpi/modules/isp/cv181x/isp-daemon2'
cp: cannot stat 'build/libcvi_ispd2.a': No such file or directory
make[4]: *** [Makefile:92: install] Error 1
make[4]: Leaving directory '/home/vamzi/Documents/duo/duo-buildroot-sdk-v2/cvi_mpi/modules/isp/cv181x/isp-daemon2'
make[3]: *** [Makefile:14: all] Error 2
make[3]: Leaving directory '/home/vamzi/Documents/duo/duo-buildroot-sdk-v2/cvi_mpi/modules/isp/cv181x'
make[2]: *** [Makefile:9: all] Error 1
make[2]: Leaving directory '/home/vamzi/Documents/duo/duo-buildroot-sdk-v2/cvi_mpi/modules/isp'
make[1]: *** [Makefile:17: all] Error 1
make[1]: Leaving directory '/home/vamzi/Documents/duo/duo-buildroot-sdk-v2/cvi_mpi/modules'
make: *** [Makefile:12: module] Error 2
 build middleware failed !! 
~/Documents/duo/duo-buildroot-sdk-v2/build
Error: Build board milkv-duo256m-glibc-arm64-sd failed!

anyone was able to build v2?

1 Like

Unfortunately that’s not the only point of failure in the Makefile as it won’t build even if you removed all the middleware and example files it still fails down the road. So far I’ve made it through 600 lines of the 700 line Makefile and as soon as I resolve one culprit another pops up 5 lines down breaking the build process…

1 Like

What’s the environment? What distro, which version?

I’ve had no trouble building SDK V2. I’m building on Fedora 40 using the docker image and procedures described on the Milk-V website. I did initially have a few glitches when trying to use an old docker image from last year, but updating to the latest helped.

1 Like

ARM or RISC-V? I’m having trouble with ARM.

1 Like

RISC-V on Duo. Haven’t tried ARM yet.

1 Like

Yes, RISC-V version builds without issue

1 Like

That’s what I just built:

milkv-duo256m-glibc-arm64-sd_2025-030x-xxxx.img
milkv-duo256m-musl-riscv64-sd_2025-030x-xxxx.img

milkv-duo-musl-riscv64-sd_2025-030x-xxxx.img

milkv-duos-glibc-arm64-sd_2025-030x-xxxx.img
milkv-duos-musl-riscv64-sd_2025-030x-xxxx.img

Took some time, of course, that’s why I respond this late.

Branch: develop
Commit: 9d2aba44ee2f73b528b82ee81dc131805cb9f97c

What environment did you build it on? Was it the Docker container?

1 Like

Ubuntu 22.04.5 LTS, x86_64. Mentioned here.

Pop!_OS 22.04 LTS,
on my pc had this error, and tried building the same on my laptop running the same os, the build went through(arm64 version) but it doesnt boot on duo 256,
then again i tried flashing the official github release milkv-duo256m-glibc-arm64-sd_v2.0.0.img
and even that doesnt boot, no blue light heartbeat, or no usb activity when i connect it directly to the laptop,
ubuntu version of riscv is booting fine and i installed a torrent client(qbittorrent nox) its able to download movies at 5 MBps and i am able to stream videos locally :slight_smile: but its risc v, so filebrowser isnt working.
any one has a working arm64 version booted and working on milkv duo 256 boards?

Duo 256M and Duo S should be switched to ARM mode by shorting special pin.

On Duo S board, they implemented a convenient RISC-V/ARM mode switch, while on Duo 256M board you have to short pin 35 to ground.

thanks i knew about duo s, i tested both arm and risc oss, thanks for letting me know.
are there any resources on how to build debian/ubuntu for arm64 version for duo 256?

1 Like

I found the problem. xxd is missing.

apt install xxd

2 Likes

I also had to do this on Ubuntu 22.04:
ln -s /usr/bin/python3 /usr/bin/python

We need an up to date base Docker image, that’s built by github with every new commit.

1 Like

Think you can find this useful:

$ apt-cache show python-is-python3 python-dev-is-python3

Yes - I had to do that python link when I tried to use last year’s docker image to run SDK V2. If you remove the old docker image and grab the latest one then you won’t need to do that though.

Use these commands:

  1. to list the docker images you’ve got installed:
    sudo docker image list

  2. to remove a docker image:
    sudo docker image rm -f

I removed the images “ubuntu” and “milkvtech/milkv-duo”, then re-ran:

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

which grabbed the latest required images.

1 Like