Skip to content
Snippets Groups Projects
Commit 6a76bb69 authored by Patrick Robbe's avatar Patrick Robbe
Browse files

Add pcie40_reload

parent 91f09ae0
No related branches found
No related tags found
No related merge requests found
*~
*.pyc
*.log
Driver/pcie40_reload/pcie40_reload
Driver/pcie40_reload/pcie40_reload.out/
......@@ -6,7 +6,7 @@ include $(TOP)/common/flags.mk
SCRIPTS :=pcie40_reload.sh
SCRIPTS_INSTALL =$(DAQ40_PREFIX)/pcie40_reload
PCIE40_RELOAD_SUID :=pcie40_reload_suid
PCIE40_RELOAD_SUID :=pcie40_reload
PCIE40_RELOAD_SUID_OBJS =main.o
PCIE40_RELOAD_SUID_CFLAGS =$(CFLAGS)
PCIE40_RELOAD_SUID_INSTALL =$(SCRIPTS_INSTALL)
......
......@@ -16,10 +16,10 @@ int main(int argc, char *argv[])
perror("readlink");
return -1;
}
if (setresuid(0,0,0)) {
perror("setresuid");
return -1;
}
// if (setresuid(0,0,0)) {
// perror("setresuid");
// return -1;
//}
snprintf(script_path, sizeof(script_path), "%s/pcie40_reload.sh", dirname(here_path));
return execvp(script_path, argv);
}
......@@ -57,6 +57,13 @@ def _crc16(data, crc, table):
import socket
hname = socket.gethostname()
# initialize belle2 link in PCIe40
mem.write( 0 , 0x00050100 , 0x0 )
mem.write( 0 , 0x00050100 , 0x4 )
mem.write( 0 , 0x00050100 , 0x0 )
mem.write( 0 , 0x00050100 , 0x4 )
mem.write( 0 , 0x00050100 , 0x0 )
for nev in range( 10 ):
# Send trigger (adapt this line to your system)
......@@ -72,7 +79,7 @@ for nev in range( 10 ):
time.sleep( 2 )
status, val = mem.read( 0 , 0x00050080)
size = val
print "Number of words received = {0}".format( size )
if size == 0:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment