linux compilation failed, collect2: error: ld returned 1 exit status


I followed the compilation guidance file. Why is it like this and how can I solve it?

Looks like Micro Python is missing. Did you recursively clone and then also build the mpy-cross?


yes,I execute the commands in the following order:
1,git clone --recursive GitHub - openmv/openmv: OpenMV Camera Module
2,cd openmv
3,make -j$(nproc) -C lib/micropython/mpy-cross # Builds Micropython mpy cross-compiler
4,make -j$(nproc) TARGET=<TRAGET_NAME> # Builds the OpenMV firmware
but micropython compilation was successful.I have tried compiling with different versions(v12.2, v13.2, v14.3) of arm-none-eabi-gcc, but none of them worked.
I have reviewed the source code of micropython and there is no phenomenon of undefined references.
May I ask where the problem might lie?

I don’t know. I can’t reproduce the error you have. It can literally be anything if your environment is set up wrong. You have to debug it.

We can point you to our CI, though. When I have build issues… following it is the best approach to resolving what is wrong.

and

This is everything you need for a reproducible build: openmv/tools/ci.sh at master · openmv/openmv · GitHub

I would check the build log if a command errored out during the build process. It’s not impossible for parts to keep going even when an earlier step failed.

I checked the historical question records of this forum, identified the cause and resolved it. The problem was with the version of the make tool. I was using version v4.3, while yours was v4.4.1. After I replaced mine with your version, the compilation was successful.
However, a new problem emerged. I burned the openmv.bin firmware to the official OpenMV4P board via the DFU method. When I powered it on again, the breathing light flashed green normally. But when I tried to connect it to OpenMV IDE, an error popped up: “Timeout error when retrieving firmware version!”
May I ask where I went wrong?

You need to install the latest IDE: Download – OpenMV

Firmware v5.0.0 requires it as there’s a new USB protocol.

I really appreciate your help with solving this problem.