From 34e2db12555852bbc062ed11073bf35330f3bf9f Mon Sep 17 00:00:00 2001 From: Fredrik Thulin Date: Fri, 13 May 2016 14:36:41 +0200 Subject: update FMC test for alpha --- projects/board-test/fmc-test.c | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) (limited to 'projects/board-test') diff --git a/projects/board-test/fmc-test.c b/projects/board-test/fmc-test.c index a6efbef..98e950f 100644 --- a/projects/board-test/fmc-test.c +++ b/projects/board-test/fmc-test.c @@ -90,7 +90,7 @@ int main(void) // Blink blue LED for six seconds to not upset the Novena at boot. led_on(LED_BLUE); - for (i = 0; i < 12; i++) { + for (i = 0; i < 4; i++) { HAL_Delay(500); led_toggle(LED_BLUE); } @@ -130,7 +130,7 @@ int main(void) led_toggle(LED_YELLOW); successful_runs++; - sleep = 100; + sleep = 0; } else { led_on(LED_RED); failed_runs++; @@ -192,6 +192,16 @@ int test_fpga_data_bus(void) } } + data_diff = buf; + data_diff ^= rnd; + + uart_send_string("Sample of data bus test data: expected "); + uart_send_binary(rnd, 32); + uart_send_string(", got "); + uart_send_binary(buf, 32); + uart_send_string(", diff "); + uart_send_binary(data_diff, 32); + uart_send_string("\r\n"); // return number of successful tests return c; } @@ -213,9 +223,10 @@ int test_fpga_address_bus(void) hal_result = HAL_RNG_GenerateRandomNumber(&rng_inst, &rnd); if (hal_result != HAL_OK) break; - // we only have 2^22 32-bit words - //rnd &= 0x00FFFFFC; - rnd &= 0x0007FFFC; + // there are 26 physicaly connected address lines on the alpha, + // but "only" 24 usable for now (the top two ones are used by FMC + // to choose bank, and we only have one bank set up currently) + rnd &= 0x3fffffc; // don't test zero addresses (fpga will store data, not address) if (rnd == 0) continue; @@ -250,6 +261,17 @@ int test_fpga_address_bus(void) } } + addr_diff = buf; + addr_diff ^= rnd; + + uart_send_string("Sample of addr bus test data: expected "); + uart_send_binary(rnd, 32); + uart_send_string(", got "); + uart_send_binary(buf, 32); + uart_send_string(", diff "); + uart_send_binary(addr_diff, 32); + uart_send_string("\r\n"); + return c; } -- cgit v1.2.3