laforge has submitted this change. ( https://gerrit.osmocom.org/c/simtrace2/+/30181 )
Change subject: firmware/sniffer: Fix programming error in PPS
......................................................................
firmware/sniffer: Fix programming error in PPS
process_byte_pps() would never enter the error path in which the
first byte would be != 0xff. However, the caller already verified
this before calling process_byte_pps() so the error path should
never be hit anyway.
Change-Id: Ia74b6338219a6965e6bd35a6efcf369890e02d81
---
M firmware/libcommon/source/sniffer.c
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, approved
Hoernchen: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c
index cbfa7c9..da5d743 100644
--- a/firmware/libcommon/source/sniffer.c
+++ b/firmware/libcommon/source/sniffer.c
@@ -595,7 +595,7 @@
switch (pps_state) { /* see ISO/IEC 7816-3:2006 section 9.2 */
case PPS_S_WAIT_PPSS: /*!< initial byte */
flags = 0;
- if (0xff) {
+ if (byte == 0xff) {
pps_cur[0] = byte;
pps_state = PPS_S_WAIT_PPS0; /* go to next state */
} else {
--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/30181
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ia74b6338219a6965e6bd35a6efcf369890e02d81
Gerrit-Change-Number: 30181
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: tsaitgaist <kredon(a)sysmocom.de>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/simtrace2/+/30179 )
Change subject: firmware/sniffer: Log old and new state in ISO7816-3 state changes
......................................................................
firmware/sniffer: Log old and new state in ISO7816-3 state changes
Change-Id: Iddb460cc2ad02c11a74de10dab127bb14cee9605
---
M firmware/libcommon/source/sniffer.c
1 file changed, 2 insertions(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, approved
Hoernchen: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c
index 1647e17..e3b7fbb 100644
--- a/firmware/libcommon/source/sniffer.c
+++ b/firmware/libcommon/source/sniffer.c
@@ -302,9 +302,10 @@
break;
}
+ TRACE_INFO("ISO 7816-3 state %u->%u\n\r", iso_state, iso_state_new);
+
/* save new state */
iso_state = iso_state_new;
- TRACE_INFO("Changed to ISO 7816-3 state %u\n\r", iso_state);
}
const struct value_string data_flags[] = {
--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/30179
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Iddb460cc2ad02c11a74de10dab127bb14cee9605
Gerrit-Change-Number: 30179
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: tsaitgaist <kredon(a)sysmocom.de>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/simtrace2/+/30176 )
Change subject: firmware/sniffer: Log parity errors, just like overruns and framing errors
......................................................................
firmware/sniffer: Log parity errors, just like overruns and framing errors
Reading of code + datasheet showed that we did enable parity checking
but never actually checked if the USART has the PARE bit in CSR set.
Let's change that. Plus also avoid possible race conditions due to
multiple status resets via US_CR_RSTSTA. Let's only reset that once
per interrupt handler.
TODO: actually do something useful at that point. We currently don't
report those to the host, nor do we attempt to recover in any way. The
data sheet also doesn't tell us what it actually does in such
situations; it appears the character is *not* returned from the USART,
so we're missing one byte in the stream at that point.
Change-Id: I5f012d86c61a2377d355396e7b95d078952bee7c
Related: OS#5464
---
M firmware/libcommon/source/sniffer.c
1 file changed, 7 insertions(+), 7 deletions(-)
Approvals:
laforge: Looks good to me, approved
Hoernchen: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c
index 86dfd3a..13ef506 100644
--- a/firmware/libcommon/source/sniffer.c
+++ b/firmware/libcommon/source/sniffer.c
@@ -800,14 +800,14 @@
/* Read channel status register */
uint32_t csr = sniff_usart.base->US_CSR;
/* Verify if there was an error */
- if (csr & US_CSR_OVRE) {
- TRACE_WARNING("USART overrun error\n\r");
+ if (csr & US_CSR_OVRE)
+ TRACE_ERROR("USART overrun error\n\r");
+ if (csr & US_CSR_FRAME)
+ TRACE_ERROR("USART framing error\n\r");
+ if (csr & US_CSR_PARE)
+ TRACE_ERROR("USART parity error\n\r");
+ if (csr & (US_CSR_OVRE|US_CSR_FRAME|US_CSR_PARE))
sniff_usart.base->US_CR |= US_CR_RSTSTA;
- }
- if (csr & US_CSR_FRAME) {
- TRACE_WARNING("USART framing error\n\r");
- sniff_usart.base->US_CR |= US_CR_RSTSTA;
- }
/* Verify if character has been received */
if (csr & US_CSR_RXRDY) {
--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/30176
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I5f012d86c61a2377d355396e7b95d078952bee7c
Gerrit-Change-Number: 30176
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: tsaitgaist <kredon(a)sysmocom.de>
Gerrit-MessageType: merged