Skip to content

Commit c8be2f2

Browse files
authored
Merge pull request #10 from Mu2e/scorrodi/gr4
FE: additional sleeps for reliability of configuration
2 parents 147fe5b + e7ae5fc commit c8be2f2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

otsdaq-mu2e-crv/FEInterfaces/ROCCosmicRayVetoInterface_interface.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,8 @@ void ROCCosmicRayVetoInterface::pause(void) {}
363363
void ROCCosmicRayVetoInterface::resume(void) {}
364364

365365
//==============================================================================
366-
void ROCCosmicRayVetoInterface::start(std::string) { // runNumber)
366+
void ROCCosmicRayVetoInterface::start(std::string) { // runNumber)
367+
ResetRxBuffers();
367368
// take pedestrals
368369
//this->writeRegister(FEB::AllFEB|FEB::AllFPGA|FEB::CSRBroadCast, 0x100);
369370
//TLOG(TLVL_Start) << "Taking pedestrals" << __E__;
@@ -421,6 +422,7 @@ void ROCCosmicRayVetoInterface::ResetRxBuffers() {
421422
this->writeRegister(ROC::GTP_CRC, 0x1);
422423
this->writeRegister(ROC::CRS, 0x300);
423424
this->writeRegister(ROC::GTP_CRC, 0x1);
425+
sleep(1);
424426
}
425427
void ROCCosmicRayVetoInterface::SoftReset(__ARGS__)
426428
{
@@ -572,15 +574,17 @@ void ROCCosmicRayVetoInterface::RocConfigure(bool gr, uint16_t grn, uint16_t uBo
572574

573575
// enable package forwarding based on markers
574576
//this->writeRegister(ROC::CR, 0x20);
577+
usleep(1000000);
578+
//return;
575579
SetMarkerSync(true);
576580

577-
this->writeRegister(ROC::Clk80MHz, 0x0); // enable the 80MHz clock alignment
581+
this->writeRegister(ROC::Clk80MHz, 0x1); // enable the 80MHz clock alignment
578582

579583
// Set CSR of data-FPGAs
580584
// bit 3: FM Rx Enable
581585
// bit 5: DDR Write Sequencer Enable
582586
// bit 7: DDR read sequencer Enable
583-
this->writeRegister(ROC::Data_Broadcast|ROC::Data_CRC, 0xA8); //
587+
this->writeRegister(ROC::Data_Broadcast|ROC::Data_CRC, 0xA8); //
584588

585589
// Reset input buffers
586590
ResetRxBuffers();

0 commit comments

Comments
 (0)