opencvesp32gcc-warningflannxtensa

esp32-opencv-master flann: error: insn does not satisfy its constraints:


I'm following this repository text to be able to use openCV on a ESP32-CAM. I am able to make it work with the default libraries (imgcodecs, imgproc & core), but when trying to add calib3d, I get the error on the title, referencing the flann library. It should be possible to include calib3d, since in the repository is said that it has already been tested. The way I'm trying to add it, is by including de .hpp files and other folders on esp32/lib/opencv, just like the default libraries. After that, i change the file esp32/scripts/build_opencv_for_esp32.sh to also include calib3d.

In several places I've seen that it may be a problem with the dcc compiler, and that I should get a distribution of esp-idf that has a version of xtensa-esp32-elf-gcc that works for this code. However, I'm unable to find any that works. Do you know what could be the issue or a workaround?


Solution

  • insn does not satisfy its constraints

    This error message is incomplete, the information that follows is also important as it describes the specific instruction that triggers this issue.

    Do you know what could be the issue or a workaround?

    There's one known issue in the xtensa gcc with similar diagnostic: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98470 and one possible workaround for it is compiling the source that triggers it with the -fno-if-conversion option.