Hi,
I own an OpenMV Cam H7 Plus and I’m trying to compile the firmware (make TARGET=OPENMV4) but I get the following error when the winc.c module is reached:
CC src/winc.c
src/winc.c: In function 'wifi_callback_sta':
src/winc.c:392:13: error: 'strncpy' output may be truncated copying 32 bytes from a string of length 32 [-Werror=stringop-truncation]
392 | strncpy((char*) wscan_result.ssid, (const char *) scan_result->au8SSID, WINC_MAX_SSID_LEN-1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/winc.c:356:13: error: 'strncpy' output may be truncated copying 32 bytes from a string of length 32 [-Werror=stringop-truncation]
356 | strncpy(netinfo->ssid, con_info->acSSID, WINC_MAX_SSID_LEN-1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:20: /home/lb/repositories/openmv/src/build/winc1500/src/winc.o] Error 1
make: *** [Makefile:605: FIRMWARE_OBJS] Error 2
I have an Ubuntu 20.04 LTS running on VM-ware player 15.
I’ve followed the procedure described on the Firmware Guide section without any major problems, except that the installation of gcc-arm-embedded is no longer supported through PPA, thus I had to install it “manually” as described here: apt - How to install arm-none-eabi-gdb on Ubuntu 20.04 LTS (Focal Fossa) - Ask Ubuntu
No issue when compiling the mpy-cross.
Yeah, the vospi code is definitely right. It sounds like the gcc version you are using doesn’t understand pointers. Like, that pointer has no length info, thus the compiler can’t know the array bounds, nor should it check that since this is c code…
I also experienced the same issue when compiling on ubuntu20.04 with the latest GCC toolchain.
But after downgraded the GCC with “gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2” and this compile error is gone.
arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 7.2.1 20170904 (release) [ARM/embedded-7-branch revision 255204]
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Finally, what version do you use?
“gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2” throws
/usr/share/gcc-arm-none-eabi-7-2017-q4-major/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld: /home/kirill/repositories/openmv/src/build/bin/firmware.elf section `.text' will not fit in region `FLASH_TEXT'
/usr/share/gcc-arm-none-eabi-7-2017-q4-major/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld: region `FLASH_TEXT' overflowed by 11736 bytes
collect2: error: ld returned 1 exit status
make: *** [Makefile:490: firmware] Error 1