Skip to content

Commit

Permalink
[test] Enable high baud rates on silicon
Browse files Browse the repository at this point in the history
Signed-off-by: James Wainwright <[email protected]>
  • Loading branch information
jwnrt committed Jun 10, 2024
1 parent b2334e4 commit 75d6d19
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions sw/device/tests/uart_baud_rate_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,17 @@ static const uint32_t kBaseAddrs[4] = {
TOP_EARLGREY_UART2_BASE_ADDR,
TOP_EARLGREY_UART3_BASE_ADDR,
};
static const uint32_t kBauds[9] = {4800, 9600, 19200, 38400, 57600,
115200, 230400, 128000, 256000};
static const uint32_t kBauds[11] = {4800, 9600, 19200, 38400,
57600, 115200, 230400, 128000,
256000, 1000000, 1500000};

enum {
kTestTimeoutMillis = 500000,
// Number of Bauds to test from `kBauds`.
kBaudCountSilicon = 11,
// The two highest Bauds won't work at the clock speed we run the FPGAs at.
kBaudCountFpga = 9,

};

typedef enum test_phase {
Expand Down Expand Up @@ -107,9 +113,12 @@ bool test_main(void) {
CHECK_STATUS_OK(
uart_testutils_select_pinmux(&pinmux, uart_idx, kUartPinmuxChannelDut));

size_t baud_count =
kDeviceType == kDeviceSilicon ? kBaudCountSilicon : kBaudCountFpga;

// Check every baud rate is sent and received okay.
status_t result = OK_STATUS();
for (size_t baud_idx = 0; baud_idx < ARRAYSIZE(kBauds); ++baud_idx) {
for (size_t baud_idx = 0; baud_idx < baud_count; ++baud_idx) {
baud_rate = kBauds[baud_idx];
EXECUTE_TEST(result, test_uart_baud);
}
Expand Down

0 comments on commit 75d6d19

Please sign in to comment.