James Tavares has uploaded this change for review.

View Change

simtrace2-tool: hack: kick the comms by sending a fake message

This is a workaround until the root cause of the communications failure
between simtrace2-tool and simtrace2 firmware is identified. Additional
details provided on simtrace mailing list.

Change-Id: I40fa06bee5d8194516497e16597e069124ddf0fb
---
M host/include/osmocom/simtrace2/simtrace2_api.h
M host/lib/simtrace2_api.c
M host/src/simtrace2-tool.c
3 files changed, 23 insertions(+), 0 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/64/26864/1
diff --git a/host/include/osmocom/simtrace2/simtrace2_api.h b/host/include/osmocom/simtrace2/simtrace2_api.h
index d658d16..3a7e5ae 100644
--- a/host/include/osmocom/simtrace2/simtrace2_api.h
+++ b/host/include/osmocom/simtrace2/simtrace2_api.h
@@ -44,6 +44,7 @@
int osmo_st2_slot_tx_msg(struct osmo_st2_slot *slot, struct msgb *msg,
uint8_t msg_class, uint8_t msg_type);

+int osmo_st2_generic_do_error_none(struct osmo_st2_cardem_inst *ci);

int osmo_st2_cardem_request_card_insert(struct osmo_st2_cardem_inst *ci, bool inserted);
int osmo_st2_cardem_request_pb_and_rx(struct osmo_st2_cardem_inst *ci, uint8_t pb, uint8_t le);
diff --git a/host/lib/simtrace2_api.c b/host/lib/simtrace2_api.c
index 4ad7eb7..beb6de4 100644
--- a/host/lib/simtrace2_api.c
+++ b/host/lib/simtrace2_api.c
@@ -155,6 +155,24 @@
}

/***********************************************************************
+ * Generic protocol
+ ***********************************************************************/
+
+/*! \brief Send an empty DO_ERROR message to the simtrace2 board */
+int osmo_st2_generic_do_error_none(struct osmo_st2_cardem_inst *ci)
+{
+ struct msgb *msg = st_msgb_alloc();
+ struct cardemu_usb_msg_error *err;
+
+ LOGSLOT(ci->slot, LOGL_NOTICE, "<= %s\n", __func__);
+
+ err = (struct cardemu_usb_msg_error *) msgb_put(msg, sizeof(*err));
+ memset(err, 0, sizeof(*err));
+
+ return osmo_st2_slot_tx_msg(ci->slot, msg, SIMTRACE_MSGC_GENERIC, SIMTRACE_CMD_DO_ERROR);
+}
+
+/***********************************************************************
* Card Emulation protocol
***********************************************************************/

diff --git a/host/src/simtrace2-tool.c b/host/src/simtrace2-tool.c
index d92638f..407eac9 100644
--- a/host/src/simtrace2-tool.c
+++ b/host/src/simtrace2-tool.c
@@ -297,6 +297,10 @@
fprintf(stderr, "can't obtain EP addrs; rc=%d\n", rc);
goto close_exit;
}
+
+ // HACK: kick the board with a fake message to get subsequent messages to be accepted
+ // TODO: figure out the real problem, and remove this
+ osmo_st2_generic_do_error_none(ci);
}

if (argc - optind <= 0) {

To view, visit change 26864. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I40fa06bee5d8194516497e16597e069124ddf0fb
Gerrit-Change-Number: 26864
Gerrit-PatchSet: 1
Gerrit-Owner: James Tavares <jtavares@kvh.com>
Gerrit-MessageType: newchange