<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:14pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 14pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, "EmojiFont", "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<p>Dear friends,</p>
<p><br>
</p>
<p>I now had a look at the system where the V560 was running. It was also setup by Bastian. And there the code for the V560 module is slightly different from the one included in the NURDLIB branch that I am using on the test system.</p>
<p><br>
</p>
<p>Maybe you can have a look at it.</p>
<p><br>
</p>
<p>I also could push the complete NURDLIB from this system, if this helps.</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p>Best greetings</p>
<p>Günter<br>
</p>
<p><br>
</p>
<p><br>
</p>
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> subexp-daq <subexp-daq-bounces@lists.chalmers.se> im Auftrag von Weber, Guenter Dr. <g.weber@hi-jena.gsi.de><br>
<b>Gesendet:</b> Dienstag, 20. Februar 2024 10:58:27<br>
<b>An:</b> Discuss use of Nurdlib, TRLO II, drasi and UCESB.<br>
<b>Betreff:</b> [subexp-daq] Report of a possible bug of the CAEN_V560 module</font>
<div> </div>
</div>
<div>
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 14pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, "EmojiFont", "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<p>Dear friends,</p>
<p><br>
</p>
<p>I now grabbed a V560 module that was working fine in another DAQ system and put it into our test system.</p>
<p><br>
</p>
<p>The main.cfg looks like this:</p>
<p><br>
</p>
<p></p>
<div style="color:#cccccc; background-color:#1f1f1f; font-family:Consolas,'Courier New',monospace; font-weight:normal; font-size:14px; line-height:19px; white-space:pre">
<div><span style="color:#569cd6">log_level</span><span style="color:#cccccc">=spam
</span><span style="color:#6a9955"># info, verbose, debug, spam</span></div>
<br>
<div><span style="color:#cccccc">CRATE(</span><span style="color:#ce9178">"MCAL"</span><span style="color:#cccccc">) {
</span></div>
<div><span style="color:#cccccc"> GSI_VULOM(0x03000000) {</span></div>
<div><span style="color:#cccccc"> </span><span style="color:#569cd6">timestamp</span><span style="color:#cccccc"> = true
</span><span style="color:#6a9955"># needed to get timestamps in the data output</span></div>
<div><span style="color:#cccccc"> </span><span style="color:#6a9955"># ecl=0..15</span></div>
<div><span style="color:#cccccc"> }</span></div>
<div><span style="color:#cccccc"> BARRIER</span></div>
<div><span style="color:#cccccc"> CAEN_V560(0x333333300) {</span></div>
<div><span style="color:#cccccc"> </span><span style="color:#569cd6">use_veto</span><span style="color:#cccccc"> = true</span></div>
<div><span style="color:#cccccc"> } </span></div>
<div><span style="color:#6a9955"># CAEN_V767A(0x03100000) {</span></div>
<div><span style="color:#6a9955"># }</span></div>
<div><span style="color:#cccccc">}</span></div>
</div>
<br>
<p></p>
<p>Starting the DAQ now results in a freeze of the RIO4. A reset of the crate is necessary to talk to it again.</p>
<p><br>
</p>
<p>The problem occurs in the first slow init of the V560 module. To find the exact line, I added some output to CRATE.C:</p>
<p><br>
</p>
<p></p>
<div>10: crate/crate.c:923: .Slow-init module[0]=GSI_VULOM.<br>
before push_log_level(module)<br>
before a_crate->module_init_id = module->id<br>
before module->props->init_slow(a_crate, module)<br>
LOG: TRLO: MD5SUM: 0x1409285e (CT: 63bb1d44 = 2023-01-08 19:45:08 UTC)<br>
before module_init_id_mark(a_crate, module)<br>
before pop_log_level(module)<br>
10: crate/crate.c:923: .Slow-init module[1]=CAEN_V560.<br>
before push_log_level(module)<br>
before a_crate->module_init_id = module->id<br>
before module->props->init_slow(a_crate, module)</div>
<p></p>
<p><br>
</p>
<p>The CRATE.C code now looks like this:</p>
<p><br>
</p>
<p></p>
<div style="color:#cccccc; background-color:#1f1f1f; font-family:Consolas,'Courier New',monospace; font-weight:normal; font-size:14px; line-height:19px; white-space:pre">
<div><span style="color:#cccccc"> </span><span style="color:#569cd6">TAILQ_FOREACH</span><span style="color:#cccccc">(</span><span style="color:#9cdcfe">module</span><span style="color:#cccccc">,
</span><span style="color:#d4d4d4">&</span><span style="color:#9cdcfe">a_crate</span><span style="color:#cccccc">-></span><span style="color:#9cdcfe">module_list</span><span style="color:#cccccc">, next) {</span></div>
<div><span style="color:#cccccc"> </span><span style="color:#c586c0">if</span><span style="color:#cccccc"> (</span><span style="color:#569cd6">NULL</span><span style="color:#cccccc">
</span><span style="color:#d4d4d4">==</span><span style="color:#cccccc"> </span><span style="color:#9cdcfe">module</span><span style="color:#cccccc">-></span><span style="color:#9cdcfe">props</span><span style="color:#cccccc">) {</span></div>
<div><span style="color:#cccccc"> </span><span style="color:#c586c0">continue</span><span style="color:#cccccc">;</span></div>
<div><span style="color:#cccccc"> }</span></div>
<div><span style="color:#cccccc"> </span><span style="color:#569cd6">LOGF</span><span style="color:#cccccc">(info)(</span><span style="color:#569cd6">LOGL</span><span style="color:#cccccc">,
</span><span style="color:#ce9178">"Slow-init module[</span><span style="color:#9cdcfe">%u</span><span style="color:#ce9178">]=</span><span style="color:#9cdcfe">%s</span><span style="color:#ce9178">."</span><span style="color:#cccccc">,
</span><span style="color:#9cdcfe">module</span><span style="color:#cccccc">-></span><span style="color:#9cdcfe">id</span><span style="color:#cccccc">,</span></div>
<div><span style="color:#cccccc"> </span><span style="color:#dcdcaa">keyword_get_string</span><span style="color:#cccccc">(</span><span style="color:#9cdcfe">module</span><span style="color:#cccccc">-></span><span style="color:#9cdcfe">type</span><span style="color:#cccccc">));</span></div>
<div><span style="color:#cccccc"> </span><span style="color:#dcdcaa">printf</span><span style="color:#cccccc">(</span><span style="color:#ce9178">"before push_log_level(module)
</span><span style="color:#d7ba7d">\n</span><span style="color:#ce9178">"</span><span style="color:#cccccc">);</span></div>
<div><span style="color:#cccccc"> </span><span style="color:#dcdcaa">push_log_level</span><span style="color:#cccccc">(</span><span style="color:#9cdcfe">module</span><span style="color:#cccccc">);</span></div>
<div><span style="color:#cccccc"> </span><span style="color:#dcdcaa">printf</span><span style="color:#cccccc">(</span><span style="color:#ce9178">"before a_crate->module_init_id = module->id
</span><span style="color:#d7ba7d">\n</span><span style="color:#ce9178">"</span><span style="color:#cccccc">);</span></div>
<div><span style="color:#cccccc"> </span><span style="color:#9cdcfe">a_crate</span><span style="color:#cccccc">-></span><span style="color:#9cdcfe">module_init_id</span><span style="color:#cccccc">
</span><span style="color:#d4d4d4">=</span><span style="color:#cccccc"> </span><span style="color:#9cdcfe">module</span><span style="color:#cccccc">-></span><span style="color:#9cdcfe">id</span><span style="color:#cccccc">;</span></div>
<div><span style="color:#cccccc"> </span><span style="color:#dcdcaa">printf</span><span style="color:#cccccc">(</span><span style="color:#ce9178">"before module->props->init_slow(a_crate, module)
</span><span style="color:#d7ba7d">\n</span><span style="color:#ce9178">"</span><span style="color:#cccccc">);</span></div>
<div><span style="color:#cccccc"> </span><span style="color:#c586c0">if</span><span style="color:#cccccc"> (</span><span style="color:#d4d4d4">!</span><span style="color:#9cdcfe">module</span><span style="color:#cccccc">-></span><span style="color:#9cdcfe">props</span><span style="color:#cccccc">-></span><span style="color:#9cdcfe">init_slow</span><span style="color:#cccccc">(</span><span style="color:#9cdcfe">a_crate</span><span style="color:#cccccc">,
</span><span style="color:#9cdcfe">module</span><span style="color:#cccccc">)) {</span></div>
<div><span style="color:#cccccc"> </span><span style="color:#dcdcaa">printf</span><span style="color:#cccccc">(</span><span style="color:#ce9178">"before pop_log_level(module)
</span><span style="color:#d7ba7d">\n</span><span style="color:#ce9178">"</span><span style="color:#cccccc">);</span></div>
<div><span style="color:#cccccc"> </span><span style="color:#dcdcaa">pop_log_level</span><span style="color:#cccccc">(</span><span style="color:#9cdcfe">module</span><span style="color:#cccccc">);</span></div>
<div><span style="color:#cccccc"> </span><span style="color:#dcdcaa">printf</span><span style="color:#cccccc">(</span><span style="color:#ce9178">"before goto crate_init_done
</span><span style="color:#d7ba7d">\n</span><span style="color:#ce9178">"</span><span style="color:#cccccc">);</span></div>
<div><span style="color:#cccccc"> </span><span style="color:#c586c0">goto</span><span style="color:#cccccc">
</span><span style="color:#c8c8c8">crate_init_done</span><span style="color:#cccccc">;</span></div>
<div><span style="color:#cccccc"> }</span></div>
<div><span style="color:#cccccc"> </span><span style="color:#dcdcaa">printf</span><span style="color:#cccccc">(</span><span style="color:#ce9178">"before module_init_id_mark(a_crate, module)
</span><span style="color:#d7ba7d">\n</span><span style="color:#ce9178">"</span><span style="color:#cccccc">);</span></div>
<div><span style="color:#cccccc"> </span><span style="color:#dcdcaa">module_init_id_mark</span><span style="color:#cccccc">(</span><span style="color:#9cdcfe">a_crate</span><span style="color:#cccccc">,
</span><span style="color:#9cdcfe">module</span><span style="color:#cccccc">);</span></div>
<div><span style="color:#cccccc"> </span><span style="color:#dcdcaa">printf</span><span style="color:#cccccc">(</span><span style="color:#ce9178">"before pop_log_level(module)
</span><span style="color:#d7ba7d">\n</span><span style="color:#ce9178">"</span><span style="color:#cccccc">);</span></div>
<div><span style="color:#cccccc"> </span><span style="color:#dcdcaa">pop_log_level</span><span style="color:#cccccc">(</span><span style="color:#9cdcfe">module</span><span style="color:#cccccc">);</span></div>
<div><span style="color:#cccccc"> }</span></div>
</div>
<br>
<p></p>
<p>Thus, to me it looks like the check "<span>if (!module->props->init_slow(a_crate, module)) ...</span>" is doing something quite horrible to the RIO4.</p>
<p><br>
</p>
<p>This is unfortunate, because my original aim was to show that there is also a bug/mistake in readout_dt of the V560 module. But I did not come this far.</p>
<p><br>
</p>
<p>Do you have any idea what might cause the freezing of the RIO4?</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p>Best greetings and many thanks</p>
<p>Günter<br>
</p>
<p><br>
</p>
<p><br>
</p>
<br>
</div>
</div>
</div>
</body>
</html>