mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-11-18 17:24:04 +01:00
force writing of udp header aligned and in order, fixed xilinx ctb crash on p rx_hostname
This commit is contained in:
1 parent
63138c9f04
commit
dd50a21b59
1 file changed
+11
-2
@@ -1502,8 +1502,9 @@ int configureMAC() {
|
||||
}
|
||||
#endif
|
||||
|
||||
// get struct memory
|
||||
udp_header *udp = (udp_header *)(Arm_getUDPBaseAddress());
|
||||
// build udp header
|
||||
udp_header header;
|
||||
udp_header *udp = &header;
|
||||
memset(udp, 0, sizeof(udp_header));
|
||||
|
||||
// mac addresses
|
||||
@@ -1535,6 +1536,14 @@ int configureMAC() {
|
||||
|
||||
calcChecksum(udp);
|
||||
|
||||
// force FPGA writes to be aligned and in order
|
||||
volatile uint32_t *dst = (volatile uint32_t *)Arm_getUDPBaseAddress();
|
||||
uint32_t words[sizeof(udp_header) / sizeof(uint32_t)];
|
||||
memcpy(words, udp, sizeof(udp_header));
|
||||
for (size_t i = 0; i != sizeof(words) / sizeof(words[0]); ++i) {
|
||||
dst[i] = words[i];
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user