Re-arming after edge count trigger

Hi, i am trying to trigger on a specific bit of UART message, i am able to do that with the edge counter, but after the first glitch it shows errors and i am unable to glitch again. I have to restart the whole device to be able to glitch again. The errors i am getting are

XADC errors = False
ADC errors = gain too low error,
extclk error = False
trace errors = False

This is my setup:

uart_baud = 9600


scope.default_setup()
#setup Husky
target.baud = uart_baud

reset_target(scope)

scope.glitch.enabled = True
scope.glitch.output = 'enable_only' # output only for glitch.repeat
scope.glitch.clk_src = 'pll'
scope.glitch.repeat = 400
scope.glitch.offset = 0
scope.glitch.trigger_src = 'ext_continuous'
#scope.glitch.trigger_src = 'ext_single'
scope.io.glitch_lp = True
scope.gain.db = 12
scope.adc.gain = 12

#setup husky for UART trigger
scope.trigger.triggers = 'tio2'


scope.io.tio2 = 'serial_tx'

# UART trigger setup
# scope.trigger.module = 'UART'
# scope.UARTTrigger.enabled = True
# scope.UARTTrigger.baud = uart_baud
# scope.UARTTrigger.trigger_source = 0 

scope.trigger.module = 'edge_counter'
scope.trigger.edges = 3


scope.adc.enabled = False

# glitch trigger is MCX input
scope.io.aux_io_mcx = 'high_z'
chipwhisperer
# MCX pin as trigger
scope.io.glitch_trig_mcx = 'glitch'

and this is the Actual code that should be running:

import time 

while 1:
    scope.arm()
    scope.trigger.edges = 3
    time.sleep(1)
    target.write('\x17')
    time.sleep(1)

If i clear the errors with scope.errors.clear() and then try to arm it nothing happens, the Armed led does not light up, and the device does not trigger.

If someone has encountered this before it will be very helpfull if they share there solution.

Best Regards

The issue is that because you’re not calling cw.capture_trace(), the scope isn’t getting disarmed.
You just need to disarm it manually prior to arming:
scope.sc.arm(False)
It’s harmless to run this on a scope that’s not armed, so you can simply put this right before scope.arm().

Thank you. That worked