summaryrefslogtreecommitdiff
path: root/util/ectool.c
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2018-04-20 15:40:00 +0200
committerchrome-bot <chrome-bot@chromium.org>2018-04-25 14:40:50 -0700
commit53019df3a6ffe3f3a67ac0c7613e543da0fd9e3c (patch)
treee16532b2de9e58b8dcc0b5179e43b2b53ee413d3 /util/ectool.c
parent01a99552df8b2bb3ff43c2304c67542616bd3e64 (diff)
downloadchrome-ec-53019df3a6ffe3f3a67ac0c7613e543da0fd9e3c.tar.gz
ectool: add a workaround for EC_CMD_FP_TEMPLATE
When issuing a host command whose request packet length is equal to the maximum size (ie max_request_packet_size as returned by EC_CMD_GET_PROTOCOL_INFO), the command currently fails with STM32H7 over SPI host protocol. The finger template upload through the EC_CMD_FP_TEMPLATE host command fails due to the issue as it 'optimizes' the chunk length to the maximum size. For now, workaround this issue by removing a 32-bit word (aka 4 bytes) to max_request_packet_size, so we never hit this corner case. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=b:78544921 TEST=On Meowth, run 'ectool --name=cros_fp fptemplate finger0.bin' and see it succeeding. Change-Id: I52072ddeb12534045c37ab30df301a60c8841199 Reviewed-on: https://chromium-review.googlesource.com/1026680 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'util/ectool.c')
-rw-r--r--util/ectool.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/ectool.c b/util/ectool.c
index 33c75ee17e..d70ffed571 100644
--- a/util/ectool.c
+++ b/util/ectool.c
@@ -1382,8 +1382,9 @@ int cmd_fp_template(int argc, char *argv[])
{
struct ec_response_fp_info r;
struct ec_params_fp_template *p = ec_outbuf;
+ /* TODO(b/78544921): removing 32 bits is a workaround for the MCU bug */
int max_chunk = ec_max_outsize
- - offsetof(struct ec_params_fp_template, data);
+ - offsetof(struct ec_params_fp_template, data) - 4;
int idx = -1;
char *e;
int size;