A lightweight WPF utility to load, inspect, sort, and merge Motorola S‑Record (S0/S1/S2/S3/S7/S8/S9) files. It provides a simple UI to:
- Load multiple .s19/.srec/.sre files at once
- Extract records and sort them by address
- Preserve the first S0 (header) and the last end record (S7/S8/S9) if present in specific inputs
- Inspect parsed records in a table (Type, Address, Data Length, Data)
- Export the merged result to a new S‑Record file
- UI shows two buttons (Load S-Record File, Export) and a list of parsed rows.
- You can add screenshots here (e.g., docs/screenshot-1.png).
- Multi-file import using file dialog
- S0 header record and last end record (S7/S8/S9) handling
- Address-aware sorting of S1/S2/S3 records
- Clean display of records in a GridView
- Export merged lines to a file via Save File dialog
- Load: Select multiple S-Record files. The app will parse supported record types.
- Merge: Non-header/end records (S1/S2/S3) are collected and sorted by their numeric address.
- Header/End: If a file name contains "Boot_HSM_App.sre", the first S0 and the last end record (S7/S8/S9) from that file are used as header and footer in the final output.
- Export: The final ordered lines are written to a new file you choose.
- .NET 7
- WPF (MVVM pattern)
- CommunityToolkit.Mvvm (ObservableObject, RelayCommand)
- App.xaml, MainWindow.xaml(.cs): WPF entry and host window
- S19MergeView/
- S19MergeView.xaml: View (buttons + ListView)
- S19MergeViewModel.cs: VM with commands for Load/Export, parsing/merging logic
- S19MergeModel.cs: SRecord model (Type, Address, DataLen, DataString)
- Services/BindableBase.cs: Convenience base class for bindable properties built on ObservableObject
- Visual Studio 2022 (or newer)
- .NET 7 SDK
- Windows (WPF)
- Clone the repository
- git clone
- Open S19Merge.sln in Visual Studio 2022.
- Restore NuGet packages if prompted (CommunityToolkit.Mvvm).
- Set S19Merge as startup project and press F5 to run.
- Click "Load S-Record File" and select one or more S-Record files (.s19/.srec/.sre).
- The list will show parsed records (Type, Address, Data Length, Data).
- Records will be sorted by address (S1, S2, S3). If a file named like "Boot_HSM_App.sre" is included, its S0 header and the last S7/S8/S9 record are used.
- Click "Export" to save the merged S-Record as a new file.
- Parsing logic targets standard S0/S1/S2/S3/S7/S8/S9 lines. Lines outside these types are ignored.
- The special handling for header/end records is keyed on file names that contain "Boot_HSM_App.sre" (case-insensitive). Adjust logic in S19MergeViewModel if your naming differs.
- The tool does not currently validate checksums or rewrite them.
- Configurable header/end selection rules
- Checksum verification and regeneration
- Command-line mode
- Unit tests for parser and merger
- Issues and PRs are welcome. Please keep changes focused and include a brief description and testing notes.
- Add your preferred license (e.g., MIT) and license file if applicable.