Skip to content

Conversation

LeonardHerbst
Copy link
Contributor

Contribution description

Support for the Crazyflie 2.1 main application MCU. The Crazyflie 2.1 uses a dual-MCU setup. One for the main application and one for radio and power management.
I was usure wheather I should include the cpu family in the board name.

Testing procedure

I tested the timers, dma, uart, SPI, I2C and running the motors.
I did not test the adc unit.

@github-actions github-actions bot added Area: doc Area: Documentation Area: boards Area: Board ports Area: Kconfig Area: Kconfig integration labels Sep 2, 2025
@crasbe
Copy link
Contributor

crasbe commented Sep 2, 2025

I was usure wheather I should include the cpu family in the board name.

That depends. Is is likely that RIOT would run on the radio MCU as well, or is that always considered "static" like an on-board programmer on ST's Nucleo devboards?

@crasbe crasbe added Type: new feature The issue requests / The PR implemements a new feature for RIOT CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Sep 2, 2025
@riot-ci
Copy link

riot-ci commented Sep 2, 2025

Murdock results

✔️ PASSED

f2ac773 boards: added support for the bitcraze Crazyflie 2.1 main application processor

Success Failures Total Runtime
593 0 593 03m:40s

Artifacts

Copy link
Contributor

@crasbe crasbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your new board addition, RIOT on a drone might be a first :D

There are some minor things from my side apart of the comments below:

  1. There are some static errors (such as too many consecutive empty lines) that need to be addressed.
  2. The board name should follow our naming convention: https://github.com/RIOT-OS/RIOT/blob/master/doc/memos/rdm0003.md
    A possible name would be bitcraze-crazyflie. However considering there are multiple revisions of the Crazyflie (which might be incompatible?), it might make sense to name it bitcraze-crazyflie21 or similar.

Comment on lines 1 to 5
# Copyright (c) 2025 LeonardHerbst
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The copyright notices should be migrated to the new SPDX format, as described in #21515

Comment on lines 8 to 9
It has two oboard microcontrollers, a nRF51822 used for radio communication and power management and
a STM32F405 (this board) used for running the main application.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It has two oboard microcontrollers, a nRF51822 used for radio communication and power management and
a STM32F405 (this board) used for running the main application.
It has two onboard microcontrollers, an nRF51822 used for radio communication and power management and
an STM32F405 (this board definition) used for running the main application.

| Package | LQFP64 |
| RAM | 192 KiB (128 KiB RAM + 64 KiB CCMRAM) |
| Flash | 1024 KiB |
| Frequency | up to 168 MHz |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to specify at which clock rate the MCU is clocked when using RIOT.


