]> sigrok.org Git - libsigrokdecode.git/commitdiff
jtag_stm32: Always switch state on new instruction
authorGeorge Hopkins <redacted>
Thu, 30 Nov 2017 14:58:05 +0000 (15:58 +0100)
committerUwe Hermann <redacted>
Thu, 3 May 2018 14:08:07 +0000 (16:08 +0200)
decoders/jtag_stm32/pd.py

index 4cd58bbfdc501188b58727a0d3fe7e0fbdbbd980..593ce137bc8dc25aad587f442b3baec110dd8b20 100644 (file)
@@ -232,11 +232,7 @@ class Decoder(srd.Decoder):
             val, self.samplenums = val
             self.samplenums.reverse()
 
-        # State machine
-        if self.state == 'IDLE':
-            # Wait until a new instruction is shifted into the IR register.
-            if cmd != 'IR TDI':
-                return
+        if cmd == 'IR TDI':
             # Switch to the state named after the instruction, or 'UNKNOWN'.
             # The STM32F10xxx has two serially connected JTAG TAPs, the
             # boundary scan tap (5 bits) and the Cortex-M3 TAP (4 bits).
@@ -246,7 +242,9 @@ class Decoder(srd.Decoder):
             self.putf(4, 8, [1, ['IR (BS TAP): ' + bstap_ir]])
             self.putf(0, 3, [1, ['IR (M3 TAP): ' + self.state]])
             self.putx([2, ['IR: %s' % self.state]])
-        elif self.state == 'BYPASS':
+
+        # State machine
+        if self.state == 'BYPASS':
             # Here we're interested in incoming bits (TDI).
             if cmd != 'DR TDI':
                 return