Locally compiled ArduCopter 4.5.0-beta1 fails on MatekH743 due to watchdog

On my Linux machine, I compiled MatekH743 firmware to be used for Matek H743-WLITE board. The resulting file is attached. When I flash it, I can subsequently connect to the board from GCS, but after few seconds the connection fails. Subsequent reconnection attempts keep tell me the following in the logs:

[MAV 001:1] Baro: skipping calibration after WDG reset
[MAV 001:1] Restored watchdog attitude 0 0 0

I tried to find the actual watchdog messages via log analysis, but it appears that the logs are not really written: the log size is 4096 bytes and there is nothing in it.

I am not sure where to look for, could somebody please direct me to that?

Possibly relevant info:

  • There is a difference in *.apj image size between my version (1346036 bytes) and the official one (1360056 bytes).
  • I believe the GCC version I am using is 13.2.1.

Hi @MaxBuzz,

I guess the standard 4.5.0-beta firmware is OK? I think it must be because I’m sure that other users (and developers) have successfully used it.

… in which case this is most likely an issue with the development environment on your local PC. Of course you’ve followed the instructions here on the wiki?

@MaxBuzz can you give a link to where you got the compiler from?

please run: arm-none-eabi-g++ -v and give us the output
also please give the output of the waf configure step

The standard firmware is surely OK.

The thing is, my environment is sufficient to build working firmware for another board I have, FlywooF405S-AIO - just tested that. A month ago I also successfully built firmware for FlywooF745.

The GCC is from Gentoo crossdev, and its -v output is this:

Using built-in specs.
COLLECT_GCC=arm-none-eabi-g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/arm-none-eabi/13/lto-wrapper
Target: arm-none-eabi
Configured with: /var/tmp/portage/cross-arm-none-eabi/gcc-13.2.1_p20240113-r1/work/gcc-13-20240113/configure --host=x86_64-pc-linux-gnu --target=arm-none-eabi --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/arm-none-eabi/gcc-bin/13 --includedir=/usr/lib/gcc/arm-none-eabi/13/include --datadir=/usr/share/gcc-data/arm-none-eabi/13 --mandir=/usr/share/gcc-data/arm-none-eabi/13/man --infodir=/usr/share/gcc-data/arm-none-eabi/13/info --with-gxx-include-dir=/usr/lib/gcc/arm-none-eabi/13/include/g++-v13 --disable-silent-rules --disable-dependency-tracking --with-python-dir=/share/gcc-data/arm-none-eabi/13/python --enable-languages=c,c++ --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --disable-libunwind-exceptions --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 13.2.1_p20240113-r1 p12' --with-gcc-major-version-only --enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --enable-poison-system-directories --disable-libstdcxx-time --with-sysroot=/usr/arm-none-eabi --disable-gcov --disable-bootstrap --with-newlib --enable-multilib --disable-fixed-point --with-multilib-list=aprofile,rmprofile --disable-libgomp --disable-libssp --disable-libada --disable-cet --disable-systemtap --disable-valgrind-annotations --disable-vtable-verify --disable-libvtv --without-zstd --without-isl --disable-libsanitizer --disable-default-pie --disable-default-ssp
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 13.2.1 20240113 (Gentoo 13.2.1_p20240113-r1 p12) 

The output of ./waf configure --board=MatekH743-bdshot is attached.
configure.log (4.6 KB)

1 Like

Tested it once again with identical build environment:

  • FlywooF405S-AIO builds and flies normally.
  • MatekH743-bdshot builds but chokes on watchdog early enough to provide no logs.

Raw waf configure outputs for both (no escape sequences edited out):
configure-f405.log (5.2 KB)
configure-h743.log (5.5 KB)

One of possible explanations is that GCC 13.2.1 optimizes out something it should not, but it is only relevant for complete firmware and not for the feature-reduced one.

With GCC 10.5.0, locally compiled firmware runs normally on a copter.

Wonder what causes this incompatibility with GCC 13.2.1, given that this compiler works nicely for the F405 board I have…