At first I got error after make:
make -C micropython/stmhal BUILD=/home/rokko/openmv/src/build/micropython BOARD=OPENMV2
make[1]: Entering directory `/home/rokko/openmv/src/micropython/stmhal'
Makefile:5: *** Invalid BOARD specified. Stop.
make[1]: Leaving directory `/home/rokko/openmv/src/micropython/stmhal'
make: *** [objs] Error 2
Then I changed TARGET ?= OPENMV2 to STM32F4DISC, and got these errors:
In file included from /home/rokko/openmv/src/micropython/py/mpconfig.h:45:0,
from main.c:13:
/home/rokko/openmv/src/micropython/stmhal/mpconfigport.h:222:0: error: "USE_DEVICE_MODE" redefined [-Werror]
#define USE_DEVICE_MODE
^
<command-line>:0:0: note: this is the location of the previous definition
In file included from /home/rokko/openmv/src/micropython/stmhal/mpconfigport.h:226:0,
from /home/rokko/openmv/src/micropython/py/mpconfig.h:45,
from main.c:13:
/home/rokko/openmv/src/micropython/stmhal/boards/STM32F4DISC/mpconfigboard.h:1:0: error: "STM32F4DISC" redefined [-Werror]
#define STM32F4DISC
^
<command-line>:0:0: note: this is the location of the previous definition
In file included from /usr/include/newlib/stdio.h:29:0,
from main.c:9:
/home/rokko/openmv/src/micropython/stmhal/mpconfigport.h:218:16: error: conflicting types for 'gc_alloc'
#define malloc gc_alloc
^
In file included from main.c:25:0:
/home/rokko/openmv/src/micropython/py/gc.h:48:7: note: previous declaration of 'gc_alloc' was here
void *gc_alloc(mp_uint_t n_bytes, bool has_finaliser);
^
In file included from /home/rokko/openmv/src/micropython/stmhal/usbdev/core/inc/usbd_core.h:34:0,
from main.c:51:
/home/rokko/openmv/src/micropython/stmhal/usbdev/core/inc/usbd_def.h:258:0: error: "MIN" redefined [-Werror]
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
^
In file included from /home/rokko/openmv/src/micropython/py/qstr.h:30:0,
from main.c:16:
/home/rokko/openmv/src/micropython/py/misc.h:42:0: note: this is the location of the previous definition
#define MIN(x, y) ((x) < (y) ? (x) : (y))
^
In file included from /home/rokko/openmv/src/micropython/stmhal/usbdev/core/inc/usbd_core.h:34:0,
from main.c:51:
/home/rokko/openmv/src/micropython/stmhal/usbdev/core/inc/usbd_def.h:259:0: error: "MAX" redefined [-Werror]
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
^
In file included from /home/rokko/openmv/src/micropython/py/qstr.h:30:0,
from main.c:16:
/home/rokko/openmv/src/micropython/py/misc.h:45:0: note: this is the location of the previous definition
#define MAX(x, y) ((x) > (y) ? (x) : (y))
^
main.c: In function 'flash_error':
main.c:175:19: error: 'LED_RED' undeclared (first use in this function)
led_state(LED_RED, 0);
^
main.c:175:19: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'make_flash_fs':
main.c:239:15: error: 'LED_RED' undeclared (first use in this function)
led_state(LED_RED, 1);
^
main.c: In function 'main':
main.c:292:15: error: 'LED_RED' undeclared (first use in this function)
led_state(LED_RED, 1);
^
main.c:293:15: error: 'LED_GREEN' undeclared (first use in this function)
led_state(LED_GREEN, 1);
^
main.c:294:15: error: 'LED_BLUE' undeclared (first use in this function)
led_state(LED_BLUE, 1);
^
main.c:417:21: error: implicit declaration of function 'pyexec_str' [-Werror=implicit-function-declaration]
pyexec_str(usbdbg_get_script());
^
cc1: all warnings being treated as errors
make[1]: *** [/home/rokko/openmv/src/build/omv/main.o] Error 1
make[1]: Leaving directory `/home/rokko/openmv/src/omv'
make: *** [objs] Error 2