*******************
***   SOLVED    ***
*******************

Hi jack, 

Thanks for all the troubleshooting tips. Upon further investigation, we 
noticed that the RPi was displaying under-voltage errors during bootup as 
well as during the initialization of the ADCs (causing the RPi to 
completely reboot).

This was resolved by changing our 12VDC power supply and we successfully 
ran tutorial 3 :)


Kind Regards,
Brad

On Sunday, 17 February 2019 12:38:35 UTC+4, jackhickish wrote:
>
> Hi Brad,
>
>
>
> On Fri, 15 Feb 2019 at 10:32, Brad Kahn <bradk...@gmail.com <javascript:>> 
> wrote:
>
>> Hi All, 
>>
>> New to the Casper toolflow and hardware so please bear with us. 
>> We are trying to get up and running with the SNAP board by going through 
>> the tutorials from the 2018 workshop 
>> <https://github.com/casper-astro/tutorials_devel/tree/workshop2018>.
>> We can compile and run tutorial 1 successfully, indicating that the 
>> toolflow and software versions are okay (hopefully). 
>>
>
> Excellent -- that is no small feat!
>  
>
>>
>> Unfortunately, we are hitting a problem for* Tutorial 3 (Wideband 
>> Spectrometer)*
>> After supplying a 10Mhz ref at 8dBm, we power up the snap and try to run 
>> the Python script with the precompiled .fpg file 
>> <https://github.com/casper-astro/tutorials_devel/tree/workshop2018/vivado/snap/tut_spec>
>> :
>>
>> python snap_tut_spec.py '192.168.0.2' -b snap_tut_spec.fpg
>>
>>
>> We hit an error when the script attempts:
>>
>> adc.init(samplingRate=sample_rate, numChannel=1, resolution=8)
>>
>> During this function call, we notice that the *Ethernet connection 
>> between the RPi and PC drops for a few seconds* and then we get this 
>> error (extended error message at the end):
>>
>> KatcpRequestFail: Request write on host 192.168.0.2 failed.
>>     Request: ?write adc16_controller 0 \0\0 
>>     Reply: !write fail
>>
>> We tried extending the timeout period but this doesn't seem to help.
>>
>> We first tried using casperfpga libraries from casper-astro github 
>> (pointed to from the casper-astro/tutorials_devel 
>> <https://github.com/casper-astro/tutorials_devel/tree/workshop2018>)
>> We then tried using  casperfpga libraries from ska-sa github (master 
>> <https://github.com/ska-sa/casperfpga>), but got the same errors.
>> *which casperfpga should we be using?*
>>
>>
> For the tutorials, you should definitely be using the casperfpga linked by 
> casper-astro/tutorials_devel which is [should be] the version we used at 
> the workshop. Note that this is currently commit 658d312 
> <https://github.com/casper-astro/casperfpga/tree/658d312e96bfe5ce05699c7290a569e64800da35>,
>  
> not the tip of the master branch. If this doesn't work for some reason, we 
> should fix the submodule reference. 
>  
>
>> We also tried compiling the given snap_tut_spec.slx but still get the 
>> same errors when adc.init() is invoked.
>>
>> Right now, we cannot isolate the problem. We are not sure whether it's 
>> coming from the Linux PC, the RPi or the snap board running 
>> snap_tut_spec.fpg. But the errors indicate some sort of *katcp problem 
>> when reading/writing to adc chips*.
>>
>
> Some questions which may help figure out what's going on --
> What length of cable have you connected the RPi to the SNAP with? For a 
> Pi3, A cable as short as possible is probably a good idea. I don't think 
> this is your problem, because you can program the board fine.
> How are you powering your SNAP -- what is the current limit? Once the 
> 10MHz reference synthesizer is configured, the power consumption of the 
> board will rapidly increase as the ADC/FPGA start clocking. I'm not sure 
> how much power the spectrometer tutorial uses, but it's probably between 
> 1.5 and 2A @ 12V.
> After a crash, can you immediately reconnect to the Pi? (i.e., is 
> something so catastrophic happening that the Pi is rebooting?)
> Does the "adc16_controller" register show up when you do a manual listdev 
> using casperfpga? I think it should because I can see it in the fpg file. 
> Can you manually read this register ok? 
>
> The fact that you get further in the initialization procedure when you 
> have a legitimate 10MHz reference is encouraging. That suggests to me that 
> at least the clock is probably getting configured OK.
>  
> Cheers
> Jack
>
>
>> Any suggestions will be great!
>>
>> HARDWARE:
>>
>>    - SNAP ver2.1.1
>>    - Raspberry Pi 3 model B
>>    - Laptop
>>    
>> SOFTWARE:
>>
>>    - Ubuntu 16.04 xenial 64bit
>>    - Raspberry Pi 3 image from 
>>    
>> https://casper.ssl.berkeley.edu/wiki/SNAP_Bringup#Configuring_a_SNAP_Raspberry_Pi
>>    - https://github.com/casper-astro/tutorials_devel/tree/workshop2018
>>    - https://github.com/casper-astro/casperfpga (commit* ee9c43f*)
>>    - also tried https://github.com/ska-sa/casperfpga (commit * 284a4ba*)
>>    
>> ERROR MESSAGES:
>>
>> brad (workshop2018 *) tut_spec $ python snap_tut_spec.py '192.168.0.2' -b 
>> snap_tut_spec.fpg
>> Connecting to server 192.168.0.2 on port 7147...  ok
>>
>> ------------------------
>> Programming FPGA with snap_tut_spec.fpg... done
>> Attempting to initialize ADC chips...
>> attempt number 0 *<-- added print statement to script here*
>> Traceback (most recent call last):
>>   File "snap_tut_spec.py", line 109, in <module>
>>     if adc.init(samplingRate=800, numChannel=1, resolution=8) == 0:
>>   File "build/bdist.linux-x86_64/egg/casperfpga/snapadc.py", line 139, in 
>> init
>>   File "build/bdist.linux-x86_64/egg/casperfpga/adc.py", line 147, in init
>>   File "build/bdist.linux-x86_64/egg/casperfpga/adc.py", line 398, in 
>> reset
>>   File "build/bdist.linux-x86_64/egg/casperfpga/adc.py", line 180, in 
>> write
>>   File "build/bdist.linux-x86_64/egg/casperfpga/adc.py", line 173, in 
>> _wordCtrl
>>   File "build/bdist.linux-x86_64/egg/casperfpga/adc.py", line 163, in 
>> _bitCtrl
>>   File "build/bdist.linux-x86_64/egg/casperfpga/wishbonedevice.py", line 
>> 8, in _write
>>   File "build/bdist.linux-x86_64/egg/casperfpga/casperfpga.py", line 404, 
>> in write_int
>>   File "build/bdist.linux-x86_64/egg/casperfpga/casperfpga.py", line 151, 
>> in blindwrite
>>   File "build/bdist.linux-x86_64/egg/casperfpga/transport_katcp.py", line 
>> 290, in blindwrite
>>   File "build/bdist.linux-x86_64/egg/casperfpga/transport_katcp.py", line 
>> 175, in katcprequest
>> casperfpga.transport_katcp.KatcpRequestFail: Request write on host 
>> 192.168.0.2 failed.
>>     Request: ?write adc16_controller 0 \0\0 
>>     Reply: !write fail 
>> Request\_write\_timed\_out\_after\_10.005977\_seconds.
>>
>>
>> *Running script without clock source*
>>
>> brad (workshop2018 *) tut_spec $ python snap_tut_spec.py '192.168.0.2' -b 
>> snap_tut_spec.fpg
>> Connecting to server 192.168.0.2 on port 7147...  ok
>>
>> ------------------------
>> Programming FPGA with snap_tut_spec.fpg... done
>> Attempting to initialize ADC chips...
>> attempt number 0
>> ERROR:root:LMX2581 not locked
>> attempt number 1
>> ERROR:root:LMX2581 not locked
>> attempt number 2
>> ERROR:root:LMX2581 not locked
>> done (took 3 attempts)
>> Failed to calibrate after 3 attempts
>> Traceback (most recent call last):
>>   File "snap_tut_spec.py", line 115, in <module>
>>     exit_clean()
>> NameError: name 'exit_clean' is not defined
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "cas...@lists.berkeley.edu <javascript:>" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to casper+un...@lists.berkeley.edu <javascript:>.
>> To post to this group, send email to cas...@lists.berkeley.edu 
>> <javascript:>.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"casper@lists.berkeley.edu" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to casper+unsubscr...@lists.berkeley.edu.
To post to this group, send email to casper@lists.berkeley.edu.

Reply via email to