makefile for omv

Discussion related to "under the hood" OpenMV topics.
calvinmryan
Posts: 23
Joined: Tue Jan 30, 2018 11:05 am
Location: Boston, MA

makefile for omv

Postby calvinmryan » Mon Mar 12, 2018 4:53 pm

Hi,

I'm trying to make small changes to the OPENMV3 fw bundle. I've tried using virtualbox and can't get linux to run well enough to even install qt editor. I also don't want to pay for parallels or vmware. SO, I'm now trying to just compile using the makefile in the /src/omv folder. However, I keep getting basic errors such as:

p /img
make: p: No such file or directory
make: [/img] Error 1 (ignored)
p /py
make: p: No such file or directory
make: [/py] Error 1 (ignored)
"CC main.c"
/bin/sh: CC main.c: command not found
make: *** [/main.o] Error 127

I've tried mimicking the makefile in /src which gives a filepath to arm-none-eabi-xxx for commands such as CC and AS, but that doesn't seem to help.

I'm somewhat new to building C using a makefile, although I have done this before. That said, it was a "it just works" kind of deal in the past because it was done during labs in college. Here, I'm not sure if the makefile that's included is even complete or intended to be used.

Let me know if there i'm making obvious errors or if you have any suggested reading or next steps.
User avatar
kwagyeman
Posts: 2198
Joined: Sun May 24, 2015 2:10 pm

Re: makefile for omv

Postby kwagyeman » Mon Mar 12, 2018 5:08 pm

Hi, the make file just works when you follow how to build our code here: https://github.com/openmv/openmv/wiki

You don't have to pay for VMware player. It's free (VMware player workstation is not free though).
Nyamekye,
User avatar
kwagyeman
Posts: 2198
Joined: Sun May 24, 2015 2:10 pm

Re: makefile for omv

Postby kwagyeman » Mon Mar 12, 2018 5:09 pm

Oh, are you on a Mac?
Nyamekye,
calvinmryan
Posts: 23
Joined: Tue Jan 30, 2018 11:05 am
Location: Boston, MA

Re: makefile for omv

Postby calvinmryan » Tue Mar 13, 2018 5:44 pm

Hi,

Yes, I am on mac. I noted that the make target needs to be OPENMV3, but I tried that and it didn't work. I tried installing qt editor for Mac, and set things up the same way but that didn't work either.... Isn't qt editor simply calling 'make target=openmv3' ? Or is it doing something more?...

Thanks!
User avatar
kwagyeman
Posts: 2198
Joined: Sun May 24, 2015 2:10 pm

Re: makefile for omv

Postby kwagyeman » Tue Mar 13, 2018 7:49 pm

The make command you specified above is all you need it to do. It should just work.

Um, do you have spaces in your path?
Nyamekye,
calvinmryan
Posts: 23
Joined: Tue Jan 30, 2018 11:05 am
Location: Boston, MA

Re: makefile for omv

Postby calvinmryan » Thu Mar 15, 2018 3:05 pm

What do you mean by 'spaces in your path'?
calvinmryan
Posts: 23
Joined: Tue Jan 30, 2018 11:05 am
Location: Boston, MA

Re: makefile for omv

Postby calvinmryan » Thu Mar 15, 2018 3:29 pm

Hi,

So I can get the makefile to compile everything after I remove the line: $(MAKE) -C $(MICROPY_DIR)/ports/stm32 BUILD=$(BUILD)/$(MICROPY_DIR) BOARD=$(TARGET) QSTR_DEFS=$(OMV_QSTR_DEFS)

It seems that the directory ....../micropython/ports/stm32 is not included in the git repo. As I'm not changing these files I'm going to try loading the FW that has been compiled without this line onto a board to see if it works.

Let me know if you can supply the /micropython/ports/stm32 directory. Thanks!

Yours,

Calvin Ryan
calvinmryan
Posts: 23
Joined: Tue Jan 30, 2018 11:05 am
Location: Boston, MA

Re: makefile for omv

Postby calvinmryan » Thu Mar 15, 2018 3:48 pm

I am now running into the issue that mpconfigport.h is not included at the filepath /src/micropython/py/


The error is as follows:
In file included from /Users/calvinryan/Documents/mv_compile_test/openmv/src/micropython/py/nlr.h:36:0,
from src/nm_bsp.c:6:
/Users/calvinryan/Documents/mv_compile_test/openmv/src/micropython/py/mpconfig.h:45:10: fatal error: mpconfigport.h: No such file or directory
#include <mpconfigport.h>
^~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [/Users/calvinryan/Documents/mv_compile_test/openmv/src/build/winc1500/src/nm_bsp.o] Error 1
make: *** [FIRMWARE_OBJS] Error 2

Where can I get this file?
calvinmryan
Posts: 23
Joined: Tue Jan 30, 2018 11:05 am
Location: Boston, MA

Re: makefile for omv

Postby calvinmryan » Thu Mar 15, 2018 3:52 pm

I see now that mpconfigport.h is used to configure a certain port. Not sure what exactly that entails. How can I make one of these files myself? What kind of information and formatting should it have?
User avatar
kwagyeman
Posts: 2198
Joined: Sun May 24, 2015 2:10 pm

Re: makefile for omv

Postby kwagyeman » Thu Mar 15, 2018 5:53 pm

Hi, that new directory is a git submodule. You have to also download it now. Google git submodule is you aren't familiar with what these are.
Nyamekye,
calvinmryan
Posts: 23
Joined: Tue Jan 30, 2018 11:05 am
Location: Boston, MA

Re: makefile for omv

Postby calvinmryan » Mon Mar 19, 2018 9:26 am

Hi,

I think I have make actually running with the micropython submodule cloned as well. But at this point i'm getting errors in files like py_helper.c such as undeclared variables. I'm thinking that rather than go through these I want to just build off of the last stable build of openmv firmware. At what commit did you guys compile the latest (fw 2.7.0?) firmware bundle? Do you agree that this will be the simplest way for me to go forward?
User avatar
kwagyeman
Posts: 2198
Joined: Sun May 24, 2015 2:10 pm

Re: makefile for omv

Postby kwagyeman » Mon Mar 19, 2018 11:11 pm

All commits compile. Weird. Um, this is the latest stable version:

https://github.com/openmv/openmv/commit ... d5d91825e4
Nyamekye,

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 5 guests