Hi @io!
In the context of embedded systems and SDKs like the one you're using, a UART instance refers to a specific UART peripheral available on your SoC (System on Chip). Most modern SoCs have multiple UARTs (e.g., UART0, UART1, UART2, etc.), and each one is assigned an instance number.
or your case, since you're working with the NXP i.MX8QM, here’s how to locate the UART instance:
Open the i.MX8QM Reference Manual.
Search for LPUART or UART in the document.
Look for a section like Peripheral Memory Map or UART Overview.
Each UART peripheral (e.g., LPUART0, LPUART1, etc.) will be listed with:
Its base address
Its instance number
Its interrupt vector
Its clock source
Best Regards,
Chvaira
Thanks for your response.
My original problem was that I wanted to switch the debug console UART on Cortex-M4 core 0 to another UART, because the default pin (M40_UART) used in the SDK hello_world example is already in use by another core on my board. That’s why I needed to understand what the instance field in hal_uart_config_t really meant. In DbgConsole_Init() I need to pass that value.
After checking some files related to that function. in MIMX8QM6_cm4_core0.h I found the definitions of the uart base address.
/** Array initializer of LPUART peripheral base addresses */
#define LPUART_BASE_ADDRS { CM4_0__LPUART_BASE, CM4_1__LPUART_BASE, DMA__LPUART0_BASE, DMA__LPUART1_BASE, DMA__LPUART2_BASE, DMA__LPUART3_BASE, DMA__LPUART4_BASE, SCU__LPUART_BASE }
/** Array initializer of LPUART peripheral base pointers */
#define LPUART_BASE_PTRS { CM4_0__LPUART, CM4_1__LPUART, DMA__LPUART0, DMA__LPUART1, DMA__LPUART2, DMA__LPUART3, DMA__LPUART4, SCU__LPUART }
So the instance field is just the index into this array of base addresses (?). It works anyway. Thanks
Best Regards,
io