From 7500d4f154aee84e0b6010e2bdae1ba0555bc976 Mon Sep 17 00:00:00 2001 From: Jeremy Kongs Date: Fri, 15 Nov 2024 14:28:51 -0600 Subject: [PATCH 1/3] fix(PeriphDrivers): Fix GPIO Structure Collision for HART UART (#1272) --- Libraries/PeriphDrivers/Include/MAX32675/mxc_pins.h | 3 +++ Libraries/PeriphDrivers/Include/MAX32680/mxc_pins.h | 2 ++ Libraries/PeriphDrivers/Source/AFE/hart_uart.c | 4 ++-- Libraries/PeriphDrivers/Source/SYS/pins_me16.c | 4 ++++ Libraries/PeriphDrivers/Source/SYS/pins_me20.c | 4 ++++ 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Libraries/PeriphDrivers/Include/MAX32675/mxc_pins.h b/Libraries/PeriphDrivers/Include/MAX32675/mxc_pins.h index 370041103fd..344dbe93c1c 100644 --- a/Libraries/PeriphDrivers/Include/MAX32675/mxc_pins.h +++ b/Libraries/PeriphDrivers/Include/MAX32675/mxc_pins.h @@ -44,6 +44,9 @@ extern const mxc_gpio_cfg_t gpio_cfg_uart0_flow; extern const mxc_gpio_cfg_t gpio_cfg_uart0_flow_disable; extern const mxc_gpio_cfg_t gpio_cfg_uart1; extern const mxc_gpio_cfg_t gpio_cfg_uart1_flow; + +extern const mxc_gpio_cfg_t gpio_cfg_hart; + extern const mxc_gpio_cfg_t gpio_cfg_uart2; extern const mxc_gpio_cfg_t gpio_cfg_uart2_flow; extern const mxc_gpio_cfg_t gpio_cfg_uart2_flow_disable; diff --git a/Libraries/PeriphDrivers/Include/MAX32680/mxc_pins.h b/Libraries/PeriphDrivers/Include/MAX32680/mxc_pins.h index 45028d36480..5289f4de006 100644 --- a/Libraries/PeriphDrivers/Include/MAX32680/mxc_pins.h +++ b/Libraries/PeriphDrivers/Include/MAX32680/mxc_pins.h @@ -41,6 +41,8 @@ extern const mxc_gpio_cfg_t gpio_cfg_i2c2; extern const mxc_gpio_cfg_t gpio_cfg_i2c2b; extern const mxc_gpio_cfg_t gpio_cfg_i2c2c; +extern const mxc_gpio_cfg_t gpio_cfg_hart; + extern const mxc_gpio_cfg_t gpio_cfg_uart0; extern const mxc_gpio_cfg_t gpio_cfg_uart0_flow; extern const mxc_gpio_cfg_t gpio_cfg_uart0_flow_disable; diff --git a/Libraries/PeriphDrivers/Source/AFE/hart_uart.c b/Libraries/PeriphDrivers/Source/AFE/hart_uart.c index c1782bae8ec..4cd3fa8c259 100644 --- a/Libraries/PeriphDrivers/Source/AFE/hart_uart.c +++ b/Libraries/PeriphDrivers/Source/AFE/hart_uart.c @@ -193,12 +193,12 @@ static int hart_uart_init(mxc_uart_regs_t *uart, unsigned int baud, mxc_uart_clo switch (MXC_UART_GET_IDX(uart)) { case 0: - MXC_AFE_GPIO_Config(&gpio_cfg_uart0); + MXC_AFE_GPIO_Config(&gpio_cfg_hart); MXC_SYS_ClockEnable(MXC_SYS_PERIPH_CLOCK_UART0); break; case 2: - MXC_AFE_GPIO_Config(&gpio_cfg_uart2); + MXC_AFE_GPIO_Config(&gpio_cfg_hart); MXC_SYS_ClockEnable(MXC_SYS_PERIPH_CLOCK_UART2); break; diff --git a/Libraries/PeriphDrivers/Source/SYS/pins_me16.c b/Libraries/PeriphDrivers/Source/SYS/pins_me16.c index 5a897c98630..0fd55ce6960 100644 --- a/Libraries/PeriphDrivers/Source/SYS/pins_me16.c +++ b/Libraries/PeriphDrivers/Source/SYS/pins_me16.c @@ -55,6 +55,10 @@ const mxc_gpio_cfg_t gpio_cfg_uart1_flow = { MXC_GPIO0, (MXC_GPIO_PIN_30 | MXC_G const mxc_gpio_cfg_t gpio_cfg_uart1_flow_disable = { MXC_GPIO0, (MXC_GPIO_PIN_30 | MXC_GPIO_PIN_31), MXC_GPIO_FUNC_IN, MXC_GPIO_PAD_NONE, MXC_GPIO_VSSEL_VDDIO, MXC_GPIO_DRVSTR_0 }; +// NOTE: UART2 mapping B is tied to HART modem in the AFE and cannot be moved. +const mxc_gpio_cfg_t gpio_cfg_hart = { MXC_GPIO0, (MXC_GPIO_PIN_14 | MXC_GPIO_PIN_15), MXC_GPIO_FUNC_ALT2, + MXC_GPIO_PAD_NONE, MXC_GPIO_VSSEL_VDDIO, MXC_GPIO_DRVSTR_0 }; + const mxc_gpio_cfg_t gpio_cfg_uart2 = { MXC_GPIO1, (MXC_GPIO_PIN_8 | MXC_GPIO_PIN_9), MXC_GPIO_FUNC_ALT1, MXC_GPIO_PAD_NONE, MXC_GPIO_VSSEL_VDDIO, MXC_GPIO_DRVSTR_0 }; const mxc_gpio_cfg_t gpio_cfg_uart2_flow = { MXC_GPIO1, (MXC_GPIO_PIN_10 | MXC_GPIO_PIN_11), MXC_GPIO_FUNC_ALT1, diff --git a/Libraries/PeriphDrivers/Source/SYS/pins_me20.c b/Libraries/PeriphDrivers/Source/SYS/pins_me20.c index ecb6a2f794e..f3247bfdc74 100644 --- a/Libraries/PeriphDrivers/Source/SYS/pins_me20.c +++ b/Libraries/PeriphDrivers/Source/SYS/pins_me20.c @@ -41,6 +41,10 @@ const mxc_gpio_cfg_t gpio_cfg_i2c1 = { MXC_GPIO0, (MXC_GPIO_PIN_16 | MXC_GPIO_PI const mxc_gpio_cfg_t gpio_cfg_i2c2 = { MXC_GPIO0, (MXC_GPIO_PIN_30 | MXC_GPIO_PIN_31), MXC_GPIO_FUNC_ALT1, MXC_GPIO_PAD_NONE, MXC_GPIO_VSSEL_VDDIO, MXC_GPIO_DRVSTR_0 }; +// NOTE: UART0 is tied to HART modem in the AFE and cannot be moved. +const mxc_gpio_cfg_t gpio_cfg_hart = { MXC_GPIO0, (MXC_GPIO_PIN_0 | MXC_GPIO_PIN_1), MXC_GPIO_FUNC_ALT1, + MXC_GPIO_PAD_NONE, MXC_GPIO_VSSEL_VDDIO, MXC_GPIO_DRVSTR_0 }; + const mxc_gpio_cfg_t gpio_cfg_uart0 = { MXC_GPIO0, (MXC_GPIO_PIN_0 | MXC_GPIO_PIN_1), MXC_GPIO_FUNC_ALT1, MXC_GPIO_PAD_NONE, MXC_GPIO_VSSEL_VDDIO, MXC_GPIO_DRVSTR_0 }; const mxc_gpio_cfg_t gpio_cfg_uart0_flow = { MXC_GPIO0, (MXC_GPIO_PIN_2 | MXC_GPIO_PIN_3), MXC_GPIO_FUNC_ALT2, From 247e670846cba468d5d1a2d24ec3613ca1525564 Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Tue, 19 Nov 2024 14:18:09 -0600 Subject: [PATCH 2/3] build(ThirdParty): Added flag to select BLE_API directory (#1274) --- Libraries/libs.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Libraries/libs.mk b/Libraries/libs.mk index 121f83a9f53..9bafe060948 100644 --- a/Libraries/libs.mk +++ b/Libraries/libs.mk @@ -78,8 +78,9 @@ INIT_EXTENDED ?= 0 # Default directory for libphy LIB_PHY_DIR ?= $(LIBS_DIR)/BlePhy +BLE_API ?= Cordio # Include the Cordio Library -CORDIO_DIR ?= $(LIBS_DIR)/Cordio +CORDIO_DIR ?= $(LIBS_DIR)/$(BLE_API) include $(CORDIO_DIR)/platform/targets/maxim/build/cordio_lib.mk PROJ_CFLAGS += -D__CORDIO__ From 98f390c9973b71c4066a2e35f7f598b8d8ba0f97 Mon Sep 17 00:00:00 2001 From: Cristian Cruz <71054319+crsz20@users.noreply.github.com> Date: Tue, 19 Nov 2024 15:14:44 -0600 Subject: [PATCH 3/3] fix(Examples): Link to the libphy.a directory in MAX32657 BLE5_ctr (#1275) --- Examples/MAX32657/Bluetooth/BLE5_ctr/project.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Examples/MAX32657/Bluetooth/BLE5_ctr/project.mk b/Examples/MAX32657/Bluetooth/BLE5_ctr/project.mk index e41ee807593..f1de6ad0dda 100644 --- a/Examples/MAX32657/Bluetooth/BLE5_ctr/project.mk +++ b/Examples/MAX32657/Bluetooth/BLE5_ctr/project.mk @@ -28,7 +28,7 @@ LIB_CORDIO = 1 CORDIO_DIR = $(LIBS_DIR)/Packetcraft-ADI -RF_PHY_DIR = $(LIBS_DIR)/RF-PHY +LIB_PHY_DIR ?= $(LIBS_DIR)/RF-PHY # Cordio library options BLE_HOST = 0