I am trying to piece together a very basic example for CW Husky, how to capture unlimited streaming trace, looking at docs and some examples where it’s used (e.g. CW305 demos).
Though I can’t piece it together. Doesn’t have to be jupyter notebook, maybe for performance reasons a python script would be more reasonable.
What I’d like to see for STM32F3 (on UFO) or ATSAM4S2AA target (CW313 board):
- Capture predefined large amount of traces (1M or 1G), at max possible speed (which is around 20 or 24 MS/s, 8-bit based on docs). Trigger is TIO4 (let’s use simpleserial-aes for this)
- Capture the traces like in #1 but as soon as cell is started, do not wait for any trigger
- You can’t capture any pin, just the one connected to measurement port, right? What if you connected the measure port to some other pin, would shunt resistor interfere?
Saving trace I’d probably do something simplistic like pickle it or put into CSV from array in RAM. On-the-fly saving would be for later, if it’s even possible for OS+python+disc to handle such write speed reliably.
Any simple example for the unlimited capture?
Hm maybe I did it, just took a while to graph the 1M+ sample graph (wouldn’t work in PyCharm, needed browser due to ZMQ race condition). Not sure at this point, since I didn’t set 8-bit mode, neither the speed, just basically
scope.adc.stream_mode = True and
scope.adc.samples = 1200000, rising edge on TIO4.
Looks about corrent judging the very left corner for AES rounds, but 12-bit? Here is
cwhusky Device sn = 50203120374a38503230343138303037 fpga_buildtime = 3/2/2023, 21:35 fw_version = major = 1 minor = 5 debug = 0 gain = mode = high gain = 7 db = 18.211009174311926 adc = state = False basic_mode = rising_edge timeout = 2 offset = 0 presamples = 10000 samples = 1200000 decimate = 1 trig_count = 8129 stream_mode = True test_mode = False bits_per_sample = 12 segments = 1 segment_cycles = 0 segment_cycle_counter_en = False clip_errors_disabled = False lo_gain_errors_disabled = False errors = False clock = clkgen_src = system clkgen_freq = 7370129.87012987 adc_mul = 1 adc_freq = 7370129.87012987 freq_ctr = 0 freq_ctr_src = extclk clkgen_locked = True adc_phase = 0 extclk_monitor_enabled = False extclk_error = False extclk_tolerance = 102.996826171875 trigger = module = basic triggers = tio4 io = tio1 = serial_rx tio2 = serial_tx tio3 = high_z tio4 = high_z pdid = high_z pdic = high_z nrst = high_z glitch_hp = False glitch_lp = False extclk_src = hs1 hs2 = clkgen target_pwr = True tio_states = (1, 1, 1, 0) cdc_settings = bytearray(b'\x00\x00\x00\x00') aux_io_mcx = high_z glitch_trig_mcx = trigger glitch = enabled = False mmcm_locked = False num_glitches = 1 clk_src = target width = 0 offset = 0 trigger_src = manual arm_timing = after_scope ext_offset = 0 repeat = 1 output = clock_xor phase_shift_steps = 4592 ADS4128 = mode = normal low_speed = True hi_perf = 2 LA = present = True enabled = False clkgen_enabled = False locked = False clk_source = pll trigger_source = glitch oversampling_factor = 1 sampling_clock_frequency = 0.0 downsample = 1 capture_group = glitch capture_depth = 0 trace = present = True enabled = False errors = False trace_synced = False trace_mode = parallel trace_width = 4 clock = fe_clock_alive = True fe_clock_src = usb_clock clkgen_enabled = False fe_freq = 96000000.0 swo_clock_locked = False swo_clock_freq = 0.0 capture = trigger_source = firmware trigger use_husky_arm = False raw = True rules_enabled =  rules =  mode = while_trig count = 0 max_triggers = 1 triggers_generated = 1 record_syncs = False matched_pattern_data = 0000000000000000 matched_pattern_counts = [0, 0, 0, 0, 0, 0, 0, 0] XADC = status = good current temperature [C] = 50.3 maximum temperature [C] = 52.4 user temperature alarm trigger [C] = 80.0 user temperature reset trigger [C] = 59.9 device temperature alarm trigger [C] = 89.9 device temperature reset trigger [C] = 59.9 vccint = 0.998 vccaux = 1.797 vccbram = 0.998 userio = mode = normal direction = 0 drive_data = 0 status = 511 LEDs = setting = 0 (default, as labelled) errors = sam_errors = False sam_led_setting = Default XADC errors = False ADC errors = False extclk error = False trace errors = False