From d284744c0bee49a9ec04d70a240942ef1bb636a3 Mon Sep 17 00:00:00 2001 From: Michael Wiebusch Date: Wed, 17 Dec 2014 12:21:12 +0100 Subject: [PATCH] introduced a sleep in init_system, so FPGAs have slightly more time to start up before address-lookup and assignment --- tools/init_system.pl | 2 +- tools/unpacker/unpacker.cxx | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/init_system.pl b/tools/init_system.pl index 43e64a6..2bb3c43 100755 --- a/tools/init_system.pl +++ b/tools/init_system.pl @@ -53,7 +53,7 @@ print("GBE:\t".join(", ", map {sprintf("%04x",$_)} @gbe)."\n"); run("trbcmd reset"); -sleep 1; +sleep 2; #Set addresses run(DAQTOOLSPATH."/tools/merge_serial_address.pl ".DAQTOOLSPATH."/base/serials_trb3.db ".CONFIGPATH."/network/addresses_trb3.db"); diff --git a/tools/unpacker/unpacker.cxx b/tools/unpacker/unpacker.cxx index fa7f919..b756f59 100644 --- a/tools/unpacker/unpacker.cxx +++ b/tools/unpacker/unpacker.cxx @@ -177,6 +177,7 @@ signed analyzeSubEvent(hadaq::RawSubevent* sub, unsigned pos, unsigned datalen, frame_timestamp = sub->Data(pdata++); } else if (dversion == 0x2){ + v2 = 1; data = sub->Data(pdata); frame_id = (data & 0x000000ff); frame_id = (source << 16) | frame_id; @@ -208,7 +209,7 @@ signed analyzeSubEvent(hadaq::RawSubevent* sub, unsigned pos, unsigned datalen, #endif if (sub->Data(pdata) != 0x55555555) { - printf("ERROR: Sensor Header (0x55555555) Not Found! (got: %08x)\n",sub->Data(pdata)); + //printf("ERROR: Sensor Header (0x55555555) Not Found! (got: %08x)\n",sub->Data(pdata)); return -1; } @@ -217,7 +218,7 @@ signed analyzeSubEvent(hadaq::RawSubevent* sub, unsigned pos, unsigned datalen, sensorIsValid = 1; //statistics[mySensor][FRVALID]++; } - else if(frame_status == 0xff) { // New Format, DVERSION 0x2+ + else if(frame_status == 0x0f) { // New Format, DVERSION 0x2+ sensorIsValid = 1; //statistics[mySensor][FRVALID]++; } @@ -226,7 +227,7 @@ signed analyzeSubEvent(hadaq::RawSubevent* sub, unsigned pos, unsigned datalen, statistics[mySensor][FRBROKEN]++; } - if(sensorIsValid){ + if(sensorIsValid && frame_length>0x0){ //Hey Sensor, tell me who you are! pdata++; unsigned sensorNumber = sub->Data(pdata++); -- 2.43.0