fixed jungfrau configure bug by getting rid of gb10reset at configure

This commit is contained in:
Dhanya Maliakal
2016-11-08 09:35:34 +01:00
parent 52cf790dde
commit 8aea36b4ef
6 changed files with 50 additions and 6 deletions

View File

@ -167,11 +167,13 @@ void resetFPGA(){
cprintf(BLUE,"\n*** Reseting FPGA ***\n"); cprintf(BLUE,"\n*** Reseting FPGA ***\n");
FPGAdontTouchFlash(); FPGAdontTouchFlash();
FPGATouchFlash(); FPGATouchFlash();
usleep(250*1000);
} }
void FPGAdontTouchFlash(){ void FPGAdontTouchFlash(){
//tell FPGA to not touch flash //tell FPGA to not touch flash
system("echo 0 > /sys/class/gpio/gpio9/value"); system("echo 0 > /sys/class/gpio/gpio9/value");
//usleep(100*1000);
} }
void FPGATouchFlash(){ void FPGATouchFlash(){
@ -1645,7 +1647,7 @@ int configureInterface(uint32_t destip,uint64_t destmac,uint64_t sourcemac,int
#endif #endif
bus_w(CONTROL_REG,GB10_RESET_BIT); //bus_w(CONTROL_REG,GB10_RESET_BIT);
//usleep(50 * 1000); //usleep(50 * 1000);
bus_w(CONTROL_REG,0); bus_w(CONTROL_REG,0);
//usleep(500* 1000); //usleep(500* 1000);
@ -1691,7 +1693,7 @@ int configureMAC(uint32_t destip,uint64_t destmac,uint64_t sourcemac,int source
/*volatile u_int32_t conf= bus_r(CONFIG_REG);*/
uint32_t sourceport = 0x7e9a; // 0xE185; uint32_t sourceport = 0x7e9a; // 0xE185;
int interface=0; int interface=0;
int ngb; int ngb;

View File

@ -312,7 +312,7 @@
#define RUNSTATE_0_BIT 0x00001000 #define RUNSTATE_0_BIT 0x00001000
#define RUNSTATE_1_BIT 0x00002000 #define RUNSTATE_1_BIT 0x00002000
#define RUNSTATE_2_BIT 0x00004000 #define RUNSTATE_2_BIT 0x00004000
#define STOPPED_BIT 0x00008000 // error! #define STOPPED_BIT 0x00008000 // stopped!
#define ALL_FIFO_EMPTY_BIT 0x00010000 // data ready #define ALL_FIFO_EMPTY_BIT 0x00010000 // data ready
#define RUNMACHINE_BUSY_BIT 0x00020000 #define RUNMACHINE_BUSY_BIT 0x00020000
#define READMACHINE_BUSY_BIT 0x00040000 #define READMACHINE_BUSY_BIT 0x00040000

View File

@ -58,8 +58,8 @@ int init_detector(int b) {
if(b){ if(b){
defineGPIOpins(); defineGPIOpins();
resetFPGA(); resetFPGA();
usleep(250*1000); }else
} usleep(300*1000);
if (mapCSP0()==FAIL) { if (mapCSP0()==FAIL) {
printf("Could not map memory\n"); printf("Could not map memory\n");
@ -3180,7 +3180,6 @@ int reset_fpga(int file_des) {
sprintf(mess,"Reset FPGA unsuccessful\n"); sprintf(mess,"Reset FPGA unsuccessful\n");
resetFPGA(); resetFPGA();
usleep(250*1000);
initializeDetector(); initializeDetector();
ret = FORCE_UPDATE; ret = FORCE_UPDATE;

View File

@ -37,6 +37,9 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) {
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdStatus; descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdStatus;
i++; i++;
descrToFuncMap[i].m_pFuncName="datastream"; //
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDataStream;
i++;
/* Detector structure configuration and debugging commands */ /* Detector structure configuration and debugging commands */
@ -1361,6 +1364,44 @@ string slsDetectorCommand::helpStatus(int narg, char *args[], int action) {
} }
string slsDetectorCommand::cmdDataStream(int narg, char *args[], int action) {
#ifdef VERBOSE
cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n");
#endif
int ival=-1;
char ans[100]="";
myDet->setOnline(ONLINE_FLAG);
myDet->setReceiverOnline(ONLINE_FLAG);
if (action==HELP_ACTION)
return helpStatus(narg,args,HELP_ACTION);
if (action==PUT_ACTION) {
if (!sscanf(args[1],"%d",&ival))
return string ("cannot scan datastream mode");
myDet->enableDataStreamingFromReceiver(ival);
}
sprintf(ans,"%d",myDet->enableDataStreamingFromReceiver());
return string(ans);
}
string slsDetectorCommand::helpDataStream(int narg, char *args[], int action) {
ostringstream os;
if (action==GET_ACTION || action==HELP_ACTION)
os << string("datastream \t gets if zmq data stream from receiver is enabled. \n");
if (action==PUT_ACTION || action==HELP_ACTION)
os << string("datastream i\t enables/disables the zmq data stream from receiver. \n");
return os.str();
}
string slsDetectorCommand::cmdFree(int narg, char *args[], int action) { string slsDetectorCommand::cmdFree(int narg, char *args[], int action) {
#ifdef VERBOSE #ifdef VERBOSE

View File

@ -38,6 +38,7 @@ class slsDetectorCommand : public virtual slsDetectorDefs {
static string helpData(int narg, char *args[], int action); static string helpData(int narg, char *args[], int action);
static string helpFrame(int narg, char *args[], int action); static string helpFrame(int narg, char *args[], int action);
static string helpStatus(int narg, char *args[], int action); static string helpStatus(int narg, char *args[], int action);
static string helpDataStream(int narg, char *args[], int action);
static string helpFree(int narg, char *args[], int action); static string helpFree(int narg, char *args[], int action);
static string helpAdd(int narg, char *args[], int action); static string helpAdd(int narg, char *args[], int action);
static string helpRemove(int narg, char *args[], int action); static string helpRemove(int narg, char *args[], int action);
@ -109,6 +110,7 @@ class slsDetectorCommand : public virtual slsDetectorDefs {
string cmdData(int narg, char *args[], int action); string cmdData(int narg, char *args[], int action);
string cmdFrame(int narg, char *args[], int action); string cmdFrame(int narg, char *args[], int action);
string cmdStatus(int narg, char *args[], int action); string cmdStatus(int narg, char *args[], int action);
string cmdDataStream(int narg, char *args[], int action);
string cmdFree(int narg, char *args[], int action); string cmdFree(int narg, char *args[], int action);
string cmdAdd(int narg, char *args[], int action); string cmdAdd(int narg, char *args[], int action);
string cmdRemove(int narg, char *args[], int action); string cmdRemove(int narg, char *args[], int action);