# Build OpenMV from source...

**URL:** https://forums.openmv.io/t/build-openmv-from-source/891
**Category:** OpenMV Boards
**Created:** [September 11, 2018, 11:40pm UTC](https://forums.openmv.io/t/build-openmv-from-source/891 "2018-09-11T23:40:38Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![jiapei100](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/jiapei100/32/14_2.png) [@jiapei100](https://forums.openmv.io/u/jiapei100)
#### Post date: [September 11, 2018, 11:40pm UTC](https://forums.openmv.io/t/build-openmv-from-source/891/1 "2018-09-11T23:40:38Z")

</div>

Please refer to [Failed to build openmv from source... · Issue #373 · openmv/openmv · GitHub](https://github.com/openmv/openmv/issues/373)  
  
  
  
  
My working environment:

**Ubuntu** : 18.04.1  
**GCC** : gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0  
**arm-none-eabi-gcc** : arm-none-eabi-gcc (GNU MCU Eclipse ARM Embedded GCC, 64-bit) 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907]  
**openmv** : (git of September 11, 2018)  
**micropython** : (git of September 11, 2018)

1. . I can successfully build **micropython/ports/unix** and have it run on my laptop. However, I don’t have some of the packages from [MicroPython libraries — MicroPython 1.20 documentation](http://docs.openmv.io/library/index.html), including:
2. ) MicroPython-specific libraries:

- machine
- network  
2. ) Libraries specific to the OpenMV Cam
- pyb
- time
- sensor
- image
- nn
- gif
- mjpeg
- lcd
- fir  
-omv

1. . I realize I need to build **openmv** from source, together with **micropython**. I strictly follow  
**Linux Installation** at [Home · openmv/openmv Wiki · GitHub](https://github.com/openmv/openmv/wiki).

It seems **Makefile** s for building **openmv** are all for **ports/stm32**. Therefore, I met the following **ERROR** messages (even if with **arm-none-eabi-gcc** installed):

> make[1]: Entering directory ‘…/openmv/src/micropython/ports/stm32’  
> Makefile:11: \*\*\* Invalid BOARD specified: boards/OPENMV3. Stop.  
> make[1]: Leaving directory ‘…/openmv/src/micropython/ports/stm32’  
> Makefile:428: recipe for target ‘FIRMWARE\_OBJS’ failed  
> make: \*\*\* [FIRMWARE\_OBJS] Error 2

Just wonder how to build **openmv** together with **micropython** from source? In other words, how to build **micropython** with the supported board **openmv**?  
  
  
It looks like it’s just a directory problem?

```python
git checkout openmv

```

There is **NO** openmv branch at all under **micropython** …

Can you please help?

Cheers  
Pei

---

<div class="post-metadata">

### Author: ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)
#### Post date: [September 12, 2018, 12:00am UTC](https://forums.openmv.io/t/build-openmv-from-source/891/2 "2018-09-12T00:00:38Z")

</div>

Git clone --recursive

---

<div class="post-metadata">

### Author: ![jiapei100](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/jiapei100/32/14_2.png) [@jiapei100](https://forums.openmv.io/u/jiapei100)
#### Post date: [September 12, 2018, 1:02am UTC](https://forums.openmv.io/t/build-openmv-from-source/891/3 "2018-09-12T01:02:41Z")

</div>

Now successfully built…  
But, it seems there is **NO**  **EXE**  **micropython** built?  
Which **EXE** that I need to run?  
Or, it has to be run **from within OpenMV-IDE**?

Cheers  
Pei

---

<div class="post-metadata">

### Author: ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)
#### Post date: [September 12, 2018, 1:14am UTC](https://forums.openmv.io/t/build-openmv-from-source/891/4 "2018-09-12T01:14:23Z")

</div>

It outputs a binary file. The binary file has to be loaded on the OpenMV Cam using openmv-ide. You’ll notice the openmv/firmware/OPENMV3 binary files were updated when you built. That’s the result of the compile process.

---

<div class="post-metadata">

### Author: ![jiapei100](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/jiapei100/32/14_2.png) [@jiapei100](https://forums.openmv.io/u/jiapei100)
#### Post date: [September 12, 2018, 1:31am UTC](https://forums.openmv.io/t/build-openmv-from-source/891/5 "2018-09-12T01:31:28Z")

</div>

In fact, the reason why I’m asking this question is: I want to **DEBUG** my code based on **OpenMV** libraries…  
It looks to me that **OpenMV-IDE** does **NOT** provide a **DEBUG** environment ???  
I was wondering if there is any other **IDEs** or **just console command** for me to debug **OpenMV**? Particularly with a simulator like **QEMU**?

I’m pretty sure I can run **micropython** , but only a few number of **Python standard libraries and micro-libraries** are supported from [MicroPython libraries — MicroPython 1.15 documentation](http://docs.openmv.io/library/index.html). As enumerated already, other libraries are of course **NOT** supported by **micropython** , including **2 MicroPython-specific libraries** and **all Libraries specific to the OpenMV Cam**.

I’m **NOT** actually burn/flash the built/updated **OpenMV firmware** into the board, but just want to debug the code with the **micropython environment(some fundamental libraries) with supporting board OpenMV (some extra libraries)**.

Is there a way to do that?  
  
  
Cheers  
Pei

---

<div class="post-metadata">

### Author: ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)
#### Post date: [September 12, 2018, 2:15am UTC](https://forums.openmv.io/t/build-openmv-from-source/891/6 "2018-09-12T02:15:15Z")

</div>

Ibrahim may have some thoughts. He uses GDB with a STLink tool.

---

<div class="post-metadata">

### Author: ![iabdalkader](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/iabdalkader/32/1169_2.png) [@iabdalkader](https://forums.openmv.io/u/iabdalkader)
#### Post date: [September 12, 2018, 10:34am UTC](https://forums.openmv.io/t/build-openmv-from-source/891/7 "2018-09-12T10:34:12Z")

</div>

Do you mean debug Python scripts ? I don’t know of any tools for debugging MicroPython, if you mean debug the firmware I use stlink v2 + stutil + gdb.

---

<div class="post-metadata">

### Author: ![jiapei100](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/jiapei100/32/14_2.png) [@jiapei100](https://forums.openmv.io/u/jiapei100)
#### Post date: [September 12, 2018, 10:13pm UTC](https://forums.openmv.io/t/build-openmv-from-source/891/8 "2018-09-12T22:13:20Z")

</div>

I’m thinking to either **debug** or **run** test.py with both **MicroPython** and **OpenMV** support, but **NOT** the general **python3** support.

I mean: I prefer type some command lines like:

```python
$ micropython
>>>import xxxxx

```

And so far, it works for **MicroPython**. However, that is **MicroPython** ONLY, and of course, I canNOT import libraries for **OpenMV**.  
The situation is: I can ONLY view the code via **OpenMV-IDE** , which does NOT have the functionality of debugging yet…

I’m NOT downloading any code down to the chip yet… I just want to simulate running the code by using **QEMU** , or at least, let me run the code in a **MicroPython** or **OpenMV** environment ???

---

<div class="post-metadata">

### Author: ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)
#### Post date: [September 12, 2018, 10:42pm UTC](https://forums.openmv.io/t/build-openmv-from-source/891/9 "2018-09-12T22:42:08Z")

</div>

I see what you want to do. Um, yeah, we don’t actually have support to do that. It would make debugging a lot easier to have built a PC environment but we did everything on the MCU.
