From 1ee0be1ef00f2be29210edee155716e6f359d2f5 Mon Sep 17 00:00:00 2001 From: Fredrik Thulin Date: Wed, 2 Sep 2015 16:55:21 +0200 Subject: Make post-mortem analysis using gdb easier. Use a number of volatile (in-memory) variables to track status in order to be able to break the program anywhere in the "have failed" loop and see what failed with both address and data tests. --- src/fmc-test/src/main.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/fmc-test/src/main.c b/src/fmc-test/src/main.c index 69c5bb0..ce04bee 100644 --- a/src/fmc-test/src/main.c +++ b/src/fmc-test/src/main.c @@ -34,6 +34,8 @@ //------------------------------------------------------------------------------ RNG_HandleTypeDef rng_inst; +volatile uint32_t data_diff = 0; +volatile uint32_t addr_diff = 0; //------------------------------------------------------------------------------ @@ -88,26 +90,25 @@ int main(void) led_off(GPIO_PIN_LED_BLUE); // vars - int test_ok; + volatile int data_test_ok = 0, addr_test_ok = 0, successful_runs = 0; // main loop (test, until an error is detected) while (1) { // test data bus - test_ok = test_fpga_data_bus(); + data_test_ok = test_fpga_data_bus(); + // test address bus + addr_test_ok = test_fpga_address_bus(); // check for errors (abort testing in case of error) - if (test_ok < TEST_NUM_ROUNDS) break; - - - // test address bus - test_ok = test_fpga_address_bus(); + if (data_test_ok < TEST_NUM_ROUNDS) break; // check for errors (abort testing in case of error) - if (test_ok < TEST_NUM_ROUNDS) break; + if (addr_test_ok < TEST_NUM_ROUNDS) break; // toggle yellow led to indicate, that we are alive led_toggle(GPIO_PIN_LED_YELLOW); + successful_runs++; } // error handler @@ -135,6 +136,7 @@ int test_fpga_data_bus(void) // run some rounds of data bus test for (c=0; c