From 42c18859f37f970dd12637fb33fa267f1477eea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Sat, 22 Apr 2023 18:10:33 +0200 Subject: [PATCH] [core] Update ltchiptool to fix activating OTA --- cores/common/base/lt_api.c | 10 ++++++++-- platform.json | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cores/common/base/lt_api.c b/cores/common/base/lt_api.c index d8af241..7259fd0 100644 --- a/cores/common/base/lt_api.c +++ b/cores/common/base/lt_api.c @@ -149,11 +149,17 @@ bool lt_flash_erase_block(uint32_t offset) { } uint32_t lt_flash_read(uint32_t offset, uint8_t *data, size_t length) { - return fal_partition_read(fal_root_part, offset, data, length); + int ret = fal_partition_read(fal_root_part, offset, data, length); + if (ret == -1) + return 0; + return ret; } uint32_t lt_flash_write(uint32_t offset, const uint8_t *data, size_t length) { - return fal_partition_write(fal_root_part, offset, data, length); + int ret = fal_partition_write(fal_root_part, offset, data, length); + if (ret == -1) + return 0; + return ret; } /*__ __ diff --git a/platform.json b/platform.json index e93ec23..4e21916 100644 --- a/platform.json +++ b/platform.json @@ -101,7 +101,7 @@ }, "tool-ltchiptool": { "type": "uploader", - "version": "https://github.com/libretuya/ltchiptool#v4.0.0a0", + "version": "https://github.com/libretuya/ltchiptool#v4.0.0a4", "version_prefix": true, "note": "This is used only for C/C++ code from ltchiptool." },