Ardupilot Copter 4.1.5 firmware for BetaflightF4 controller

作者:Harrandi 发布时间:August 8, 2022 分类:FPV

Visit here for the latest: https://github.com/hulandy/hulandy.github.io/releases

=============

Updated on 2022.08.13

Today I've compiled another 4.1.5 copter firmware for this board. It contains 6 PWM output, PA0 pin (CAM or TM pin depends on varieties) is for the PWM5, LED pin is the PWM6, thus adding a super low cost sonar on it to incorporate with optic flow is possible now. The other functionality maintains the same. If you attach a MS5611 module on it, then you don't need to do anything in order to make it working. In theory, you can use a different barometer like BMP280 then you set it as an external module (In this case, set BARO_PROBE_EXT to 2, after reboot you'll be able to check the "press_abs" and "press_temp" in Status).

My setup : MS5611 module, GL9306 optic flow, GY-US42v2 Sonar works in PWM mode, 5883L compass. It works great~ Test flight footage and the firmware below :
Testflight

Firmware

=====================================================================================
I just compiled two firmware for the old target betaflightf4 controller (Initially created by BorisB and FpvModel), I believe that iFlight SucceX-E and LDARC-KKT30D are both using the same target. There has no Baro on the board.

One of the firmware is for external Baro -BMP280 bff428_with_bl.zip and another is for MS56XX bff456_with_bl.zip.

There is also a slightly different between these two firmware, that is MS56XX one has PA0 pin (TM or Cam control) for PWM 5 but hopefully it will work.

Common function: The default USART3 is I2C, you can set BRD_ALT_CONFIG=1 to use it as a normal USART (most unlikely, somehow if you don’t attach a baro on it, “speed” goes crazy, I’m an AP noob, tell me if you know what is going on in this case). By default, B08 is the RCin, on LDARC KK30D is PPM pin.

I haven't flight it yet, but it supposed to be fine. Just for test purposes only.

Use iNav configurator to flash it, newer Betaflight configurator doesn't work.
Since STM32 use rom for bootloader so you won't brick it.

编译Ardupilot会遇到的坑

作者:Harrandi 发布时间:August 5, 2022 分类:FPV

使用WINDOWS11,WSL2 - ubuntu22.04进行编译。

需要安装Virtual Machine Platform和Windows Subsystem for Linux两个模块。当然还要打开bios的cpu虚拟化。

编译需要在非root下执行,所以建立新的用户 adduser 然后再赋予sudo组: usermod -a -G 可能我的ubuntu安装步骤不完整,理论上应该提示创建不需要手动。

使用git克隆项目。

编译环境按手册搭建好之后默认在master分支下,趁机编译bootloader(其它的版本比如Copter4.1.5编译会出错)如果你已经切换至其它tag那么需要回来编译bootloader: git branch, git checkout master

更新submodule: git submodule update --init --recursive --force
有时候需要git submodule update --remote --merge
开始编译:
./waf distclean
./waf configure --board yourboard --bootloader
./waf clean
./waf bootloader

使用自动配置环境有时下载C编译器会失败,配置waf时提示没有编译器,重新执行自动配置并不能识别这个错误,需手动重新下载。

复制并改名Ap_bootloader.bin至Tools/bootloader 为 yourboard_bl.bin
切换至目标tag, 如:

git checkout tags/Copter-4.1.5

git submodule update --init --recursive

./waf distclean
./waf configure --board yourboard
./waf copter

如遇错误可能是网络的问题,需要确认你的文件完整,更新也没有报错。