Skip to content

Commit

Permalink
[nrfconnect] Fix BDX transfer resumption (project-chip#22401) (projec…
Browse files Browse the repository at this point in the history
…t-chip#22412)

When OTA is interrupted in the middle of a BDX transfer
and the transfer is then re-initiated after the 5-minute
idle timeout, it may fail with the following error:

dfu_target_stream: stream_flash_buffered_write error -12

Signed-off-by: Damian Krolik <[email protected]>

Signed-off-by: Damian Krolik <[email protected]>

Signed-off-by: Damian Krolik <[email protected]>
Co-authored-by: Damian Królik <[email protected]>
Co-authored-by: Andrei Litvin <[email protected]>
  • Loading branch information
3 people authored Sep 8, 2022
1 parent 8913534 commit 5e6279c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/platform/nrfconnect/OTAImageProcessorImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ CHIP_ERROR OTAImageProcessorImpl::PrepareDownloadImpl()
writer.image_id = image_id;
writer.open = [](int id, size_t size) { return dfu_target_init(DFU_TARGET_IMAGE_TYPE_MCUBOOT, id, size, nullptr); };
writer.write = [](const uint8_t * chunk, size_t chunk_size) { return dfu_target_write(chunk, chunk_size); };
writer.close = [](bool success) { return dfu_target_done(success); };
writer.close = [](bool success) { return success ? dfu_target_done(success) : dfu_target_reset(); };

ReturnErrorOnFailure(System::MapErrorZephyr(dfu_multi_image_register_writer(&writer)));
};
Expand Down
2 changes: 1 addition & 1 deletion src/platform/nrfconnect/OTAImageProcessorImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class OTAImageProcessorImpl : public OTAImageProcessorInterface
bool IsFirstImageRun() override;
CHIP_ERROR ConfirmCurrentImage() override;

private:
protected:
CHIP_ERROR PrepareDownloadImpl();
CHIP_ERROR ProcessHeader(ByteSpan & aBlock);

Expand Down

0 comments on commit 5e6279c

Please sign in to comment.