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.

AM6442: AM6442 met a system hang if any one of ↑↓←→ key be pressed while using MCU plus SDK uart echo demo

Part Number: AM6442
Other Parts Discussed in Thread: SYSCONFIG

Dear Team,

We found there is a system hang if  any one of ↑↓←→ key be pressed while using uart echo demo.

 But it can echo normally if we input 12345678,log as below:

This is uart echo test blocking mode
Receives 8 characters then echo's back. Please input..
12345678
All tests have passed!!

Could you give some advice ?

Thanks,

jimin.li

  • Hi Jimin,

    Assuming you are using CCS, pressing the arrow buttons should not cause system hang. Its just that the system would wait until you input all the 8 characters.

    Moreover, I am assuming you are not considering arrows as characters because they don't have ascii codes.

    Also instead of 12345678, you can go for any character of length 8, for example aaaaaaaa.

    One follow up I would need from your end is: "Can you check again if there system hang ? And if that's the case can you take a screenshot of CCS window and provide me the same."

    Thanks,

    Vaibhav

  • Dear Vaibhav Kumar,

    Thanks for your reply.

    Yes,it exactly as your points. Arrow buttons be presses but not up to 8 characters caused  no "All tests have passed!!" log and ascci codes be displayed on console. It seems like a system hang phenomenone,but it is not true.

    Assuming you are using CCS, pressing the arrow buttons should not cause system hang. Its just that the system would wait until you input all the 8 characters.

    Yes,it can normally ouput aaaaaaaa.

    Also instead of 12345678, you can go for any character of length 8, for example aaaaaaaa.

    Thanks, 

    jimin.li

  • Hi Jimin, 

    It seems like you query has been answered by Vaibhav. If your query has been resolved, please close the thread.

    Thanks & Regards,

    Tushar

  • Dear  Tushar Thakur,

    Thanks!

    Dear Vaibhav Kumar,

    Could you kindly give some advice,is there anyway to read bytes from uart but not to designate specific numbers?

    For example,if we press up arrow button,now we need to initial trans.count=3.But if we want to input a number 1,we need to intial trans.count =1.How to read a flexible length context from uart?

    Thanks,

    jimin.li

  • Hi Jimin,

    I am not sure about the dynamic length of data to be read... for example, changing the number of bytes to be read while taking the input.

    This could be done with some code changes in functions like UART_read() and UART_write(), but its better to understand/decide the number of bytes you are going to play with. You can change that in sysconfig itself as shown in the image below.

    Hopefully this helps.

    Regards,

    Vaibhav

  • Dear Vaibhav Kumar,

    Thanks for your reply.

    I think 8 characters meanings for 8 bytes(one bytes has 8-bit length,not 5.6.7) which uart read in function UART_read().

    The data length of 8-bit your points is the data length for each uart transfer.So there will have 8 times 8-bit uart transactions.

    Now i have an idea to get a flexible length data from uart. Just need to make some changes on function UART_readData called by UART_read(). 

    Raw code as below, get a specific size then read size of chars from uart.

    Then change to  Check RX_FIFO_E bit in UART_LSR register.If RX fifo has no data then return.

    Thanks,

    jimin.li