Hi,

I’m having an issue with the casperfpga tool.
When I try to upload my .fpg file to my red pitaya using the 
upload_to_ram_and_program function, it returns “true”. However the program does 
not appear run, when looking at the LED’s and looking at the digital ports and 
analog ports with an oscilloscope. I have tried using the .fpg tutorial files 
and got the same result:

In [1]: import casperfpga

In [2]: fpga = casperfpga.CasperFpga('rp-f0ea58.local')
In [3]: 
fpga.upload_to_ram_and_program('/home/casper/Downloads/tut_adc_dac_2019-07-16_1041.fpg')
Out[3]: True

In [4]: fpga.test_connection()
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[4], line 1
----> 1 fpga.test_connection()

File 
~/work/cfpga_venv/lib/python3.8/site-packages/casperfpga/casperfpga.py:434, in 
CasperFpga.test_connection(self)
    430 def test_connection(self):
    431     """
    432     Write to and read from the scratchpad to test the connection to the 
FPGA
    433     """
--> 434     return self.transport.test_connection()

File 
~/work/cfpga_venv/lib/python3.8/site-packages/casperfpga/transport_katcp.py:382,
 in KatcpTransport.test_connection(self)
    380     val2 = struct.unpack('>L', val2[0:4])[0]
    381     if val != val2:
--> 382         raise RuntimeError('%s: cannot write scratchpad? %i != %i' %
    383                            (self.host, val, val2))
    384 return True

RuntimeError: rp-f0ea58.local: cannot write scratchpad? 10855845 != 0


When I try to upload my design via the red pitaya recommended path 
(https://redpitaya-knowledge-base.readthedocs.io/en/latest/learn_fpga/3_vivado_env/tutorfpga2.html)
 it works without a problem. I am then even able to communicate with the red 
pitaya from my casperfpga, indicating that the problem lies with the 
upload_to_ram_and_program function:

In [7]: 
fpga.upload_to_ram_and_program('CASPER_repos/test_red_pitaya_adc_dac/outputs/test_red_pitaya_adc_dac_2025-11-18_1405.fpg')
Out[7]: True

In [8]: fpga.test_connection()
Out[8]: True

In [9]: fpga.write_int('counter_ctrl1',100000)

I hope you can help me with this issue.
Thanks in advance for your time.

Kind regards,
Flint Wardenaar BSc
Electronics engineer
Pronouns: he/him


[cid:[email protected]]

Leiden University | Faculty of Science - ELD | +31 643793301 | 
www.universiteitleiden.nl/en<https://www.universiteitleiden.nl/en>

-- 
You received this message because you are subscribed to the Google Groups 
"[email protected]" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/4d5b8ff9b88b4b45a7287d9a4e006049%40Physics.LeidenUniv.nl.

Reply via email to