This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM5716: How does "UART_scanFmt" work?

Part Number: AM5716

Hello TI Team,

"Questions"
I want to confirm that the board can send and receive UART.
I am trying to check using "UART_printf" for UART transmission and "UART_scanFmt" for UART reception.
In the PDK, I found a simple source code "buzzer_test.c" that uses the above two functions, so I am using it as a reference to implement the test code.
⇒C:\pdk_am57xx_1_0_15\packages\ti\board\diag\buzzer\src\buzzer_test.c
UART_printf" is working properly, but "UART_scanFmt" is not working (not accepting input).
Do you have the necessary code, configuration, environment, etc. to run UART_scanFmt?

"Operation Procedure"
1. Have a microSD for SD boot that runs the test code, and set it on the board (with the power off).
2. Connect the board and PC serially, and connect to the board with Teraterm from PC.
3. Turn on the power of the board and run the test code.
4. The text output by UART_printf will be output on Teraterm.
5. Type one character on Teraterm and press Enter, because it is supposed to be waiting for input by UART_scanFmt.
6. The input character is supposed to be output on Teraterm, but actually nothing happens (only carriage return is performed by Enter).

"Contents of the test code used"
After executing Board_init(boardCfg), "buzzer_test" function in buzzer_test.c is executed.
However, in the "buzzer_test" function, all the processes related to GPIO are commented out.
(We just want to check the operation of "UART_printf" and "UART_scanFmt".

The following flags are set in boardCfg passed to board_init.
BOARD_INIT_PLL_OPP_NOM
BOARD_INIT_UNLOCK_MMR
BOARD_INIT_MODULE_CLOCK
BOARD_INIT_PINMUX_CONFIG
board_init_ddr
board_init_uart_stdio
board_init_watchdog_disable

  • Hi,

    I have checked the code, it is working on my setup. Also, no need to use those many flags for testing UART, only BOARD_INIT_UART_STDIO and BOARD_INIT_PINMUX_CONFIG is enough while testing from CCS, or only BOARD_INIT_UART_STDIO is enough while testing through SD boot.

    We are having UART diagnostic under same folder - C:\ti\pdk_am57xx_1_0_XX\packages\ti\board\diag\uart\ – you can check the same.

  • Hi,

    Thanks for the reply.

    I used the following functions in my boot program
    C:\ti\pdk_am57xx_1_0_15\packages\ti\board\diag\uart\src\uart_diag.c, uart_test()

    The main function of my boot program does the following
    --------------------------------
    1) Board_init(boardCfg);
    ->boardCfg is what I wrote before. You don't need many flags, but I think no change is necessary.
    2) SBL_SlaveCorePrcmEnable();
    3) UART_stdioInit(BOARD_UART_INSTANCE);
    4) uart_test();
    ->In this one, run UART_printf and UART_scanFmt.
    --------------------------------
    In uart_diag.c, the following processes are done before uart_test.
    Are these always necessary for UART_scanFmt to work properly?
    -Board_pinMuxSetModeWkup
    -enableMAINI2C
    -BoardDiag_enableUART1Sel
    -BoardDiag_enableMAIN0UART

    I have an additional question, are the following TeraTerm settings correct?

    --------------------------------

    [Terminal setup]

    New-line

     Receive:CR

     Transmit:CR

    Local echo:checked

    Auto switch:Unchecked

     

    [Serial port setup]

    Speed:115200

    Data:8 bit

    Parity:none

    Stop bits:1 bit

    Flow control:none

    Transmit delay:0msec/char 0msec/line

    --------------------------------

  • Hi,

    1) Can you confirm, whether you are able to run uart diagnostic successfully?

    2)

    UART_stdioInit(BOARD_UART_INSTANCE);

    If you are using BOARD_INIT_UART_STDIO in board_init(), then no need to do this.

    3)

    In uart_diag.c, the following processes are done before uart_test.
    Are these always necessary for UART_scanFmt to work properly?
    -Board_pinMuxSetModeWkup
    -enableMAINI2C
    -BoardDiag_enableUART1Sel
    -BoardDiag_enableMAIN0UART

    We are having different main functions in uart_diag.c for different SOCs. In your case (AM571x), these are not needed.

    4)

    I have an additional question, are the following TeraTerm settings correct?

    All settings are fine, but you can unchecked Local echo (this will not cause any issue).

    5)are you getting prints on console, after your last edit ?