MAMBA Basic F405 MINI MK3.5 Buzzer Trouble

Hello.
I’m trying to use the “MAMBA Basic F405 MINIMK3.5”, but I can’t get any sound of a buzzer. I have experience with iNav and Betaflight, but this is my first time with ArduPilot. Please help.

I made some changes to hwdef.dat with reference to “ardupilot/libraries/AP_HAL_ChibiOS/hwdef/MambaF405US-I2C at master · ArduPilot/ardupilot · GitHub” and uploaded it to FC.
Everything works as expected except that a buzzer does not sound. A buzzer pin on this FC is assigned to PC13 (no timer function).
Since I’m connecting an active buzzer, I feel like I can use PC13 without the timer function, but there is no sound at all.
I am new to ArduPilot so I don’t know what to do.

My question:
Q1.Do I need to set the parameters? If so, which parameters?
Q2.Basically, is it possible to use a buzzer on port PC13 without the timer function?

# hw definition file for processing by chibios_pins.py
# Mamba Basic F405 US I2C
# With F405 MCU, MPU6000 IMU and 7456 series OSD
# Based on Mamba F405 from jeanphilippehell
@ thanks to betaflight for pin information

MCU STM32F4xx STM32F405xx

# board ID for firmware load
APJ_BOARD_ID 1038

# crystal frequency
OSCILLATOR_HZ 8000000

# board voltage
STM32_VDD 330U

STM32_ST_USE_TIMER 5

# order of I2C buses
I2C_ORDER I2C1

# order of UARTs (and USB)
# this order follows the labels on the board
SERIAL_ORDER OTG1 USART1 USART2 USART3 UART4 UART5 USART6

# The pins that USB is connected on
PA11 OTG_FS_DM OTG1
PA12 OTG_FS_DP OTG1
PC5 VBUS INPUT OPENDRAIN

# USART1 is wired to SBUS and PPM input
# RC input defaults to timer capture
PB7 TIM4_CH2 TIM4 RCININT PULLDOWN
PB6 USART1_TX USART1 NODMA

# Alt config to allow RCIN on UART
PB7 USART1_RX USART1 NODMA ALT(1)

# SBUS inversion control pin, active low
PC0 USART1_RXINV OUTPUT HIGH GPIO(78) POL(0)

# USART2
PA2 USART2_TX USART2
PA3 USART2_RX USART2

# USART3
PB10 USART3_TX USART3
PB11 USART3_RX USART3

# UART4
PA0 UART4_TX UART4
PA1 UART4_RX UART4

# UART5
PC12 UART5_TX UART5
PD2 UART5_RX UART5

# USART6
PC6 USART6_TX USART6
PC7 USART6_RX USART6

# ADC
PC1 BAT_VOLT_SENS ADC1 SCALE(1)
PC2 RSSI_IN ADC1
PC3 BAT_CURR_SENS ADC1 SCALE(1)

# PWM output. 1 - 4 on ESC header
define BOARD_PWM_COUNT_DEFAULT 8
PA9 TIM1_CH2 TIM1 PWM(1) GPIO(50)
PA8 TIM1_CH1 TIM1 PWM(2) GPIO(51)
PC9 TIM3_CH4 TIM3 PWM(3) GPIO(52)
PC8 TIM3_CH3 TIM3 PWM(4) GPIO(53)

# Board LEDs
PC15 LED1 OUTPUT LOW GPIO(1)
PC14 LED2 OUTPUT LOW GPIO(2)
define HAL_GPIO_A_LED_PIN 1
define HAL_GPIO_B_LED_PIN 2

# External LEDs
#PB3 LED_EXT1 OUTPUT GPIO(30)
PB3 TIM2_CH2 TIM2 PWM(5) GPIO(30)	# for LED strip
define HAL_NEOPIXEL_COUNT 8

# Buzzer
PC13 BUZZER OUTPUT GPIO(80) LOW
define HAL_BUZZER_PIN 80
define HAL_BUZZER_ON 1
define HAL_BUZZER_OFF 0

# Note that this board needs PULLUP on I2C pins
PB8 I2C1_SCL I2C1 PULLUP
PB9 I2C1_SDA I2C1 PULLUP

# SPI1 - Internal IMU
PA4 MPU6000_CS CS
PA5 SPI1_SCK SPI1
PA6 SPI1_MISO SPI1
PA7 SPI1_MOSI SPI1

# SPI2 - OSD
PB13 SPI2_SCK SPI2
PB14 SPI2_MISO SPI2
PB15 SPI2_MOSI SPI2
# OSD max7456
PB12 OSD_CS CS

# SPI3 - dataflash
PC10 SPI3_SCK SPI3
PC11 SPI3_MISO SPI3
PB5 SPI3_MOSI SPI3
# Dataflash M25P16
PA15 FLASH_CS CS

# SPI Device table
SPIDEV mpu6000    SPI1 DEVID1 MPU6000_CS MODE3 1*MHZ 8*MHZ
SPIDEV osd        SPI2 DEVID4 OSD_CS MODE0 10*MHZ 10*MHZ
SPIDEV dataflash  SPI3 DEVID1 FLASH_CS   MODE3 32*MHZ 32*MHZ

# One IMU rotated in yaw
IMU Invensense SPI:mpu6000 ROTATION_YAW_90

# Probe for I2C BMP280, but allow init on board variants without onboard baro too
BARO BMP280 I2C:0:0x76
define HAL_PROBE_EXTERNAL_I2C_BAROS
define HAL_BARO_ALLOW_INIT_NO_BARO

# no built-in compass, but probe the i2c bus for all possible
# external compass types
define ALLOW_ARM_NO_COMPASS
define HAL_COMPASS_DEFAULT HAL_COMPASS_NONE
define HAL_PROBE_EXTERNAL_I2C_COMPASSES
define HAL_I2C_INTERNAL_MASK 0
define HAL_COMPASS_AUTO_ROT_DEFAULT 2

# enable logging to dataflash
define HAL_LOGGING_DATAFLASH
define HAL_STORAGE_SIZE 16384
define STORAGE_FLASH_PAGE 1

# flash size
FLASH_SIZE_KB 1024
# reserve 16k for bootloader and 32k for flash storage
FLASH_RESERVE_START_KB 48

# define default battery setup
define HAL_BATT_VOLT_PIN 11
define HAL_BATT_CURR_PIN 13
define HAL_BATT_VOLT_SCALE 11
define HAL_BATT_CURR_SCALE 39

# Analog RSSI pin (also could be used as analog airspeed input)
define BOARD_RSSI_ANA_PIN 1

# Setup for OSD
define OSD_ENABLED 1
define HAL_OSD_TYPE_DEFAULT 1

# Font for OSD
ROMFS_WILDCARD libraries/AP_OSD/fonts/font*.bin

I checked a lot of hwdef.dat that might be helpful, but the description in hwdef.dat seems to be fine.

# Buzzer
PC13 BUZZER OUTPUT GPIO(80) LOW
define HAL_BUZZER_PIN 80
define HAL_BUZZER_ON 1
define HAL_BUZZER_OFF 0

Then, I set the parameters that may be related to a buzzer as follows.

NFT_BUZZ_TYPES	0	# also tried 1 and 2
NTF_BUZZ_VOLUME	100

However, a buzzer remains quiet. (Of course, I have confirmed that the board and buzzer work with Betaflight firmware.)
I’m sure there is something I’m not aware of.
Please help me out.

Seems like it should work - the definitions look correct. How are you testing it? With basic buzzer support the buzzer won’t sound very often, one of the only times it does is when you arm

I am aware of the contents of the “STATUS Pattern” described at Buzzer (aka Tone Alarm) — Copter documentation.
I made the states of “ARMING”, “DISARED”, and “LOST VEHICLE” and tried them. I can see the states changes on LED, but there is no sound from a buzzer.

Experimentally, I rewrote hwdef.dat as follows:

# Buzzer
PC7 TIM8_CH2 TIM8 GPIO(80) ALARM
#PC13 BUZZER OUTPUT GPIO(80) LOW
#define HAL_BUZZER_PIN 80
#define HAL_BUZZER_ON 1
#define HAL_BUZZER_OFF 0

As a result of the experiment, when PC7 is used instead of PC13, a buzzer sounds “ARMING”, “DISARMED”, and “LOST VEHICLE” as expected.

PC7 is not a port for a buzzer, so I need an external transistor. I want to use PC13 if possible.

Is there anything I should try?
Is there anything I haven’t noticed yet?
I would appreciate you for any hints.

The BF hwdef lists the buzzer as inverted. Try putting POL(0) or POL(1) on the end of your pin definition to see if that helps

Thank you for the information.
I tried both POL (0) and POL (1), but a buzzer still didn’t make any sound.

By changing “BUZZER” to “ALARM”, a buzzer now makes sound. I should have noticed earlier.
Thank you for your advice.

#PC13 BUZZER OUTPUT LOW GPIO(80)
PC13 ALARM OUTPUT LOW GPIO(80)                                             
define HAL_BUZZER_PIN 80
define HAL_BUZZER_ON 1
define HAL_BUZZER_OFF 0