Hello everyone,
I am running an Apalis IMX8 mounted on an Apalis Evaluation board.
I am testing eDMA UART communication from the M4 cortex and the NXP examples are running fine using pins 6,8 ( UART0_RTS_B, UART0_CTS_B) and set to ALT 2 functionality (DMA.UART2) in the pinmux.
Now I am trying to set this up to use UART3 pins 134,136 ( UART0_TX/RX respectively) however I am bit confused with the naming here. as it is named UART3 in the Ixora datasheet but UART0 in the apalis datasheet.
I have did the following changes the code but nothing happened:
pinmux.h
just changed the pin name in Board_initpins_name/ID macros
/* UART0_RTS_B (number AU45), BB_UART2_RX/J20A[28] */
/* Routed pin properties */
#define BOARD_INITPINS_BB_UART2_RX_PERIPHERAL DMA__UART2 /*!< Peripheral name */
#define BOARD_INITPINS_BB_UART2_RX_SIGNAL uart_rx /*!< Signal name */
#define BOARD_INITPINS_BB_UART2_RX_PIN_NAME UART0_RX /*!< Routed pin name */
#define BOARD_INITPINS_BB_UART2_RX_PIN_FUNCTION_ID SC_P_UART0_RX /*!< Pin function id */
#define BOARD_INITPINS_BB_UART2_RX_LABEL "BB_UART2_RX/J20A[28]" /*!< Label */
#define BOARD_INITPINS_BB_UART2_RX_NAME "BB_UART2_RX" /*!< Identifier */
/* UART0_CTS_B (number AW49), BB_UART2_TX/J20A[29] */
/* Routed pin properties */
#define BOARD_INITPINS_BB_UART2_TX_PERIPHERAL DMA__UART2 /*!< Peripheral name */
#define BOARD_INITPINS_BB_UART2_TX_SIGNAL uart_tx /*!< Signal name */
#define BOARD_INITPINS_BB_UART2_TX_PIN_NAME UART0_TX /*!< Routed pin name */
#define BOARD_INITPINS_BB_UART2_TX_PIN_FUNCTION_ID SC_P_UART0_TX /*!< Pin function id */
#define BOARD_INITPINS_BB_UART2_TX_LABEL "BB_UART2_TX/J20A[29]" /*!< Label */
#define BOARD_INITPINS_BB_UART2_TX_NAME "BB_UART2_TX" /*!< Identifier */
pinmux.c
changed the ALT function to 0 to use DMA.UART0 functionality
void BOARD_InitPins(sc_ipc_t ipc) /*!< Function assigned for the core: Cortex-M4F[cm4_core1] */
{
sc_err_t err = SC_ERR_NONE;
err = sc_pad_set_all(ipc, BOARD_INITPINS_BB_UART2_TX_PIN_FUNCTION_ID, 0U, SC_PAD_CONFIG_NORMAL, SC_PAD_ISO_OFF, 0x0 ,SC_PAD_WAKEUP_OFF);/* IOMUXD_UART0_CTS_B register modification value */
if (SC_ERR_NONE != err)
{
assert(false);
}
err = sc_pad_set_all(ipc, BOARD_INITPINS_BB_UART2_RX_PIN_FUNCTION_ID, 0U, SC_PAD_CONFIG_NORMAL, SC_PAD_ISO_OFF, 0x0 ,SC_PAD_WAKEUP_OFF);/* IOMUXD_UART0_RTS_B register modification value */
if (SC_ERR_NONE != err)
{
assert(false);
}
}
now in the main.c
I tried changing the following defines to 3 or 0
#define DEMO_LPUART DMA__LPUART2
#define DEMO_LPUART_CLKSRC kCLOCK_DMA_Lpuart2
#define DEMO_LPUART_CLK_FREQ CLOCK_GetIpFreq(kCLOCK_DMA_Lpuart2)
#define LPUART_TX_DMA_CHANNEL 17U
#define LPUART_RX_DMA_CHANNEL 16U
#define EXAMPLE_LPUART_DMA_BASEADDR DMA__EDMA0
#define ECHO_BUFFER_LENGTH 8
but I didn’t change the DMA channels as I am not sure what 17U and 16U represents here.
The main question here is should I change these define to (ex. DMA_LPUART0 or DMA_LPUART3) ? I am guessing is I need to use 0 here.
the side question is what does the 17U and 16U in the DMA channels defines refer to ?
as I am also guessing that could be the main issue here.
Thank you