Commit c6c978ad authored by Ioannis Glaropoulos's avatar Ioannis Glaropoulos Committed by Carles Cufi
Browse files

boards: nrf5340dk_nrf5340: properly choose UARTE pins for Network MCU



When building for nRF5340 Application MCU we need to properly
select which are the default GPIO port/pins for UARTE on the
Network MCU (so we allocate them to Network MCU). These  depend
on the actual version of the board we are using (PDK or DK) so
this commit implements the corresponding conditional logic.

Signed-off-by: default avatarIoannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
parent e684dfa3
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -22,10 +22,19 @@ LOG_MODULE_REGISTER(nrf5340pdk_nrf5340_cpuapp, CONFIG_LOG_DEFAULT_LEVEL);
#if !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE)

/* This should come from DTS, possibly an overlay. */
#if defined(CONFIG_BOARD_NRF5340PDK_NRF5340_CPUAPP)
#define CPUNET_UARTE_PIN_TX  25
#define CPUNET_UARTE_PIN_RX  26
#define CPUNET_UARTE_PORT_TRX NRF_P0
#define CPUNET_UARTE_PIN_RTS 10
#define CPUNET_UARTE_PIN_CTS 12
#elif defined(CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP)
#define CPUNET_UARTE_PIN_TX  1
#define CPUNET_UARTE_PIN_RX  0
#define CPUNET_UARTE_PORT_TRX NRF_P1
#define CPUNET_UARTE_PIN_RTS 11
#define CPUNET_UARTE_PIN_CTS 10
#endif

#if defined(CONFIG_BT_CTLR_DEBUG_PINS_CPUAPP)
#include <../subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/debug.h>
@@ -39,9 +48,9 @@ static void remoteproc_mgr_config(void)
	/* Assign specific GPIOs that will be used to get UARTE from
	 * nRF5340 Network MCU.
	 */
	NRF_P0->PIN_CNF[CPUNET_UARTE_PIN_TX] =
	CPUNET_UARTE_PORT_TRX->PIN_CNF[CPUNET_UARTE_PIN_TX] =
	GPIO_PIN_CNF_MCUSEL_NetworkMCU << GPIO_PIN_CNF_MCUSEL_Pos;
	NRF_P0->PIN_CNF[CPUNET_UARTE_PIN_RX] =
	CPUNET_UARTE_PORT_TRX->PIN_CNF[CPUNET_UARTE_PIN_RX] =
	GPIO_PIN_CNF_MCUSEL_NetworkMCU << GPIO_PIN_CNF_MCUSEL_Pos;
	NRF_P0->PIN_CNF[CPUNET_UARTE_PIN_RTS] =
	GPIO_PIN_CNF_MCUSEL_NetworkMCU << GPIO_PIN_CNF_MCUSEL_Pos;