ArduPilot / ArduPilot/ardupilot

Bootloader GPIO Issues

Open
#30,745 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
15.9k
Forks
21.4k
Avg merge
3d 17h
Merged PRs (30d)
119

Description

## Bug report

**Issue details**

After a lot of triaging, it seems the new SD card based flashing stuff in 4.5+ (maybe older?) breaks the bootloader's ability to handle GPIO correctly?
In my case, I noticed the issue when peripherals that normally are off during boot started working. For example: `PD15 VDD_5V_PERIPH_EN OUTPUT LOW` does not hold PD15 low. It's high or floating.

Specifically, when these lines (perhaps only some are needed) are enabled in my bootloader hwdef, this issue exists.

```
# enable flashing from SD card:
# microSD support
PC8 SDMMC1_D0 SDMMC1
PC9 SDMMC1_D1 SDMMC1
PC10 SDMMC1_D2 SDMMC1
PC11 SDMMC1_D3 SDMMC1
PC12 SDMMC1_CK SDMMC1
PD2 SDMMC1_CMD SDMMC1
# enable FAT filesystem support (needs a microSD defined via SDMMC)
define HAL_OS_FATFS_IO 1
define AP_BOOTLOADER_FLASH_FROM_SD_ENABLED 1

# FATFS support:
define CH_CFG_USE_MEMCORE 1
define CH_CFG_USE_HEAP 1
define CH_CFG_USE_SEMAPHORES 0
define CH_CFG_USE_MUTEXES 1
define CH_CFG_USE_DYNAMIC 1
define CH_CFG_USE_WAITEXIT 1
define CH_CFG_USE_REGISTRY 1
```

**STR**
```
./waf distclean
./Tools/scripts/build_bootloaders.py
./waf configure --board=
./waf copter
```

**Version**
4.54+ (whatever version started supporting flash based firmware updates I suspect)

**Platform**
[ x ] All
[ ] AntennaTracker
[ ] Copter
[ ] Plane
[ ] Rover
[ ] Submarine

**Airframe type**
_What type of airframe (flying wing, glider, hex, Y6, octa etc)_
n/a

**Hardware type**
_What autopilot hardware was used? (Pixhawk, Cube, Pixracer, Navio2, etc)_
Custom

**Logs**
_Please provide a link to any relevant logs that show the issue_
n/a

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the listed bootloader and Copter build commands with the SDMMC1, FATFS, and GPIO settings in the bootloader hwdef. Trace bootloader GPIO initialization alongside SD-card flashing support; done means PD15 reliably remains low during boot while SD-card firmware updates continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.