aboutsummaryrefslogtreecommitdiff
path: root/projects/board-test
diff options
context:
space:
mode:
authorFredrik Thulin <fredrik@thulin.net>2016-05-13 14:36:41 +0200
committerFredrik Thulin <fredrik@thulin.net>2016-05-14 16:07:01 +0200
commit34e2db12555852bbc062ed11073bf35330f3bf9f (patch)
tree997d6d59df6e4ca71f268c1dda7394010153bc98 /projects/board-test
parent9bbc0727f6cc9a527b5853dded05e39f1eb36b29 (diff)
update FMC test for alpha
Diffstat (limited to 'projects/board-test')
-rw-r--r--projects/board-test/fmc-test.c32
1 files changed, 27 insertions, 5 deletions
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;
}