Firmware Build Fails After Build For Nicla Vision

The firmware successfully built for TARGET= OPENMV_RT1060 using:
make -j$(nproc) -C src/micropython/mpy-cross -B
make -j$(nproc) TARGET=OPENMV_RT1060 -C src

I then tried to build the same firmware for TARGET=ARDUINO_NICLA_VISION and got this error messages.

Memory region Used Size Region Size %age Used
DTCM: 127952 B 128 KB 97.62%
ITCM: 0 GB 64 KB 0.00%
SRAM0: 512 KB 512 KB 100.00%
SRAM1: 276 KB 276 KB 100.00%
SRAM2: 12 KB 12 KB 100.00%
SRAM4: 64 KB 64 KB 100.00%
FLASH_FFS: 0 GB 128 KB 0.00%
FLASH_TEXT: 2167620 B 1792 KB 118.13%
FLASH_EXT: 0 GB 16 MB 0.00%
collect2: error: ld returned 1 exit status
make: *** [/home/ajacobs/openmv/src/omv/ports/stm32/omv_portconfig.mk:723: firmware] Error 1

I thought it might be because of the size of the .tflite file I had added to /models (91kb), so I removed that file from /models and rebuilt for ARDUINO_NICLA_VISION, but still got same error message.

Now when I try to build for TARGET= OPENMV_RT1060, I get all sorts of error messages. Tried using -B to force rebuild for both make cmds and still got build errors.

QSTR not updated
Root pointer registrations not updated
Module registrations not updated
Compressed data not updated
CC /home/ajacobs/openmv/src/build/micropython/frozen_content.c
/home/ajacobs/openmv/src/build/micropython/frozen_content.c:750:5: error: redeclaration of enumerator ‘MP_QSTR_cs’
750 | MP_QSTR_cs,
| ^~~~~~~~~~
In file included from /home/ajacobs/openmv/src/micropython/py/obj.h:33,
from /home/ajacobs/openmv/src/micropython/py/objint.h:30,
from /home/ajacobs/openmv/src/build/micropython/frozen_content.c:16:
/home/ajacobs/openmv/src/build/micropython/genhdr/qstrdefs.generated.h:2163:7: note: previous definition of ‘MP_QSTR_cs’ with type ‘enum ’
2163 | QDEF1(MP_QSTR_cs, 28405, 2, “cs”)
| ^~~~~~~~~~
/home/ajacobs/openmv/src/micropython/py/qstr.h:52:35: note: in definition of macro ‘QDEF1’
52 | #define QDEF1(id, hash, len, str) id,
| ^~
/home/ajacobs/openmv/src/build/micropython/frozen_content.c:787:5: error: redeclaration of enumerator ‘MP_QSTR_dupterm_notify’
787 | MP_QSTR_dupterm_notify,
| ^~~~~~~~~~~~~~~~~~~~~~
/home/ajacobs/openmv/src/build/micropython/genhdr/qstrdefs.generated.h:2240:7: note: previous definition of ‘MP_QSTR_dupterm_notify’ with type ‘enum ’
2240 | QDEF1(MP_QSTR_dupterm_notify, 30646, 14, “dupterm_notify”)
| ^~~~~~~~~~~~~~~~~~~~~~
/home/ajacobs/openmv/src/micropython/py/qstr.h:52:35: note: in definition of macro ‘QDEF1’
52 | #define QDEF1(id, hash, len, str) id,
| ^~
/home/ajacobs/openmv/src/build/micropython/frozen_content.c:1156:5: error: redeclaration of enumerator ‘MP_QSTR_timeout_ms’
1156 | MP_QSTR_timeout_ms,
| ^~~~~~~~~~~~~~~~~~
/home/ajacobs/openmv/src/build/micropython/genhdr/qstrdefs.generated.h:3013:7: note: previous definition of ‘MP_QSTR_timeout_ms’ with type ‘enum ’
3013 | QDEF1(MP_QSTR_timeout_ms, 17759, 10, “timeout_ms”)
| ^~~~~~~~~~~~~~~~~~
/home/ajacobs/openmv/src/micropython/py/qstr.h:52:35: note: in definition of macro ‘QDEF1’
52 | #define QDEF1(id, hash, len, str) id,
| ^~
/home/ajacobs/openmv/src/build/micropython/frozen_content.c:11855:5: error: ‘MP_QSTR__slash_flash’ undeclared here (not in a function); did you mean ‘MP_QSTR__slash__slash_’?
11855 | MP_QSTR__slash_flash,
| ^~~~~~~~~~~~~~~~~~~~
| MP_QSTR__slash__slash_
/home/ajacobs/openmv/src/build/micropython/frozen_content.c:11860:5: error: ‘MP_QSTR__slash_flash_slash_lib’ undeclared here (not in a function); did you mean ‘MP_QSTR__slash_sdcard_slash_lib’?
11860 | MP_QSTR__slash_flash_slash_lib,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| MP_QSTR__slash_sdcard_slash_lib
-e See Build Troubleshooting · micropython/micropython Wiki · GitHub

Hi, you only need to build mpy-cross once.

cd src/micropython/mp-cross
make clean
make

After that you don’t need to do it again unless there’s a major micropython update. For building the firmware always clean first when switching boards.

cd src
make clean
make TARGET=OPENMV_RT1060 -j8

And when building the firmware over and over again just:

make TARGET=OPENMV_RT1060 -j8

make -B just forces a build of all targets. This isn’t the right usage.

Thanks, that worked :slight_smile: