summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorNamyoon Woo <namyoon@chromium.org>2019-08-22 13:49:39 -0700
committerCommit Bot <commit-bot@chromium.org>2019-08-23 22:35:46 +0000
commitfe402aec3c8014e16828fee2bfa921eeffbc39fe (patch)
treee84113e6da2f70f7fa2f406f4bbf9fb6ff087dd7 /util
parent34bfaabb452a2261d16a969c9bda32e1bc2b71da (diff)
downloadchrome-ec-fe402aec3c8014e16828fee2bfa921eeffbc39fe.tar.gz
util: uartupdatetool: do not strip trailing white space
uartupdatetool won't ignore trailing white space. It will erase flash segments for sure corresponding to that part. BUG=b:139884342 BRANCH=None TEST=manually ran flash_ec on hatch through ccd with two different binaries: one ${IMG1} has less trailing 0xFF space than the other ${IMG2}. flash_ec --board hatch --image ${IMG1} --verify flash_ec --board hatch --image ${IMG2} --verify Change-Id: Id25a9e05a2d2df76255dd688f829dee48dc819cf Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1766099 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
Diffstat (limited to 'util')
-rw-r--r--util/uut/main.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/util/uut/main.c b/util/uut/main.c
index 6c924ae011..cde439ba17 100644
--- a/util/uut/main.c
+++ b/util/uut/main.c
@@ -253,7 +253,6 @@ int main(int argc, char *argv[])
char aux_buf[MAX_FILE_NAME_SIZE];
uint32_t size = 0;
uint32_t addr = 0;
- uint32_t strip_size;
enum sync_result sr;
uint8_t *buffer;
int sync_cnt;
@@ -318,14 +317,9 @@ int main(int argc, char *argv[])
if (!buffer)
exit_uart_app(EC_FILE_ERR);
- /* Ignore the trailing white space to speed up writing */
- strip_size = size;
- while ((strip_size > 0) && (buffer[strip_size-1] == 0xFF))
- strip_size--;
-
printf("Write file %s at %d with %d bytes\n",
- file_name, flash_offset, strip_size);
- if (image_auto_write(flash_offset, buffer, strip_size)) {
+ file_name, flash_offset, size);
+ if (image_auto_write(flash_offset, buffer, size)) {
printf("Flash Done.\n");
free(buffer);
exit_uart_app(EC_OK);