[subexp-daq] NURDLIB - possible bug in SIS3316

Håkan T Johansson f96hajo at chalmers.se
Wed Jun 5 20:30:47 CEST 2024


Dear Günter,

to me it looks like your suspicion is right and adc_mem_i is not 
incremented properly.

Could you please try to replace all occurences of '++adc_mem_i;' with 
'adc_mem_i += sizeof (uint32_t);' and see if that works?

Cheers,
Håkan



On Wed, 5 Jun 2024, Weber, Guenter Dr. wrote:

> 
> Dear friends,
> 
> 
> when we switch on the DISCARD_DATA feature, we get a failed memory access error in line 2905 of sis_3316.c. The discard option
> triggers the if clause starting in line 2855.
> 
> 
> We think that the problem lies in the value of ADC_MEM_I in
> 
> 
> MAP_READ_OFS(a_sis3316->sicy_map, adc_fifo_memory_fifo(adc), adc_mem_i);
> 
> 
> ADC_MEM_I is incremented by one after each memory access after line 2886. However, we think it should be incremented by the size
> of the element that we read. Here is what Bastian did in 2021:
> 
> 
>         volatile uint32_t *adc_mem;
> ...
>         adc_mem = a_sis3316->arr->adc_fifo_memory_fifo[adc];
>         *outp++ = *adc_mem++; /* timestamp 1 */
>         *outp++ = *adc_mem++; /* timestamp 2 */
> 
>         if (a_sis3316->config.use_accumulator2 == 1 ||
>             a_sis3316->config.use_accumulator6 == 1) {
>             int i;
>             /* both must be set! */
>             assert(a_sis3316->config.use_accumulator2 == 1);
>             assert(a_sis3316->config.use_accumulator6 == 1);
>             for (i = 0; i < 9; ++i) {
>                 *outp++ = *adc_mem++; /* peak + gates */
>             }
>         }
> 
> Incrementing the pointer ADC_MEM in Bastian's code should shift the address by SIZEOF(UINT32_T), right?
> 
> 
> Maybe you could look into this issue.
> 
> 
> 
> 
> Thank you very much!
> 
> 
> 
> Best greetings
> 
> Günter
> 
> 
> 
> 
> 
> ----------------
> 
> Günter Weber
> 
> Helmholtz-Institut Jena
> Fröbelstieg 3
> 07743 Jena
> Germany
> Phone: +49-3641-947605
> www.hi-jena.de
> 
> GSI Helmholtzzentrum für Schwerionenforschung
> Planckstrasse 1
> 64291 Darmstadt
> Germany
> www.gsi.de
> 
>


More information about the subexp-daq mailing list