diff options
author | Mike Leach <mike.leach@linaro.org> | 2023-12-05 14:56:31 +0000 |
---|---|---|
committer | Mike Leach <mike.leach@linaro.org> | 2023-12-18 14:58:45 +0000 |
commit | 242e9c153089dedf10521d86b1f638e9092f699f (patch) | |
tree | 76f85d3020cc15efe3c01b183f21a600d4273ccd | |
parent | bb6979a64ef1b91776b26821791717f161d477bb (diff) | |
download | OpenCSD-242e9c153089dedf10521d86b1f638e9092f699f.tar.gz |
opencsd: stm: Fix init of Master and Channel IDs (github #61)
Master and channel IDs were not being correctly set when decoder was reset.
Additionally they were not reset when a VERSION packet is received (Github issue #61)
Reported-by: MommeSherif on github.com
Signed-off-by: Mike Leach <mike.leach@linaro.org>
-rw-r--r-- | decoder/source/stm/trc_pkt_decode_stm.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/decoder/source/stm/trc_pkt_decode_stm.cpp b/decoder/source/stm/trc_pkt_decode_stm.cpp index 1bb8d73..1a99869 100644 --- a/decoder/source/stm/trc_pkt_decode_stm.cpp +++ b/decoder/source/stm/trc_pkt_decode_stm.cpp @@ -142,6 +142,8 @@ void TrcPktDecodeStm::resetDecoder() m_payload_odd_nibble = false; m_output_elem.init(); m_swt_packet_info.swt_flag_bits = 0; // zero out everything + m_swt_packet_info.swt_master_id = 0; + m_swt_packet_info.swt_channel_id = 0; initPayloadBuffer(); } @@ -174,7 +176,11 @@ ocsd_datapath_resp_t TrcPktDecodeStm::decodePacket(bool &bPktDone) resetDecoder(); break; - case STM_PKT_VERSION: /**< Version packet - not relevant to generic (versionless) o/p */ + case STM_PKT_VERSION: /**< Version packet - no output but forces current IDs to 0 */ + m_swt_packet_info.swt_master_id = m_curr_packet_in->getMaster(); + m_swt_packet_info.swt_channel_id = m_curr_packet_in->getChannel(); + break; + case STM_PKT_ASYNC: /**< Alignment synchronisation packet */ case STM_PKT_INCOMPLETE_EOT: /**< Incomplete packet flushed at end of trace. */ // no action required. @@ -216,7 +222,7 @@ ocsd_datapath_resp_t TrcPktDecodeStm::decodePacket(bool &bPktDone) m_swt_packet_info.swt_id_valid = 1; break; - case STM_PKT_C8: /**< Set lower 8 bits of current channel - packet proc hadnles this */ + case STM_PKT_C8: /**< Set lower 8 bits of current channel - packet proc handles this */ case STM_PKT_C16: /**< Set current channel */ m_swt_packet_info.swt_channel_id = m_curr_packet_in->getChannel(); break; |