Skip to content

OpenCV on STM32

Denis Deryugin edited this page Aug 1, 2019 · 11 revisions

Running OpenCV on STM32F7Discovery

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 platform/opencv/cmds/edges.cpp in Embox).


This board has enough flash memory for OpenCV, so it's pretty easy to run a simple example:

  1. Compile this template (it requires a few minutes as it builds libstdc++ and opencv from source)
 	make confload-platform/opencv/stm32f769i-discovery
  1. Load Embox with openocd (more details on another wiki page)

  2. Run edges 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:

  1. Compile this template:
 	make confload-platform/opencv/stm32f764g-discovery
  1. 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*' \
  1. Now load tmp.bin to QSPI memory. Refer to for more details

  2. 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 with mem -a 0x90000004).

  3. Run edges 20 on Embox console

Clone this wiki locally
You can’t perform that action at this time.