CWLite/CW305 cannot lock ADC

Hello, I am trying to setup a CW305 with a Chipwhisperer Lite, but I consistently have the problem that scope.clock.reset_adc() fails. I have looked at other posts, mainly at CW-Lite and CW305 - ADC Lock Fail, but none of the solutions work for me. My setup Python script includes the following options:

scope.gain.db = 25
scope.adc.samples = 129
scope.adc.offset = 0
scope.adc.basic_mode = “rising_edge”
scope.clock.adc_src = “extclk_x4”
scope.io.hs2 = “disabled”

target.vccint_set(1.0)
target.pll.pll_enable_set(True)
target.pll.pll_outenable_set(False, 0)
target.pll.pll_outenable_set(True, 1)
target.pll.pll_outenable_set(False, 2)
target.pll.pll_outsource_set(“PLL0”, 0)
target.pll.pll_outfreq_set(10E6, 1)
target.clkusbautooff = True
target.clksleeptime = 1

Even when calling reset_adc() repeatedly, it does not work. The CW305 board settings are J16=0, K16=1, K15=1, L14=1. Printing scope.clock shows:
adc_src = extclk_x4
adc_phase = 0
adc_freq = 0
adc_rate = 0.0
adc_locked = False
freq_ctr = 0
freq_ctr_src = extclk
clkgen_src = system
extclk_freq = 10000000
clkgen_mul = 2
clkgen_div = 1
clkgen_freq = 192000000.0
clkgen_locked = True

What bitfile have you loaded on the CW305?
If it’s not one of ours, is it driving a clock out onto the HS1 pin of the 20-pin connector?
And have you connected the CW-lite to the CW305 with the 20-pin ribbon cable?

The boards are connected; I’m using a bitstream I built of Ibex for cw305, so I think it should have the right clock output?

No, it doesn’t. The Ibex soft-core can be clocked from either the CW305 PLL or from CW-lite’s HS2 output clock, however it doesn’t feed its clock back to CW-lite.
There is more info here, including the setup_ibex notebook that will set everything up for you.

Thanks! That was the issue, clocking Ibex off hs2 solved it. Sorry if this isn’t the right place to ask, but when I use load_demo_system.sh on the Ibex repo (modified to use the cw305 openocd cfg with correct id) to program my firmware .elf I get “invalid command name “load_image””, would you know how to fix this? I’ve tried looking for similar issues or modifying the config and changing openocd versions but found nothing so far.

Sounds like an openocd issue. The lowRISC repository states that version 0.11 or above is required; I’ve used this version successfully:

$ openocd --version
Open On-Chip Debugger 0.11.0+dev-00693-g0a36acbf6 (2022-05-23-22:39)