예제 #1
0
    def test_gcc_output(self):
        starting_offset = 0x08004000
        working_offset = starting_offset

        ih = ihex.iHex()
        gih = ihex.iHex()
        
        ih.load_bin('test_collateral/main.bin', starting_offset)
        gih.load_ihex('test_collateral/main.hex')

        wl = ih.get_u32_list()
        wl2 = gih.get_u32_list()

        for idx in range(len(wl)):
            assert_equal(wl[idx][0], wl2[idx][0])
 def save_upgrade_img(self, path="image.ihex"):
     """
     Outputs the CRC'd image as an intel hex file
     """
     ih = ihex.iHex()
     ih.load_bytes(self._bin, self._base_offset)
     ih.save_ihex(path)
예제 #3
0
 def save_upgrade_img(self, path="image.ihex"):
     """
     Outputs the CRC'd image as an intel hex file
     """
     ih = ihex.iHex()
     ih.load_bytes(self._bin, self._base_offset)
     ih.save_ihex(path)
예제 #4
0
    def _load_words_from_ihex(self):
        # Load and process the ihex file
        ih = ihex.iHex()
        ih.load_ihex(self.filepath)

        # Get a list of the words in the ihex file (and their offsets)
        wl = ih.get_u32_list()

        # Now, create 64 word chunks from this list of words
        wordchunks = [x for x in ihex.chunks(wl, 64)]

        return wordchunks
예제 #5
0
    def _load_words_from_ihex(self):
        # Load and process the ihex file
        ih = ihex.iHex()
        ih.load_ihex(self.filepath)

        # Get a list of the words in the ihex file (and their offsets)
        wl = ih.get_u32_list()

        # Now, create 64 word chunks from this list of words
        wordchunks = [x for x in ihex.chunks(wl, 64)]

        return wordchunks
예제 #6
0
    def test_low_offset(self):
        starting_offset = 0x08004000
        working_offset = starting_offset

        ih = ihex.iHex()
        ih.load_bin('test_collateral/main.bin', starting_offset)

        wl = ih.get_u32_list()

        for w in wl:
            assert_equal(w[0], working_offset)
            working_offset += 4