Hello @chalu,
You are probably not seeing the messages on ttyRPMSG30 because the UART 4 is by default being used by the Bluetooth/WiFi module on the Verdin imx8m-plus module. Also, UART 4 is the default cortex-m debug port used by NXP. To fix that you can change from UART4 to UART 2 or 1. Here is an example we made for Hello-World demo but it should also work for RPMsg demo:
diff --git a/boards/evkmimx8mp/demo_apps/hello_world_change_uart/board.h b/boards/evkmimx8mp/demo_apps/hello_world_change_uart/board.h
index 4f02852..b25ea8b 100644
--- a/boards/evkmimx8mp/demo_apps/hello_world_change_uart/board.h
+++ b/boards/evkmimx8mp/demo_apps/hello_world_change_uart/board.h
@@ -20,13 +20,13 @@
/* The UART to use for debug messages. */
#define BOARD_DEBUG_UART_TYPE kSerialPort_Uart
#define BOARD_DEBUG_UART_BAUDRATE (115200U)
-#define BOARD_DEBUG_UART_BASEADDR UART4_BASE
-#define BOARD_DEBUG_UART_INSTANCE (4U)
+#define BOARD_DEBUG_UART_BASEADDR UART2_BASE
+#define BOARD_DEBUG_UART_INSTANCE (2U)
#define BOARD_DEBUG_UART_CLK_FREQ \
- CLOCK_GetPllFreq(kCLOCK_SystemPll1Ctrl) / (CLOCK_GetRootPreDivider(kCLOCK_RootUart4)) / \
- (CLOCK_GetRootPostDivider(kCLOCK_RootUart4)) / 10
-#define BOARD_UART_IRQ UART4_IRQn
-#define BOARD_UART_IRQ_HANDLER UART4_IRQHandler
+ CLOCK_GetPllFreq(kCLOCK_SystemPll1Ctrl) / (CLOCK_GetRootPreDivider(kCLOCK_RootUart2)) / \
+ (CLOCK_GetRootPostDivider(kCLOCK_RootUart2)) / 10
+#define BOARD_UART_IRQ UART2_IRQn
+#define BOARD_UART_IRQ_HANDLER UART2_IRQHandler
#define BOARD_GPC_BASEADDR GPC
#define BOARD_MU_IRQ MU1_M7_IRQn
diff --git a/boards/evkmimx8mp/demo_apps/hello_world_change_uart/clock_config.c b/boards/evkmimx8mp/demo_apps/hello_world_change_uart/clock_config.c
index 82a7869..d2d611c 100644
--- a/boards/evkmimx8mp/demo_apps/hello_world_change_uart/clock_config.c
+++ b/boards/evkmimx8mp/demo_apps/hello_world_change_uart/clock_config.c
@@ -102,8 +102,8 @@ void BOARD_BootClockRUN(void)
CLOCK_SetRootDivider(kCLOCK_RootAudioAhb, 1U, 2U); /* Set root clock freq to 800MHZ/ 2= 400MHZ*/
CLOCK_SetRootMux(kCLOCK_RootAudioAhb, kCLOCK_AudioAhbRootmuxSysPll1); /* switch AUDIO AHB to SYSTEM PLL1 */
- CLOCK_SetRootMux(kCLOCK_RootUart4, kCLOCK_UartRootmuxSysPll1Div10); /* Set UART source to SysPLL1 Div10 80MHZ */
- CLOCK_SetRootDivider(kCLOCK_RootUart4, 1U, 1U); /* Set root clock to 80MHZ/ 1= 80MHZ */
+ CLOCK_SetRootMux(kCLOCK_RootUart2, kCLOCK_UartRootmuxSysPll1Div10); /* Set UART source to SysPLL1 Div10 80MHZ */
+ CLOCK_SetRootDivider(kCLOCK_RootUart2, 1U, 1U); /* Set root clock to 80MHZ/ 1= 80MHZ */
CLOCK_EnableClock(kCLOCK_Rdc); /* Enable RDC clock */
CLOCK_EnableClock(kCLOCK_Ocram); /* Enable Ocram clock */
diff --git a/boards/evkmimx8mp/demo_apps/hello_world_change_uart/hello_world.c b/boards/evkmimx8mp/demo_apps/hello_world_change_uart/hello_world.c
index 10c0a4b..a3f06e9 100644
--- a/boards/evkmimx8mp/demo_apps/hello_world_change_uart/hello_world.c
+++ b/boards/evkmimx8mp/demo_apps/hello_world_change_uart/hello_world.c
@@ -29,8 +29,6 @@
*/
int main(void)
{
- char ch;
-
/* Init board hardware. */
/* M7 has its local cache and enabled by default,
* need to set smart subsystems (0x28000000 ~ 0x3FFFFFFF)
@@ -44,11 +42,16 @@ int main(void)
BOARD_BootClockRUN();
BOARD_InitDebugConsole();
- PRINTF("hello world.\r\n");
+ uint8_t counter = 0;
+ int i;
while (1)
{
- ch = GETCHAR();
- PUTCHAR(ch);
+ if (counter == 0xFF)
+ counter = 0;
+ else
+ counter++;
+ PRINTF("hello world. %d\r\n", counter);
+ for (i = 0; i < 10000000; i++);
}
}
diff --git a/boards/evkmimx8mp/demo_apps/hello_world_change_uart/pin_mux.c b/boards/evkmimx8mp/demo_apps/hello_world_change_uart/pin_mux.c
index 95c21cb..1120c9c 100644
--- a/boards/evkmimx8mp/demo_apps/hello_world_change_uart/pin_mux.c
+++ b/boards/evkmimx8mp/demo_apps/hello_world_change_uart/pin_mux.c
@@ -55,12 +55,12 @@ BOARD_InitPins:
*
* END ****************************************************************************************************************/
void BOARD_InitPins(void) { /*!< Function assigned for the core: Cortex-M7F[m7] */
- IOMUXC_SetPinMux(IOMUXC_UART4_RXD_UART4_RX, 0U);
- IOMUXC_SetPinConfig(IOMUXC_UART4_RXD_UART4_RX,
+ IOMUXC_SetPinMux(IOMUXC_UART2_RXD_UART2_RX, 0U);
+ IOMUXC_SetPinConfig(IOMUXC_UART2_RXD_UART2_RX,
IOMUXC_SW_PAD_CTL_PAD_PUE_MASK |
IOMUXC_SW_PAD_CTL_PAD_PE_MASK);
- IOMUXC_SetPinMux(IOMUXC_UART4_TXD_UART4_TX, 0U);
- IOMUXC_SetPinConfig(IOMUXC_UART4_TXD_UART4_TX,
+ IOMUXC_SetPinMux(IOMUXC_UART2_TXD_UART2_TX, 0U);
+ IOMUXC_SetPinConfig(IOMUXC_UART2_TXD_UART2_TX,
IOMUXC_SW_PAD_CTL_PAD_PUE_MASK |
IOMUXC_SW_PAD_CTL_PAD_PE_MASK);
}
For UART 1 it should work by default but for UART 2 you will have to run the following command in U-Boot terminal:
Verdin iMX8MP # mw.l 0x303d05a4 0xff
Please see this thread for more info: Embed M7 firmware in TorizonCore and load it automatically on Verdin iMX8M-Mini - #24 by vix
Please let us know if that solves the issue.