Bunny
October 24, 2024, 7:34pm
1
Hi,
I would like to use neopixel to control an external led strip using one of the AUX outputs. I am using Cubeorange and PX4 version 1.15.0.
I have been able to combilple and start the neopixel driver.
I have also referred to issue:
opened 03:27PM - 01 Dec 22 UTC
closed 12:01PM - 13 Jan 23 UTC
bug-report
## Describe the bug
Running the neopixel driver on a holybro pixhawk 6x does no… t produce the expected signal.
I use the dma-version of this driver: `srgbled_dma.cpp` and the latest release (v1.13.2).
## To Reproduce
Added to `fmu-v6x/src/board_config.h`:
```
# define BOARD_HAS_N_S_RGB_LED 10
# define S_RGB_LED_DMA DMAMAP_TIM5_CH4 /* Note, this is DMAMUX1 and DMA-Mux-Index 101 */
# define S_RGB_LED_TIMER 5 /* timer 5 */
# define S_RGB_LED_CHANNEL 4 /* channel 4 */
// # define S_RGB_LED_CHANNELN 1 /* channel 4N */
# define S_RGB_LED_TIM_GPIO GPIO_TIM5_CH4OUT_2 /* PI0 aka FMU_CH1*/
```
Build and flash, then in nsh:
`neopixel start`
## Expected behavior
I would expect to see a pwm-like signal on pin FMU_CH1 of two different duty-cycles.
Total bit time is 1200 ns, 0b1(600ns|600ns) 0b0(300ns|900ns).
## Log Files and Screenshots
The signal on FMU_CH1 is either constantly zero, or
if I enable DMA-debug-prints and disable DMA on the serial console (because it would freeze otherwise) I get a weird non-const signal with some pulses that have nothing to do with the expected behaviour.
log:
https://logs.px4.io/plot_app?log=b063b920-a603-4820-9d73-71acd0f30f78
## Drone (please complete the following information):
holybro pixhawk 6x on baseboard mini, powered with USBC.
## Additional context
With print statements in `stm32h7/stm32_dma.c` (for debugging), the serial console freezes.
Configuring the serial console without DMA would solve the freezing issue.
and tried replicating as much as possible but I am unable to control the LEDs.
The driver reports to be controlling the leds when calling neopixel status
, but no output is send to the gpio.
I’ve set up the DMA configuration as follows in board_config.h:
#if defined(USE_S_RGB_LED_DMA)
# define S_RGB_LED_DMA DMAMAP_DMA12_TIM1CH2_1
# define S_RGB_LED_TIMER 1 // Timer 1
# define S_RGB_LED_CHANNEL 2 // Channel 2 for AUX6
# define S_RGB_LED_CHANNELN 1 // Not used
# define S_RGB_LED_TIM_GPIO GPIO_TIM1_CH2OUT_2
#endif
Does anyone know how to control the neopixel using AUX pin?