-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Microchip Technology
committed
Mar 22, 2024
1 parent
6e7d473
commit 9bbeceb
Showing
31 changed files
with
386 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: dc4a20f2ac9c16b323f6d26c517986b8 | ||
config: 0d2883cadca8da09782e7a229c62074d | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
pyedbglib/tests/data/atmega4809_flash_gaps_fuses_lockbits.hex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
:100000000C9450000C9494000C9494000C94940064 | ||
:100010000C9494000C9494000C9494000C94940010 | ||
:100020000C9494000C9494000C9494000C94940000 | ||
:100030000C9494000C9494000C9494000C949400F0 | ||
:100040000C9494000C9494000C9494000C949400E0 | ||
:100050000C9494000C9494000C9494000C949400D0 | ||
:100060000C9494000C9494000C9494000C949400C0 | ||
:100070000C9494000C9494000C9494000C949400B0 | ||
:100080000C9494000C9494000C9494000C949400A0 | ||
:100090000C9494000C9494000C9494000C94940090 | ||
:1000A00011241FBECFEFCDBFDFE3DEBFE0EAF0E0FB | ||
:1000B00040E017C0B591A59135912591059107FDB7 | ||
:1000C0000CC095918591EF01F92FE82F05900D92C5 | ||
:1000D000A217B307D9F7FE0104C01D92A217B307F8 | ||
:1000E000E1F7E03AF40731F70E947A000C948900B6 | ||
:0400F000F894FFCFB2 | ||
:1000F40080E28093A104E7EAF4E020E2208380E038 | ||
:0E01040090E0019681153AEF9307D9F7F7CFF7 | ||
:10011200EC010E9499000E949800CE010E949A0070 | ||
:06012200CE010E949600D0 | ||
:040128000C94000033 | ||
:04012C000E947800B5 | ||
:02013000089530 | ||
:0201320008952E | ||
:0201340008952C | ||
:02000004008278 | ||
:090000000000020000C40000052C | ||
:02000004008377 | ||
:01000000C53A | ||
:00000001FF |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
:08000000803102288731AB2F8B | ||
:100F56004001AD2FBB2787311930F0000430400126 | ||
:100F66008C06F101700871020318B12FF10AB52F32 | ||
:100F7600E0278731C2278731EA278731F42F4001DE | ||
:100F86009801990180309A003B309200F03093002E | ||
:100F96007F3094007A307E01CE00F030C3003330CB | ||
:100FA600B800C401B9010530CF00BA01C501D001AE | ||
:100FB6002708C0391738A70008004F019601970186 | ||
:100FC600980199019A019B019C019D0108006930D5 | ||
:100FD60051018D0040308F0008309100930192013D | ||
:100FE6000800D0304B019F0001309D009C014E014E | ||
:0A0FF6008C1280304B019E000800B1 | ||
:020000040001F9 | ||
:0800000022110201FF3F010281 | ||
:0A000E00EC3FFF3F9F3FFF3FFF3F25 | ||
:10E0000011002200330044005500660077008800AC | ||
:10E01000110022003300440055006600770088009C | ||
:10E02000110022003300440055006600770088008C | ||
:10E03000110022003300440055006600770088007C | ||
:10E04000110022003300440055006600770088006C | ||
:10E05000110022003300440055006600770088005C | ||
:10E06000110022003300440055006600770088004C | ||
:10E07000110022003300440055006600770088003C | ||
:10E08000110022003300440055006600770088002C | ||
:10E09000110022003300440055006600770088001C | ||
:10E0A000110022003300440055006600770088000C | ||
:10E0B00011002200330044005500660077008800FC | ||
:10E0C00011002200330044005500660077008800EC | ||
:10E0D00011002200330044005500660077008800DC | ||
:10E0E00011002200330044005500660077008800CC | ||
:10E0F00011002200330044005500660077008800BC | ||
:10E1000011002200330044005500660077008800AB | ||
:10E11000110022003300440055006600770088009B | ||
:00000001FF |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
""" | ||
Tests covering the hex_to_uf2 module in util | ||
""" | ||
|
||
import unittest | ||
import tempfile | ||
from pathlib import Path | ||
|
||
from pyedbglib.util.hex_to_uf2 import hex_to_uf2 | ||
|
||
DATA_FOLDER = Path(__file__).parent.absolute() / 'data' | ||
|
||
class TestHexToUf2(unittest.TestCase): | ||
"""Tests for hexfile to UF2 file conversion utility""" | ||
|
||
def _convert_hex_to_uf2_and_check(self, hexfile_path, reference_uf2file_path): | ||
"""Convert hexfile to UF2 file and verify against reference file | ||
:param hexfile_path: Path to input hex file | ||
:type hexfile: class:'pathlib.Path' | ||
:param reference_uf2file_path: Path to reference UF2 file | ||
:type uf2file: class:'pathlib.Path' | ||
""" | ||
with tempfile.TemporaryDirectory() as tempdir: | ||
outputfile_path = Path(tempdir) / 'generated.uf2' | ||
|
||
hex_to_uf2(hexfile_path, outputfile_path) | ||
|
||
with reference_uf2file_path.open('rb') as reference_file: | ||
with outputfile_path.open('rb') as output_file: | ||
reference = reference_file.read() | ||
output = output_file.read() | ||
self.assertEqual(output, | ||
reference, | ||
msg="UF2 mismatch, {} vs {}".format(outputfile_path, reference_uf2file_path)) | ||
|
||
|
||
def test_hex_to_uf2(self): | ||
""" | ||
Test hex to UF2 file conversion using golden sample files | ||
""" | ||
self._convert_hex_to_uf2_and_check(DATA_FOLDER/'atmega4809_flash_gaps_fuses_lockbits.hex', | ||
DATA_FOLDER/'atmega4809_flash_gaps_fuses_lockbits.uf2') | ||
self._convert_hex_to_uf2_and_check(DATA_FOLDER/'pic16_flash_eeprom_config.hex', | ||
DATA_FOLDER/'pic16_flash_eeprom_config.uf2') |
Oops, something went wrong.