TMDS64EVM: TMDS64EVM, UART

Part Number: TMDS64EVM

Tool/software:

Hello,

Reference : mcu_plus_sdk_am64x_10_01_00_32

All of the Uart driver examples set the receive buffer size of 8 counts.

#define APP_UART_RECEIVE_BUFSIZE      (8U)
uint8_t gUartBuffer[APP_UART_BUFSIZE];
uint8_t gUartReceiveBuffer[APP_UART_RECEIVE_BUFSIZE];
In these examples the Uart handle has the defined and known count of 8.
If I want to send the string of characters of more than 8 and unknown number of characters entry at the keyboard and
expect the echo back the same number of characters. What should be changed in that situation ?
Thanks,
Huynh
  • Hi,

    In this situation, I would like you to think of this as a single character input but in a while loop.

    For example, you keep on inputting the characters one at a time, until you hit a escape sequence, and then UART write no longer happens.

    For example the pseudocode can look like follows:

    inputChar = take input();

    while(inputChar != "/"){

    // continue taking input one by one in this loop

    }

    Let me know if the above looks good to you?

    NOTE: you can change the value of the macro APP_UART_RECEIVE_BUFSIZE to anything more than 8 and it should be just fine, its not hardcoded as such.

    Thanks,

    Vaibhav

  • The issue was centered around the Uart  transaction (trans) with count is set as : 

    trans.count = APP_UART_RECEIVE_BUFSIZE;
    So in order for the receive buffer to accomodate all incoming characters, should the value set at very high number OR set at value of 1 when we are doing
    the while loop and seeking for escape character such as CR/LF or NULL ?
    It seems to me that this is the value set to trigger the UART receive.
    Thanks,
    Huynh
  • One more information. I have application of sending the file. So I have to set at the exact number of file size characters in this field in order for UART to send/receive. If I set it under then the receiving file will be short. If I set it over then the transmitting will not happen until I send more of dummy characters to meet the value. I try to avoid the work around like this. How to avoid setting "trans.count" at least on the transmitting side.

  • I have application of sending the file

    Can you specify if this file is to be sent to a NOR/NAND Flash?

  • No. In my application I will send the file using TeraTerm interface to TMDS64EVM by calling this Uart transaction. After receiving the file which is saved in the buffer then the contents of the buffer will be saved in the I2C EEPROM. Here is the problem as I described before : trans.count = file_byte_count

    If I set the file byte count to be exact as the file size then it is no problem receiving it from the Uart Rx transaction. If I set the under count then my received file will be short. If I set over count then I have to send extra dummy characters to make up for the difference of (over count - file size) which I try to avoid. Of course my file size is not always to be the same so it is hard for me to accommodate with one transfer approach.

    I understand about your question of if the the file is saved in Nor/Nand. It is trivial because the file transfer to NOR/NAND is fixed per transaction (i.e 256KB/page). So no the contents of the file is saved in I2C EEPROM

  • Hi,

    For UART writes(as this is your requirement) allow me sometime to check if I can do some tweaks to enable you to have custom transaction size.

    Allow me few business days to get back on this.

    Thanks,

    Vaibhav

  • From TMDS64EVM the UART Read is what I need. I send the file from TeraTerm terminal which has no problem at all for the file to go through. Only UART Read transaction if the size does not meet the count then it will not trigger the input transaction to the buffer. Or if it the count was set under count (less than the file size sent by TeraTerm terminal then it will trigger the Read transaction but of course the file will be short.

    To be precise : file is sent from test PC via TeraTerm terminal. The file is supposed to received by TMDS64EVM by UART Read transaction. The file size (count) is unknown

  • Hello Kumar,

    Any help or response on this issue ?

  • Hi,

    Let me know if this e2e thread helps you.

     RE: LP-AM243: AM243x UART Polled Mode Issue 

    Thanks,

    Vaibhav

  • Hello Vaibhav,

    Adding : 

    trans.timeout = number_of_CPU_ticks; // enough for getting the TeraTerm to send the file

    and

    count = ((UART_Config *)gUartHandle[CONFIG_UART_CONSOLE])->object->uartLld_handle->readCount;

    will work when the count is short of original setting for trans.count = MAX_BYTE_COUNT; // file size is < than this number

    Thanks to Paul Barker for seeing the same issue.

    Thank you