### Flash the board
Prerequisites:
- the crazyflie NRF firmware runs on the NRF [instructions](https://www.bitcraze.io/documentation/repository/crazyflie2-nrf-firmware/master/build/build/)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- the crazyflie NRF firmware runs on the NRF [instructions](https://www.bitcraze.io/documentation/repository/crazyflie2-nrf-firmware/master/build/build/)
- the Crazyflie NRF firmware runs on the NRF [instructions](https://www.bitcraze.io/documentation/repository/crazyflie2-nrf-firmware/master/build/build/)

Likewise for other occurances in the document.

It appears that bitcraze should be written in lowercase and Crazyflie with a capital C.

* @file
* @brief Board specific definitions for the Crazyflie 2.1
*
* @author LeonardHerbst <[email protected]>
Copy link
Contributor

@crasbe crasbe Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @author LeonardHerbst <leonard.herbst@tu-dresden.de>
* @author Leonard Herbst <leonard.herbst@tu-dresden.de>

The same is true for the other files.


/* This board provides an HSE */
#ifndef CONFIG_BOARD_HAS_HSE
#define CONFIG_BOARD_HAS_HSE 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#define CONFIG_BOARD_HAS_HSE 1
# define CONFIG_BOARD_HAS_HSE 1

@LeonardHerbst
Copy link
Contributor Author

I was usure wheather I should include the cpu family in the board name.

That depends. Is is likely that RIOT would run on the radio MCU as well, or is that always considered "static" like an on-board programmer on ST's Nucleo devboards?

Thanks for the quick response!
RIOT could run on the radio MCU as well (it uses an nRF51822). So I am going with "bitcraze-crazyflie21-stm".

@crasbe
Copy link
Contributor

crasbe commented Sep 3, 2025

Either -stm or -main, then you could call the other board -radio to make the distinction clearer which processor is responsible for which task.

@crasbe
Copy link
Contributor

crasbe commented Sep 4, 2025

Regarding the CI error, I think you will have to extend the STM32 clock configuration, as there seem to be no provisions for the STM32F405 yet (there is no other board that supports it yet): https://github.com/RIOT-OS/RIOT/blob/master/cpu/stm32/stmclk/stmclk_f2f4f7.c

Copy link
Contributor

@crasbe crasbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some static errors, please fix them too.
You can also run make static-test locally in the base directory before pushing.

Comment on lines 1 to 5
# Copyright (c) 2025 TU Dresden
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Copyright (c) 2025 TU Dresden
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
# SPDX-FileCopyrightText: 2025 TU Dresden
# SPDX-License-Identifier: LGPL-2.1-only

This file too.


/* This board provides an LSE */
#ifndef CONFIG_BOARD_HAS_LSE
# define CONFIG_BOARD_HAS_LSE 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RIOT does not use horizontal tabs, only spaces.

@github-actions github-actions bot added the Area: tools Area: Supplementary tools label Sep 5, 2025
Comment on lines 19 to 31
#ifndef CONFIG_BOARD_HAS_LSE
# define CONFIG_BOARD_HAS_LSE 1
#endif

/* This board provides an HSE */
#ifndef CONFIG_BOARD_HAS_HSE
# define CONFIG_BOARD_HAS_HSE 1
#endif

/* The HSE provides a 8MHz clock */
#ifndef CONFIG_CLOCK_HSE
# define CONFIG_CLOCK_HSE MHZ(8)
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#ifndef CONFIG_BOARD_HAS_LSE
# define CONFIG_BOARD_HAS_LSE 1
#endif
/* This board provides an HSE */
#ifndef CONFIG_BOARD_HAS_HSE
# define CONFIG_BOARD_HAS_HSE 1
#endif
/* The HSE provides a 8MHz clock */
#ifndef CONFIG_CLOCK_HSE
# define CONFIG_CLOCK_HSE MHZ(8)
#endif
#ifndef CONFIG_BOARD_HAS_LSE
# define CONFIG_BOARD_HAS_LSE 1
#endif
/* This board provides an HSE */
#ifndef CONFIG_BOARD_HAS_HSE
# define CONFIG_BOARD_HAS_HSE 1
#endif
/* The HSE provides a 8MHz clock */
#ifndef CONFIG_CLOCK_HSE
# define CONFIG_CLOCK_HSE MHZ(8)
#endif

The indentation level for preprocessor commands is only two spaces.

Comment on lines 47 to 48
warning: Member motor_driver_config\[\] \(variable\) of
warning: Member MOTOR_DRIVER_NUMOF \(macro definition\) of
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please provide documentation for the variables instead of adding another exception to the already-too-long list of exceptions.

@github-actions github-actions bot removed the Area: tools Area: Supplementary tools label Sep 5, 2025
@crasbe
Copy link
Contributor

crasbe commented Sep 5, 2025

You'll have to add the board to the BLACKLIST of shame of the usb_cdc_ecm test:

# Boards that don't have enough endpoints to use CDC ACM together with CDC ECM
ifeq (,$(filter stdio_%,$(filter-out stdio_cdc_acm,$(USEMODULE))))
BOARD_BLACKLIST += \
sipeed-longan-nano \
sipeed-longan-nano-tft \
seeedstudio-gd32 \
stm32f4discovery \
weact-f401cc \
weact-f401ce \
weact-f411ce \
#
endif

The STM32F405 only has four endpoints, which is not enough to use USB CDC ECM and USB CDC ACM at the same time.

@github-actions github-actions bot added the Area: tests Area: tests and testing framework label Sep 9, 2025
Copy link
Contributor

@crasbe crasbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please squash your commits.

@crasbe crasbe added this pull request to the merge queue Oct 7, 2025
Merged via the queue into RIOT-OS:master with commit 2bdb5c0 Oct 7, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Area: doc Area: Documentation Area: Kconfig Area: Kconfig integration Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants