Bluetooth: controller: Add support for nRF5340 debug pins
Add support for Bluetooth Controller GPIO Debug Pins for nRF5340 PDK board. GPIO Pin toggling can be captured on the P3 pinhead of the PDK. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
parent
f2ac844cf7
commit
428799295d
3 changed files with 81 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Nordic Semiconductor ASA.
|
||||
* Copyright (c) 2019-2020 Nordic Semiconductor ASA.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
@ -27,6 +27,12 @@ LOG_MODULE_REGISTER(nrf5340pdk_nrf5340_cpuapp, CONFIG_LOG_DEFAULT_LEVEL);
|
|||
#define CPUNET_UARTE_PIN_RTS 10
|
||||
#define CPUNET_UARTE_PIN_CTS 12
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_DEBUG_PINS_CPUAPP)
|
||||
#include <../subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/debug.h>
|
||||
#else
|
||||
#define DEBUG_SETUP()
|
||||
#endif
|
||||
|
||||
static void remoteproc_mgr_config(void)
|
||||
{
|
||||
/* UARTE */
|
||||
|
@ -42,6 +48,9 @@ static void remoteproc_mgr_config(void)
|
|||
NRF_P0->PIN_CNF[CPUNET_UARTE_PIN_CTS] =
|
||||
GPIO_PIN_CNF_MCUSEL_NetworkMCU << GPIO_PIN_CNF_MCUSEL_Pos;
|
||||
|
||||
/* Route Bluetooth Controller Debug Pins */
|
||||
DEBUG_SETUP();
|
||||
|
||||
/* Retain nRF5340 Network MCU in Secure domain (bus
|
||||
* accesses by Network MCU will have Secure attribute set).
|
||||
*/
|
||||
|
|
|
@ -932,7 +932,7 @@ config BT_CTLR_PROFILE_ISR
|
|||
|
||||
config BT_CTLR_DEBUG_PINS
|
||||
bool "Bluetooth Controller Debug Pins"
|
||||
depends on BOARD_NRF51DK_NRF51422 || BOARD_NRF52DK_NRF52832 || BOARD_NRF52DK_NRF52810 || BOARD_NRF52840DK_NRF52840 || BOARD_RV32M1_VEGA
|
||||
depends on BOARD_NRF51DK_NRF51422 || BOARD_NRF52DK_NRF52832 || BOARD_NRF52DK_NRF52810 || BOARD_NRF52840DK_NRF52840 || BOARD_NRF5340PDK_NRF5340_CPUNET || 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
|
||||
|
@ -950,3 +950,11 @@ config BT_CTLR_ASSERT_HANDLER
|
|||
an unrecoverable error.
|
||||
|
||||
endif # BT_CTLR
|
||||
|
||||
config BT_CTLR_DEBUG_PINS_CPUAPP
|
||||
bool "Bluetooth Controller Debug Pins"
|
||||
depends on BOARD_NRF5340PDK_NRF5340_CPUAPP
|
||||
help
|
||||
Route debug GPIO toggling for the BLE Controller. Enable this when
|
||||
using Bluetooth Controller Debug Pins in co-processor and the main
|
||||
processor needs to setup and/or route the signals.
|
||||
|
|
|
@ -1,12 +1,71 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2017 Nordic Semiconductor ASA
|
||||
* Copyright (c) 2016-2020 Nordic Semiconductor ASA
|
||||
* Copyright (c) 2016 Vinayak Kariappa Chettimada
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_BT_CTLR_DEBUG_PINS
|
||||
#if defined(CONFIG_BOARD_NRF52840DK_NRF52840)
|
||||
#if defined(CONFIG_BT_CTLR_DEBUG_PINS) || \
|
||||
defined(CONFIG_BT_CTLR_DEBUG_PINS_CPUAPP)
|
||||
#if defined(CONFIG_BOARD_NRF5340PDK_NRF5340_CPUAPP) || \
|
||||
defined(CONFIG_BOARD_NRF5340PDK_NRF5340_CPUNET)
|
||||
#define DEBUG_PORT NRF_P1
|
||||
#define DEBUG_PIN_IDX0 0
|
||||
#define DEBUG_PIN_IDX1 1
|
||||
#define DEBUG_PIN_IDX2 4
|
||||
#define DEBUG_PIN_IDX3 5
|
||||
#define DEBUG_PIN_IDX4 6
|
||||
#define DEBUG_PIN_IDX5 7
|
||||
#define DEBUG_PIN_IDX6 8
|
||||
#define DEBUG_PIN_IDX7 9
|
||||
#define DEBUG_PIN_IDX8 10
|
||||
#define DEBUG_PIN_IDX9 11
|
||||
#define DEBUG_PIN0 BIT(DEBUG_PIN_IDX0)
|
||||
#define DEBUG_PIN1 BIT(DEBUG_PIN_IDX1)
|
||||
#define DEBUG_PIN2 BIT(DEBUG_PIN_IDX2)
|
||||
#define DEBUG_PIN3 BIT(DEBUG_PIN_IDX3)
|
||||
#define DEBUG_PIN4 BIT(DEBUG_PIN_IDX4)
|
||||
#define DEBUG_PIN5 BIT(DEBUG_PIN_IDX5)
|
||||
#define DEBUG_PIN6 BIT(DEBUG_PIN_IDX6)
|
||||
#define DEBUG_PIN7 BIT(DEBUG_PIN_IDX7)
|
||||
#define DEBUG_PIN8 BIT(DEBUG_PIN_IDX8)
|
||||
#define DEBUG_PIN9 BIT(DEBUG_PIN_IDX9)
|
||||
#if defined(CONFIG_BOARD_NRF5340PDK_NRF5340_CPUAPP)
|
||||
#define DEBUG_SETUP() \
|
||||
do { \
|
||||
DEBUG_PORT->PIN_CNF[DEBUG_PIN_IDX0] = \
|
||||
(GPIO_PIN_CNF_MCUSEL_NetworkMCU << \
|
||||
GPIO_PIN_CNF_MCUSEL_Pos); \
|
||||
DEBUG_PORT->PIN_CNF[DEBUG_PIN_IDX1] = \
|
||||
(GPIO_PIN_CNF_MCUSEL_NetworkMCU << \
|
||||
GPIO_PIN_CNF_MCUSEL_Pos); \
|
||||
DEBUG_PORT->PIN_CNF[DEBUG_PIN_IDX2] = \
|
||||
(GPIO_PIN_CNF_MCUSEL_NetworkMCU << \
|
||||
GPIO_PIN_CNF_MCUSEL_Pos); \
|
||||
DEBUG_PORT->PIN_CNF[DEBUG_PIN_IDX3] = \
|
||||
(GPIO_PIN_CNF_MCUSEL_NetworkMCU << \
|
||||
GPIO_PIN_CNF_MCUSEL_Pos); \
|
||||
DEBUG_PORT->PIN_CNF[DEBUG_PIN_IDX4] = \
|
||||
(GPIO_PIN_CNF_MCUSEL_NetworkMCU << \
|
||||
GPIO_PIN_CNF_MCUSEL_Pos); \
|
||||
DEBUG_PORT->PIN_CNF[DEBUG_PIN_IDX5] = \
|
||||
(GPIO_PIN_CNF_MCUSEL_NetworkMCU << \
|
||||
GPIO_PIN_CNF_MCUSEL_Pos); \
|
||||
DEBUG_PORT->PIN_CNF[DEBUG_PIN_IDX6] = \
|
||||
(GPIO_PIN_CNF_MCUSEL_NetworkMCU << \
|
||||
GPIO_PIN_CNF_MCUSEL_Pos); \
|
||||
DEBUG_PORT->PIN_CNF[DEBUG_PIN_IDX7] = \
|
||||
(GPIO_PIN_CNF_MCUSEL_NetworkMCU << \
|
||||
GPIO_PIN_CNF_MCUSEL_Pos); \
|
||||
DEBUG_PORT->PIN_CNF[DEBUG_PIN_IDX8] = \
|
||||
(GPIO_PIN_CNF_MCUSEL_NetworkMCU << \
|
||||
GPIO_PIN_CNF_MCUSEL_Pos); \
|
||||
DEBUG_PORT->PIN_CNF[DEBUG_PIN_IDX9] = \
|
||||
(GPIO_PIN_CNF_MCUSEL_NetworkMCU << \
|
||||
GPIO_PIN_CNF_MCUSEL_Pos); \
|
||||
} while (0)
|
||||
#endif /* CONFIG_BOARD_NRF5340PDK_NRF5340_CPUAPP */
|
||||
#elif defined(CONFIG_BOARD_NRF52840DK_NRF52840)
|
||||
#define DEBUG_PORT NRF_P1
|
||||
#define DEBUG_PIN0 BIT(1)
|
||||
#define DEBUG_PIN1 BIT(2)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue