opencv for MCU's using MBOX

28 views
Skip to first unread message

Gudimetla Kowshik

unread,
May 25, 2023, 9:14:47 AM5/25/23
to embox-devel
Hi team,

I have been trying to cross-compile opencv for the Cortex-r5 cores using gcc-arm-none-eabi-10.3-2021.10 and I got stuck at the compilation where the error is 

/home/kowshik/Desktop/opencv_porting/opencv/modules/core/src/precomp.hpp:369:5: error: 'Mutex' in namespace 'cv' does not name a type 369 | cv::Mutex& getInitializationMutex(); | ^~~~~

After digging for a while I got to know this is purely an issue with the compiler not supporting threads. I came across that embox was somehow able to run the opencv on STM32 and I'm curious how I can solve this issue easily,

Thanks,
G Kowshik

Gudimetla Kowshik

unread,
May 25, 2023, 9:22:34 AM5/25/23
to embox-devel
To add more info, if everything goes successful ,the target on which this is going to run is a Texas Instrument's AM273x (multicore R5 @400MHz and C66x DSP @450MHz core MCU). I want to get this compiled properly with the opencv module. 
If there is any flavour of opencv with embox integrated, I'd be glad to take a look and re-use to my platform. Any help here is appeciated.

Thanks in advance.

Gudimetla Kowshik

unread,
May 26, 2023, 2:56:30 PM5/26/23
to embox-devel

Hi anton,

Any suggestions on this please?

Thanks

Anton Bondarev

unread,
May 27, 2023, 7:25:41 AM5/27/23
to embox...@googlegroups.com
Hi G Kowshik,

Yes, it's known the problem. you can't use gcc-arm-none-eabi- OpenCV requires full C++ support (at least c++14 I think) which includes theads primitives std::thread std::mutex etc. Embox suggests the own environment including POSIX standard C library (with pthreads) . We also use C++ standard library from gcc. In other words during the building we prepare "full OS" gcc (arm-none-eabi-gcc + required libraries). It seems it is the only way (using OS specific gcc) to build OpenCV.

As Embox + OpenCV: There are a few ready-to-use templates including STM32 with cotrex-m MCUs (see https://github.com/embox/opencv_samples)  Embox has no support for AM273x. However in my mind porting to it is the simplest way to run OpenCV on this platform.

Best regards,
Anton Bondarev

пт, 26 мая 2023 г. в 21:56, Gudimetla Kowshik <kowsh...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "embox-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to embox-devel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/embox-devel/c6b709f8-b520-49cb-acb4-0c479e478af1n%40googlegroups.com.

Gudimetla Kowshik

unread,
May 27, 2023, 7:45:41 AM5/27/23
to embox...@googlegroups.com
Hi Anton 

Thanks for the reply. Please see my queries below,

1. Is there a way I can only use the stdlibc++ and not use the entire Embox ecosystem. This way I don't have to deviate much from using standalone opencv and use the same arm-none-eabi-gcc and just link your specially build lib with posix support? 

2. What's the easiest way to modify the existing templates in Embox to change and add my own compiler flags. I'm asking about which file should I edit to add -mcpu, -mfloat-abi, etc., Because my MCU's architecture is not cortex-m but cortex-r. 

Thanks

Anton Bondarev

unread,
May 27, 2023, 7:46:03 AM5/27/23
to embox...@googlegroups.com
G Kowshik

    I have gone through embox source code and I managed to build the arm-quemu opencv project. However, I want to customize the build for example I wanna know for what -mcpu or architecture the example is build for? What if I want to change the architecture to Cortex-R5? Which flags to change?


The compilers flags are set in build.conf (conf/build.conf) file. However you should start with porting Embox to your platform

Feel free to ask any questions

Best regards,
Anton

сб, 27 мая 2023 г. в 14:25, Anton Bondarev <anton.bon...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages