I have a binary file that I found on a 3D printer that is used to program a dsPIC30F5011 microcontroller. It is responsible for some basic data encryption. The only problem is, I am not sure how this file is formatted.
It is raw binary, not like an Intel HEX file or anything. Here's a few sample lines:
For the first line:
So the first byte (0x0C) is the length of the data.
The next two bytes (0x4230) is the address (I believe it is twice the address, I'll explain that further down)
Then is the data (length 0x0C in this case) - 050037600010E0801802003Bh
The last two bytes are a Checksum - 2's complement of the lower byte of the sum of all bytes (length through end of data).
The reason I believe the address listed is twice the address desired is in the Programming Manual the Intel Hex format says:
• AAAA - is a four-digit hexadecimal address representing the starting address of the data record. Format is high byte first followed by low byte. The address is doubled because this format only supports 8-bits. Divide the value by two to find the real device address.
In fact, this format closely matches the Intel HEX format, although it isn't in ASCII format, nor does it use valid record types.
In addition, the last few commands in the file reference address 0x0008 - 0x01FF. Dividing this by 2 gives us 0x0004 - 0x00FF, which according to the datasheet is the interrupt vector locations.
I have been poking at this for ages, and I can't seem to understand how this is actually translated to the MCU. For one thing, the addresses all increment in 16 byte increments, despite the fact that there is only 12 bytes of data in that line.
If anyone can make any sense out of this, I feel like I am at wit's end on this one.
And here's some more hex if you don't feel like downloading the file:
0C4210889FBE8A9FBE0105780100E077 0C422004003508003C0000E0200032E3 0C4230050037600010E0801802003B21 0C424001F02C1A00370004BE6011B819 0C42506B09200982CF0200390882CFE0 0C42600441B06942520E003208003BDD 0C42708281716101648904D10884D34B 0C42808B05E80442E8F9FF3A0500371E 0C429008044489844C8B05E90442E9D1 0C42A0FBFF3A1B01070AF0A701F0A089 0C42B04F05BE4F04BE000006889FBEF4 0C42C08A9FBE8C1F783801073F013335 0C42D003866C6450E12E00326420E193 0C42E03300326150E12F00326120E118 0C42F0310032858555EB07B009002035 0C430008042005003708044489844CA0 0C43100A003106034387834B00015371 0C432081815BF8FF330203BE0800A09F 0C433008044489844CF6FF39C639DDCE 0C43408301730100321300208904D1B6 0C43500884D30998A30500320800A7D8 0C43600300A08904D10884D38B05E879 0C43708904D10884D30001EB0281D243 0C4380E4000701F0A10CF0A701F0A080 0C43901701376420E11901320801BE5A 0C43A00200BEF7FF376120E11401327B 0C43B06000B8F3FF3700002001F82780 0C43C0F0FF3704002010013703F0A2CA 0C43D0889FBE8A9FBE8C1F78F30007F8 0C43E0FA00336450E14F00326420E129 0C43F052003203826C07003B0905D02C 0C44000306D0820F540C065D02003948 0C44100200328901780306788582558D 0C442004003D0003FD8103FD8502EA5D 0C44308B8542840F7202003B6000107C 0C4440E080186011B80005EB7A28E15C 0C44500A0039060078C75DDDF707B2EE 0C44608780752D00378281710A017879 0C44706105608180D10080D38502E9E5 0C4480F9FF3B06044087844802003B23 0C4490600414E0841C0988A3070032BB 0C44A08A81718281716101648904D1FC 0C44B00884D38B05E81700370978A3B7