OpenCV on STM32
This section describes some experimental stuff, so there are chances that something doesn't work as expected. Feel free to create new issues, we'll try to figure it out.
Currently OpenCV works with STM32F746GDISCOVERY and STM32F769IDISCOVERY.
Following examples describe how to run example Canny filter to detect edges (source code is project/opencv/cmds/edges.cpp
in Embox).
This board has enough flash memory for OpenCV, so it's pretty easy to run a simple example:
- Compile this template (it requires a few minutes as it builds libstdc++ and opencv from source)
make confload-project/opencv/stm32f769i-discovery
make
-
Load Embox with openocd (more details on another wiki page)
-
Run
edges fruits.png 20
on Embox console
This board has only 1MiB flash memory, so it's a little bit more compilated. OpenCV requires too much read-only memory (it's mostly code), so you have to use QSPI flash to run it.
Brief instruction:
- Compile this template:
make confload-project/opencv/stm32f764g-discovery
make
- Extract readonly sections from ELF
arm-none-eabi-objcopy -O binary build/base/bin/embox tmp.bin \
--only-section=.text --only-section=.rodata \
--only-section='.ARM.ex*' \
--only-section=.data
-
Now load
tmp.bin
to QSPI memory. Refer to https://github.com/embox/embox/wiki/STM32F7DISCOVERY#loading-files-to-qspi for more details -
Use
goto
command, jump to target memory address. Target address is a second 32-bit word of the binary image (you can find it out withmem 0x90000004
). For example,
embox>mem 0x90000004
0x90000004: 0x9001f393 0x9001f389 0x9001f389 0x9001f389
embox>goto -i 0x9001f393
- Run
edges fruits.png 20
on Embox console
- Embox on QEMU emulator
- ARM
- AARCH64
- x86
- MIPS
- RISC-V
- PowerPC
- DLX (Microblaze)
- SPARC
- Porting to a new architecture
- Audio
- FPGA
- FS
- Graphics
- NET
- USB
- iec61850
- C Plus Plus
- GY 30 I2C light sensor on STM32
- Emdocker
- Emdocker on MAC
- Xen port workflow
- Troubleshooting
- QEMU with GRUB2 and Syslinux
- LKL subsystem