summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8f14f49)
raw | patch | inline | side by side (parent: 8f14f49)
author | M V Pratap Reddy <x0257344@ti.com> | |
Fri, 4 Dec 2020 04:28:02 +0000 (09:58 +0530) | ||
committer | Sivaraj R <sivaraj@ti.com> | |
Fri, 4 Dec 2020 11:34:48 +0000 (05:34 -0600) |
packages/ti/board/diag/uart/src/uart_diag.c | patch | blob | history | |
packages/ti/board/src/tpr12_evm/include/board_cfg.h | patch | blob | history |
diff --git a/packages/ti/board/diag/uart/src/uart_diag.c b/packages/ti/board/diag/uart/src/uart_diag.c
index 48775ef5a7f4288602180159b5721483d72d80c7..0ed1a32c619be94e766da6dbf72542ea567d8c4b 100755 (executable)
#define FIFO_SIZE (64U)
#define BAUD_RATE_MAX (7384615U)
+#if defined(SOC_TPR12)
+#include <string.h>
+uint8_t gUartTestBuf[100] = "\nTesting UART print to console at 115.2k baud rate";
+#endif
+
#if defined(SOC_AM65XX) || defined(SOC_J721E) || defined(SOC_J7200) || defined(SOC_AM64X)
#include "board_i2c_io_exp.h"
#include "diag_common_cfg.h"
return ret;
}
+#elif defined(SOC_TPR12) && defined (__TI_ARM_V7R4__)
+int main(void)
+{
+ Board_STATUS status;
+ Board_initCfg boardCfg;
+ int ret;
+ UART_Handle uart_handle = NULL;
+ UART_Params params;
+ char p = 'r';
+
+ boardCfg = BOARD_INIT_PINMUX_CONFIG | BOARD_INIT_UART_STDIO;
+
+ status = Board_init(boardCfg);
+ if(status != BOARD_SOK)
+ {
+ return -1;
+ }
+
+ ret = uart_test();
+ if(ret != 0)
+ {
+ UART_printf("\nMSS UARTA Test Failed!!\n");
+ return ret;
+ }
+
+ UART_printf("\nMSS UARTA Test Completed!\n");
+
+ UART_printf("\n\nStarting MSS UARTB Test...\n");
+ UART_printf("\nCheck the Logs on MSS UARTB console\n");
+ UART_printf("Press 'y' if Test Message on MSS UARTB is Proper, else Press Any Other Key: ");
+
+ UART_Params_init(¶ms);
+
+ uart_handle = UART_open(BOARD_MSS_UARTB_INSTANCE, ¶ms);
+ if(uart_handle == NULL)
+ {
+ return -1;
+ }
+
+ ret = UART_write(uart_handle, (uint8_t *)&gUartTestBuf[0], strlen((const char *)gUartTestBuf));
+ if(!ret)
+ {
+ UART_close(uart_handle);
+ return -1;
+ }
+
+ UART_scanFmt("%c", &p);
+
+ UART_printf("Received: %c\n", p);
+ if ( (p == 'y') || (p == 'Y') ) {
+ UART_printf("\nMSS UARTB Test PASSED!\n");
+ }
+ else {
+ UART_printf("\nMSS UARTB Test FAILED!\n");
+ return -1;
+ }
+
+ UART_printf("\n\nUART Test Completed!!\n");
+
+ UART_close(uart_handle);
+
+ return ret;
+}
#else
int main(void)
{
diff --git a/packages/ti/board/src/tpr12_evm/include/board_cfg.h b/packages/ti/board/src/tpr12_evm/include/board_cfg.h
index 628ce8f9260b45eef4cf589e07cb9e6ede452e72..cdfea798e55e09fa73edf46eee92fc06c1795069 100755 (executable)
/* UART LLD instance number for MSS UART port */
#define BOARD_MSS_UART_INSTANCE (0U)
+#define BOARD_MSS_UARTB_INSTANCE (1U)
+
/* UART LLD instance number for DSS UART port */
#define BOARD_DSS_UART_INSTANCE (0U)