Skip to content

Fix Srecord file parsing#19

Merged
benedekkupper merged 4 commits into
mainfrom
develop
Apr 20, 2026
Merged

Fix Srecord file parsing#19
benedekkupper merged 4 commits into
mainfrom
develop

Conversation

@benedekkupper

Copy link
Copy Markdown
Member

Closes #18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses S-record parsing failures when termination (S7/S8/S9) records are missing by ensuring pending data is flushed at EOF, and strengthens detection of overlapping segments.

Changes:

  • Flush pending SREC segment data at end-of-file even without S7/S8/S9 terminators.
  • Throw an explicit exception when parsed segments overlap instead of silently ignoring the add.
  • Bump package/project versions and add comprehensive file-format parsing tests (Intel HEX + SREC).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
LibUsbDfu/LibUsbDfu.csproj Bumps LibUsbDfu version and updates DeviceProgramming dependency to 1.0.9.
LibUsbDfu.Cli/LibUsbDfu.Cli.csproj Bumps CLI version and aligns referenced LibUsbDfu package version.
DeviceProgramming/FileFormat/TextRecordParser.cs Throws on overlapping segments during segment flush.
DeviceProgramming/FileFormat/SRecord.cs Flushes any pending segment at EOF to support SREC files without terminators.
DeviceProgramming/DeviceProgramming.csproj Bumps DeviceProgramming package version to 1.0.9.
DeviceProgramming.Tests/FileFormatTests.cs Adds new Intel HEX and SREC parser test coverage, including EOF/structural validation cases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread DeviceProgramming/FileFormat/TextRecordParser.cs Outdated
Comment thread DeviceProgramming/FileFormat/SRecord.cs
Comment thread DeviceProgramming.Tests/FileFormatTests.cs
Comment thread DeviceProgramming.Tests/FileFormatTests.cs Outdated
@benedekkupper benedekkupper merged commit 1970f60 into main Apr 20, 2026
5 checks passed
@benedekkupper benedekkupper deleted the develop branch April 20, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SREC parsing fails when file contains only S3 + S5 records (no S7/S8/S9) – reports "No segments found"

2 participants