Skip to content

Commit

Permalink
[nrfconnect] Fix BDX transfer resumption
Browse files Browse the repository at this point in the history
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 <damian.krolik@nordicsemi.no>
  • Loading branch information
Damian-Nordic committed Sep 5, 2022
1 parent 9d1aabd commit c450526
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 c450526

Please sign in to comment.