Build OpenMV from source...

Discussion related to "under the hood" OpenMV topics.
User avatar
jiapei100
Posts: 33
Joined: Fri Oct 14, 2016 7:07 pm
Contact:

Build OpenMV from source...

Postby jiapei100 » Tue Sep 11, 2018 7:40 pm

Please refer to 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 http://docs.openmv.io/library/index.html, including:
    1. ) MicroPython-specific libraries:
      - machine
      - network
    2. ) Libraries specific to the OpenMV Cam
      - pyb
      - time
      - sensor
      - image
      - nn
      - gif
      - mjpeg
      - lcd
      - fir
      -omv
  2. . I realize I need to build openmv from source, together with micropython. I strictly follow
    Linux Installation at https://github.com/openmv/openmv/wiki.

    It seems Makefiles 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?

    Code: Select all

    git checkout openmv
    There is NO openmv branch at all under micropython ....

Can you please help?

Cheers
Pei
Welcome to Longer Vision
http://www.longervision.ca
User avatar
kwagyeman
Posts: 2448
Joined: Sun May 24, 2015 2:10 pm

Re: Build OpenMV from source...

Postby kwagyeman » Tue Sep 11, 2018 8:00 pm

Git clone --recursive <repo url>
Nyamekye,
User avatar
jiapei100
Posts: 33
Joined: Fri Oct 14, 2016 7:07 pm
Contact:

Re: Build OpenMV from source...

Postby jiapei100 » Tue Sep 11, 2018 9:02 pm

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
Welcome to Longer Vision
http://www.longervision.ca
User avatar
kwagyeman
Posts: 2448
Joined: Sun May 24, 2015 2:10 pm

Re: Build OpenMV from source...

Postby kwagyeman » Tue Sep 11, 2018 9:14 pm

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.
Nyamekye,
User avatar
jiapei100
Posts: 33
Joined: Fri Oct 14, 2016 7:07 pm
Contact:

Re: Build OpenMV from source...

Postby jiapei100 » Tue Sep 11, 2018 9:31 pm

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 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
Welcome to Longer Vision
http://www.longervision.ca
User avatar
kwagyeman
Posts: 2448
Joined: Sun May 24, 2015 2:10 pm

Re: Build OpenMV from source...

Postby kwagyeman » Tue Sep 11, 2018 10:15 pm

Ibrahim may have some thoughts. He uses GDB with a STLink tool.
Nyamekye,
User avatar
iabdalkader
Posts: 624
Joined: Sun May 24, 2015 3:53 pm

Re: Build OpenMV from source...

Postby iabdalkader » Wed Sep 12, 2018 6:34 am

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.
User avatar
jiapei100
Posts: 33
Joined: Fri Oct 14, 2016 7:07 pm
Contact:

Re: Build OpenMV from source...

Postby jiapei100 » Wed Sep 12, 2018 6:13 pm

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:

Code: Select all

$ 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 ???
Welcome to Longer Vision
http://www.longervision.ca
User avatar
kwagyeman
Posts: 2448
Joined: Sun May 24, 2015 2:10 pm

Re: Build OpenMV from source...

Postby kwagyeman » Wed Sep 12, 2018 6:42 pm

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.
Nyamekye,

Return to “Technical Discussion”

Who is online

Users browsing this forum: chrisPyres66 and 6 guests