diff --git a/boards/riscv/rv32m1_vega/pinmux.c b/boards/riscv/rv32m1_vega/pinmux.c index db8618925cedb7..5fc6a8070be006 100644 --- a/boards/riscv/rv32m1_vega/pinmux.c +++ b/boards/riscv/rv32m1_vega/pinmux.c @@ -6,8 +6,15 @@ #include #include +#include #include +#ifdef CONFIG_BT_CTLR_DEBUG_PINS +struct device *vega_debug_portb; +struct device *vega_debug_portc; +struct device *vega_debug_portd; +#endif + static int rv32m1_vega_pinmux_init(struct device *dev) { ARG_UNUSED(dev); @@ -70,6 +77,39 @@ static int rv32m1_vega_pinmux_init(struct device *dev) pinmux_pin_set(portb, 22, PORT_PCR_MUX(kPORT_MuxAlt2)); #endif +#ifdef CONFIG_BT_CTLR_DEBUG_PINS + + pinmux_pin_set(portb, 29, PORT_PCR_MUX(kPORT_MuxAsGpio)); + + pinmux_pin_set(portc, 28, PORT_PCR_MUX(kPORT_MuxAsGpio)); + pinmux_pin_set(portc, 29, PORT_PCR_MUX(kPORT_MuxAsGpio)); + pinmux_pin_set(portc, 30, PORT_PCR_MUX(kPORT_MuxAsGpio)); + + pinmux_pin_set(portd, 0, PORT_PCR_MUX(kPORT_MuxAsGpio)); + pinmux_pin_set(portd, 1, PORT_PCR_MUX(kPORT_MuxAsGpio)); + pinmux_pin_set(portd, 2, PORT_PCR_MUX(kPORT_MuxAsGpio)); + pinmux_pin_set(portd, 3, PORT_PCR_MUX(kPORT_MuxAsGpio)); + pinmux_pin_set(portd, 4, PORT_PCR_MUX(kPORT_MuxAsGpio)); + pinmux_pin_set(portd, 5, PORT_PCR_MUX(kPORT_MuxAsGpio)); + + struct device *gpio_dev = device_get_binding(DT_ALIAS_GPIO_B_LABEL); + + gpio_pin_configure(gpio_dev, 29, GPIO_DIR_OUT); + + gpio_dev = device_get_binding(DT_ALIAS_GPIO_C_LABEL); + gpio_pin_configure(gpio_dev, 28, GPIO_DIR_OUT); + gpio_pin_configure(gpio_dev, 29, GPIO_DIR_OUT); + gpio_pin_configure(gpio_dev, 30, GPIO_DIR_OUT); + + gpio_dev = device_get_binding(DT_ALIAS_GPIO_D_LABEL); + gpio_pin_configure(gpio_dev, 0, GPIO_DIR_OUT); + gpio_pin_configure(gpio_dev, 1, GPIO_DIR_OUT); + gpio_pin_configure(gpio_dev, 2, GPIO_DIR_OUT); + gpio_pin_configure(gpio_dev, 3, GPIO_DIR_OUT); + gpio_pin_configure(gpio_dev, 4, GPIO_DIR_OUT); + gpio_pin_configure(gpio_dev, 5, GPIO_DIR_OUT); +#endif + return 0; } diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index 0e3fe0b8be2833..a3f62352d189fd 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -801,7 +801,7 @@ config BT_CTLR_PROFILE_ISR config BT_CTLR_DEBUG_PINS bool "Bluetooth Controller Debug Pins" - depends on BOARD_NRF51_PCA10028 || BOARD_NRF52_PCA10040 || BOARD_NRF52810_PCA10040 || BOARD_NRF52840_PCA10056 + depends on BOARD_NRF51_PCA10028 || BOARD_NRF52_PCA10040 || BOARD_NRF52810_PCA10040 || BOARD_NRF52840_PCA10056 || BOARD_RV32M1_VEGA help Turn on debug GPIO toggling for the BLE Controller. This is useful when debugging with a logic analyzer or profiling certain sections of