1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-12 19:10:32 +03:00
Open Source Flight Controller Firmware
Find a file
Thomas Stibor 94be8f0673
Fix openocd makefile target by using TARGET_MCU_FAMILY (#13410)
* Fix openocd makefile target by using TARGET_MCU_FAMILY

The condition before this commit in mk/openocd.mk

ifeq ($(TARGET_MCU),STM32F4)
OPENOCD_CFG := target/stm32f4x.cfg

else ifeq ($(TARGET_MCU),STM32F7)
OPENOCD_CFG := target/stm32f7x.cfg
else
endif

ifneq ($(OPENOCD_CFG),)
OPENOCD_COMMAND = $(OPENOCD) -f $(OPENOCD_IF) -f $(OPENOCD_CFG)
endif

resulted in a not defined OPENOCD_COMMAND, because TARGET_MCU does not
contain the MCU family such as STM32F4, but e.g. STM32F411xE.

Thus executing e.g (note: CONFIG=BLACKPILL411 is a custom config I created for the Blackpill Board)

$ make DEBUG=GDB CONFIG=BLACKPILL411 openocd-gdb
make: *** No rule to make target 'openocd-gdb'.  Stop.

whereas after the patch:
$ make DEBUG=GDB CONFIG=BLACKPILL411 openocd-gdb

...
...
Linking STM32F411_BLACKPILL411
Memory region         Used Size  Region Size  %age Used
           FLASH:        7680 B        16 KB     46.88%
    FLASH_CONFIG:          0 GB        16 KB      0.00%
          FLASH1:      329297 B       480 KB     67.00%
   SYSTEM_MEMORY:          0 GB        29 KB      0.00%
             RAM:       62612 B       128 KB     47.77%
       MEMORY_B1:          0 GB         0 GB
   text	   data	    bss	    dec	    hex	filename
 331757	   5220	  56980	 393957	  602e5	./obj/main/betaflight_STM32F411_BLACKPILL411.elf
openocd -f interface/stlink-v2.cfg -f target/stm32f4x.cfg & ./tools/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-gdb ./obj/main/betaflight_STM32F411_BLACKPILL411.elf -ex "target remote localhost:3333" -ex "load"
Open On-Chip Debugger 0.12.0
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
WARNING: interface/stlink-v2.cfg is deprecated, please switch to interface/stlink.cfg
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 2000 kHz
...
...
[stm32f4x.cpu] halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08009014 msp: 0x2001fff0
Start address 0x08009014, load size 336977
Transfer rate: 37 KB/sec, 11232 bytes/write.
(gdb) c
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x08021a1c in scheduler () at ./src/main/scheduler/scheduler.c:695
695	                    task->taskAgePeriods = (cmpTimeUs(currentTimeUs, task->lastExecutedAtUs) / task->attribute->desiredPeriodUs);
(gdb) quit

works as expected.

In addition add also G4 and H7 TARGET_MCU_FAMILY support. When installing openocd the config files for G4 and H7, should
be provided in directory: /usr/share/openocd/scripts/target

$ grep -r TARGET_MCU_FAMILY | awk '/ STM32/{print $3}' | sort | uniq && find /usr/share/openocd/scripts/target -type f | grep "stm32f4x.cfg\|stm32f7x.cfg\|stm32g4x.cfg\|stm32h7x.cfg"

STM32F4
STM32F7
STM32G4
STM32H7

/usr/share/openocd/scripts/target/stm32g4x.cfg
/usr/share/openocd/scripts/target/stm32h7x.cfg
/usr/share/openocd/scripts/target/stm32f4x.cfg
/usr/share/openocd/scripts/target/stm32f7x.cfg

* Remove useless else
2024-03-08 11:14:26 +01:00
.github Bump workflow action (#13355) 2024-02-15 13:47:38 +01:00
images Fix picture and update links (#12244) 2023-01-29 10:55:49 +11:00
lib Fix error in I2C write operation on AT32 (#13228) 2023-12-17 10:04:30 +11:00
mk Fix openocd makefile target by using TARGET_MCU_FAMILY (#13410) 2024-03-08 11:14:26 +01:00
src Fix space in status output when gps version is unknown (#13423) 2024-03-07 12:09:42 +01:00
.gitattributes Added unified '.gitattributes' file. 2019-10-02 01:05:29 +13:00
.gitignore Rename make folder to get rid of build error. (#12880) 2023-06-14 21:48:55 +02:00
CODE_OF_CONDUCT.md Update Code of Conduct 2022-02-19 02:18:55 +01:00
CONTRIBUTING.md Remove docs and fix links (#12222) 2023-01-25 19:34:17 +11:00
DEFAULT_LICENCE.md Simplified Local Build using Permanent Config (#12341) 2023-02-11 14:02:18 +11:00
LICENSE Updated more documentation to match the template. 2020-03-09 13:00:35 +13:00
Makefile Ensure consistent openssl behaviour with version 3.2.x and 3.3.x (#13385) 2024-02-26 23:21:20 +01:00
README.md Update hardware specification link (#13231) 2023-12-18 21:49:50 +01:00
Vagrantfile Update Vagrant env with libblocksruntime-dev required by unittest. 2017-09-27 18:19:41 +02:00

Betaflight

Latest version Build License: GPL v3 Join us on Discord!

Betaflight is flight controller software (firmware) used to fly multi-rotor craft and fixed wing craft.

This fork differs from Baseflight and Cleanflight in that it focuses on flight performance, leading-edge feature additions, and wide target support.

Events

Date Event
01-11-2022 Firmware 4.4 Feature freeze
29-01-2023 Firmware 4.4 Release

News

Requirements for the submission of new and updated targets

The following new requirements for pull requests adding new targets or modifying existing targets are put in place from now on:

  1. Read the hardware specification

  2. No new F3 based targets will be accepted;

  3. For any new target that is to be added, only a Unified Target config into https://github.com/betaflight/unified-targets/tree/master/configs/default needs to be submitted. See the instructions for how to create a Unified Target configuration. If there is no Unified Target for the MCU type of the new target (see instructions above), then a 'legacy' format target definition into src/main/target/ has to be submitted as well;

  4. For changes to existing targets, the change needs to be applied to the Unified Target config in https://github.com/betaflight/unified-targets/tree/master/configs/default. If no Unified Target configuration for the target exists, a new Unified Target configuration will have to be created and submitted. If there is no Unified Target for the MCU type of the new target (see instructions above), then an update to the 'legacy' format target definition in src/main/target/ has to be submitted alongside the update to the Unified Target configuration.

Features

Betaflight has the following features:

  • Multi-color RGB LED strip support (each LED can be a different color using variable length WS2811 Addressable RGB strips - use for Orientation Indicators, Low Battery Warning, Flight Mode Status, Initialization Troubleshooting, etc)
  • DShot (150, 300 and 600), Multishot, Oneshot (125 and 42) and Proshot1000 motor protocol support
  • Blackbox flight recorder logging (to onboard flash or external microSD card where equipped)
  • Support for targets that use the STM32 F4, G4, F7 and H7 processors
  • PWM, PPM, SPI, and Serial (SBus, SumH, SumD, Spektrum 1024/2048, XBus, etc) RX connection with failsafe detection
  • Multiple telemetry protocols (CRSF, FrSky, HoTT smart-port, MSP, etc)
  • RSSI via ADC - Uses ADC to read PWM RSSI signals, tested with FrSky D4R-II, X8R, X4R-SB, & XSR
  • OSD support & configuration without needing third-party OSD software/firmware/comm devices
  • OLED Displays - Display information on: Battery voltage/current/mAh, profile, rate profile, mode, version, sensors, etc
  • In-flight manual PID tuning and rate adjustment
  • PID and filter tuning using sliders
  • Rate profiles and in-flight selection of them
  • Configurable serial ports for Serial RX, Telemetry, ESC telemetry, MSP, GPS, OSD, Sonar, etc - Use most devices on any port, softserial included
  • VTX support for Unify Pro and IRC Tramp
  • and MUCH, MUCH more.

Installation & Documentation

See: https://betaflight.com/docs/wiki

Support and Developers Channel

There's a dedicated Discord server here:

https://discord.gg/n4E6ak4u3c

We also have a Facebook Group. Join us to get a place to talk about Betaflight, ask configuration questions, or just hang out with fellow pilots.

https://www.facebook.com/groups/betaflightgroup/

Etiquette: Don't ask to ask and please wait around long enough for a reply - sometimes people are out flying, asleep or at work and can't answer immediately.

Configuration Tool

To configure Betaflight you should use the Betaflight-configurator GUI tool (Windows/OSX/Linux) which can be found here:

https://github.com/betaflight/betaflight-configurator/releases/latest

Contributing

Contributions are welcome and encouraged. You can contribute in many ways:

  • implement a new feature in the firmware or in configurator (see below);
  • documentation updates and corrections;
  • How-To guides - received help? Help others!
  • bug reporting & fixes;
  • new feature ideas & suggestions;
  • provide a new translation for configurator, or help us maintain the existing ones (see below).

The best place to start is the Betaflight Discord (registration here). Next place is the github issue tracker:

https://github.com/betaflight/betaflight/issues https://github.com/betaflight/betaflight-configurator/issues

Before creating new issues please check to see if there is an existing one, search first otherwise you waste people's time when they could be coding instead!

If you want to contribute to our efforts financially, please consider making a donation to us through PayPal.

If you want to contribute financially on an ongoing basis, you should consider becoming a patron for us on Patreon.

Developers

Contribution of bugfixes and new features is encouraged. Please be aware that we have a thorough review process for pull requests, and be prepared to explain what you want to achieve with your pull request. Before starting to write code, please read our development guidelines and coding style definition.

GitHub actions are used to run automatic builds

Translators

We want to make Betaflight accessible for pilots who are not fluent in English, and for this reason we are currently maintaining translations into 21 languages for Betaflight Configurator: Català, Dansk, Deutsch, Español, Euskera, Français, Galego, Hrvatski, Bahasa Indonesia, Italiano, 日本語, 한국어, Latviešu, Português, Português Brasileiro, polski, Русский язык, Svenska, 简体中文, 繁體中文. We have got a team of volunteer translators who do this work, but additional translators are always welcome to share the workload, and we are keen to add additional languages. If you would like to help us with translations, you have got the following options:

  • if you help by suggesting some updates or improvements to translations in a language you are familiar with, head to crowdin and add your suggested translations there;
  • if you would like to start working on the translation for a new language, or take on responsibility for proof-reading the translation for a language you are very familiar with, please head to the Betaflight Discord chat (registration here), and join the 'translation' channel - the people in there can help you to get a new language added, or set you up as a proof reader.

Hardware Issues

Betaflight does not manufacture or distribute their own hardware. While we are collaborating with and supported by a number of manufacturers, we do not do any kind of hardware support. If you encounter any hardware issues with your flight controller or another component, please contact the manufacturer or supplier of your hardware, or check RCGroups https://rcgroups.com/forums/showthread.php?t=2464844 to see if others with the same problem have found a solution.

Betaflight Releases

https://github.com/betaflight/betaflight/releases

Open Source / Contributors

Betaflight is software that is open source and is available free of charge without warranty to all users.

Betaflight is forked from Cleanflight, so thanks goes to all those who have contributed to Cleanflight and its origins.

Origins for this fork (Thanks!):

  • Alexinparis (for MultiWii),
  • timecop (for Baseflight),
  • Dominic Clifton (for Cleanflight),
  • borisbstyle (for Betaflight), and
  • Sambas (for the original STM32F4 port).

The Betaflight Configurator is forked from Cleanflight Configurator and its origins.

Origins for Betaflight Configurator:

  • Dominic Clifton (for Cleanflight configurator), and
  • ctn (for the original Configurator).

Big thanks to current and past contributors:

  • Budden, Martin (martinbudden)
  • Bardwell, Joshua (joshuabardwell)
  • Blackman, Jason (blckmn)
  • ctzsnooze
  • Höglund, Anders (andershoglund)
  • Ledvina, Petr (ledvinap) - IO code awesomeness!
  • kc10kevin
  • Keeble, Gary (MadmanK)
  • Keller, Michael (mikeller) - Configurator brilliance
  • Kravcov, Albert (skaman82) - Configurator brilliance
  • MJ666
  • Nathan (nathantsoi)
  • ravnav
  • sambas - bringing us the F4
  • savaga
  • Stålheim, Anton (KiteAnton)

And many many others who haven't been mentioned....