Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apps/examples: add uart_loopback_test #6299

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ewoodev
Copy link
Contributor

@ewoodev ewoodev commented Jul 16, 2024

This is a test example where you can short-circuit the uart tx and rx boards to perform a loopback test. This test sends "1234567890abcdefghijklmnopqrstuvwxyz" and recive same string

You can use CONIFG_UART_LOOPBACK_PORT to specify the port for the loopback test.

[TEST RESULT]
TASH>>uart_loopback
TASH>>######################### UART HW test START #########################
SEND SIZE: 37
SEND UART: 1234567890abcdefghijklmnopqrstuvwxyz
RECIVE SIZE: 37
RECIVE UART: 1234567890abcdefghijklmnopqrstuvwxyz
UART LOOPBACK TEST: PASSED
;######################### UART HW test END ###########################

@ewoodev ewoodev force-pushed the WORK-240716_uartloopback_test branch from 951dac4 to f80bf67 Compare July 17, 2024 02:16
apps/examples/uart_loopback_test/Makefile Outdated Show resolved Hide resolved
apps/examples/uart_loopback_test/uart_loopback_test.c Outdated Show resolved Hide resolved
apps/examples/uart_loopback_test/uart_loopback_test.c Outdated Show resolved Hide resolved
apps/examples/uart_loopback_test/uart_loopback_test.c Outdated Show resolved Hide resolved
apps/examples/uart_loopback_test/uart_loopback_test.c Outdated Show resolved Hide resolved
read_total_size += ret_size;
}
printf("RECIVE SIZE: %d\n", read_total_size);
printf("RECIVE UART: %s\n", read_buf);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RECEIVE SIZE and UART?
How about Received Message and Size?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed "RECEIVE(%d): %s\n"

#define TEST_STR "1234567890abcdefghijklmnopqrstuvwxyz"
#define TEST_STR_LEN 37

static int uart_tx_loop(void)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this named loop?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first time, i have made one time test, but i changed to repeat test

apps/examples/uart_loopback_test/uart_loopback_test.c Outdated Show resolved Hide resolved
apps/examples/uart_loopback_test/uart_loopback_test.c Outdated Show resolved Hide resolved
apps/examples/uart_loopback_test/uart_loopback_test.c Outdated Show resolved Hide resolved
@sunghan-chang
Copy link
Contributor

@ewoodev Any plan to update?

@ewoodev ewoodev force-pushed the WORK-240716_uartloopback_test branch 3 times, most recently from d00088f to 7e5bddd Compare October 28, 2024 11:39
sunghan-chang
sunghan-chang previously approved these changes Oct 28, 2024
@ewoodev ewoodev force-pushed the WORK-240716_uartloopback_test branch 2 times, most recently from ff6cec9 to 89969db Compare October 28, 2024 13:07
This is a test example where you can short-circuit the uart tx and rx boards to perform a loopback test.
This test sends "1234567890abcdefghijklmnopqrstuvwxyz" and recive same string

You can use CONIFG_UART_LOOPBACK_PORT to specify the port for the loopback test.

[TEST RESULT]

TASH>>uart_loopback start
TASH>>######################### UART loopback test START #########################
UART RX THREAD START
UART TX THREAD START
SEND UART(1): 1234567890abcdefghijklmnopqrstuvwxyz
RECEIVE(1): 1234567890abcdefghijklmnopqrstuvwxyz
RESULT(1): PASSED
SEND UART(2): 1234567890abcdefghijklmnopqrstuvwxyz
RECEIVE(2): 1234567890abcdefghijklmnopqrstuvwxyz
RESULT(2): PASSED
SEND UART(3): 1234567890abcdefghijklmnopqrstuvwxyz
RECEIVE(3): 1234567890abcdefghijklmnopqrstuvwxyz
RESULT(3): PASSED
@ewoodev ewoodev force-pushed the WORK-240716_uartloopback_test branch from 89969db to 6cdb20a Compare October 28, 2024 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants