A pulse input cannot be read on the pin you chose
What ArduPilot says:
- …: Failed to detach interrupt from N
- …: Failed to attach interrupt to N
The feature named first (RangeFinder_PWM, HC_SR04, Button, FuelLevelPWM or RSSI) measures the width of pulses on a pin, and for that the pin must be able to interrupt the processor. The pin number at the end could not be set up that way: it is not one of this board's GPIO pins, or another input already uses the same interrupt line. The feature reads nothing. “Failed to detach…” appears when the pin is changed and the old one could not be released; a reboot clears it.
What to do, most likely first
The pin number is not a GPIO pin of this board.
CheckThe Board & Wiring Planner shows the GPIO number of each output of your board.
FixChoose a pin your board's documentation lists as GPIO, set that output's
SERVOn_FUNCTIONto -1 (GPIO), and reboot.Two pulse inputs share one interrupt line of the processor.
FixMove one of them to another pin.
Parameters to look at
| Parameter | What it is |
|---|---|
RNGFND1_PIN | Rangefinder pin |
RSSI_ANA_PIN | Receiver RSSI sensing pin |
BTN_PIN1 | First button Pin |
BATT_FL_PIN | Fuel level analog pin number |
Where to do it:Board & Wiring Planner
The code that sends it
…: Failed to detach interrupt from N
libraries/AP_HAL/GPIO.cpp AP_HAL::PWMSource::set_pin() · Open in ArduPilot Copter-4.7.1
…: Failed to attach interrupt to N
libraries/AP_HAL/GPIO.cpp AP_HAL::PWMSource::set_pin() · Open in ArduPilot Copter-4.7.1