Python Forum
Read microcontroller eeprom and feed into python to find checksums.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Read microcontroller eeprom and feed into python to find checksums.
#1
Good afternoon,

Looking for a little help if possible.
I've done some coding in python but not a massive amount.
In this case I've never done anything with checksums - especially CRC16 - CCITT.

I have a project car and I'm looking to make some mods such as heated seats. power fold mirrors etc. This part is easy enough, read the microcontroller EEPROM, change the byte options from 0x00 to 0x01 however I need to find and recalculate the CRC16-CCITT.(there are many within the binary file)

The CRC16-CCITT's could be anywhere in the file but are straight after the variable length data.

Basically I'm looking to have python script that will read the file byte by byte increasing the data one byte at a time, calculate the checksum and compare it with the next two bytes in the file. When the calculated checksum matches the next two bytes I want to ouput the start address of data, end address of data, checksum location and the actual checksum. Of course it needs to do this repeatedly until the end of file is reached.

When I know these parameters I will be able to mod the data and just recalculate the checksum. change it and reflash the eeprom.

In fairness I know how to read and write files etc in python but I need some pointers on CRC16-CCITT 0xFFFF checksums and how to implement them.
Will the processing overheads be too long and too slow?

To give a quick idea I have copied and pasted some of the data below:

80 07 24 06 FF 00 00 00 FF FF FF FF FF FF FF FF AC DC FF 03 88 DC FF 03 60 DC FF 03 20 56 06 01
7F 00 64 07 7D 82 64 07 81 82 64 07 99 82 7F 00 80 57 04 00 20 36 34 B0 46 36 FF 03 A6 51 7F 00
40 56 00 04 2A 56 94 B0 40 5E 00 04 2B 5E 9C B0 C5 1D 40 56 00 04 2A 56 9C B0 40 5E 00 04 2B 5E
4A B1 B5 15 40 56 00 04 2A 56 4C B1 40 5E 00 04 2B 5E F6 B2 A5 0D 40 56 00 04 2A 56 F8 B2 40 5E
00 04 2B 5E 24 B6 95 05 66 57 01 00 AA 59 67 5F 01 00 7F 00 00 00 00 00 80 07 06 00 7F 00 5C 1A
63 0F 01 00 A0 07 21 00 63 37 3D 00 63 3F 39 00 63 47 35 00 63 4F 31 00 63 57 2D 00 63 5F 29 00
63 67 25 00 63 6F 21 00 63 77 1D 00 63 7F 19 00 63 87 15 00 63 8F 11 00 63 97 0D 00 63 9F 09 00
F0 0F 40 00 63 0F 05 00 F1 0F 40 00 63 0F 01 00 BF FF AC FF 23 0F 01 00 E1 8F 20 00 23 0F 05 00
E1 87 20 00 23 9F 09 00 23 97 0D 00 23 8F 11 00 23 87 15 00 23 7F 19 00 23 77 1D 00 23 6F 21 00
23 67 25 00 23 5F 29 00 23 57 2D 00 23 4F 31 00 23 47 35 00 23 3F 39 00 23 37 3D 00 60 06 20 00
23 0F 01 00 44 1A E0 07 40 01 56 94 86 00 20 5E 32 00 20 56 20 00 40 37 .....data continues>>>

As you can see in the data above, the checksum (in bold) could be anywhere due to the data length(unknown). After the checksum the next data block starts followed by the next checksum.
My main task is to find these checksums within the data and log their locations.
Hope you guys can point me in the right direction.

Thanks in advance.
Mike
Reply


Messages In This Thread
Read microcontroller eeprom and feed into python to find checksums. - by mikeak2001 - Mar-17-2020, 04:51 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Exclamation Multi-Threaded Camera Feed issue Khajababa69 0 123 May-05-2024, 09:44 PM
Last Post: Khajababa69
  Draw bounding boxes on live feed Jerome 0 327 Jan-20-2024, 10:50 PM
Last Post: Jerome
  read a text file, find all integers, append to list oldtrafford 12 3,707 Aug-11-2022, 08:23 AM
Last Post: Pedroski55
  How to parse a live feed in Python? Daring_T 2 4,191 Jan-20-2022, 04:17 AM
Last Post: Daring_T
  Feed List items with Integer euras 9 4,038 May-19-2021, 07:45 PM
Last Post: snippsat
  splitting UAV/sat images to smaller pieces in order to feed a CNN hobbyist 0 1,550 Dec-08-2020, 11:48 AM
Last Post: hobbyist
  Rotation Effect on live Webcam Feed Leziiy 0 1,632 Sep-12-2020, 04:25 PM
Last Post: Leziiy
  Replace every 20th space with line feed T_Lafferty 3 2,408 Jul-19-2020, 10:37 PM
Last Post: T_Lafferty
  Help to find a string and read the next lines crlamaral 4 2,522 Mar-19-2020, 09:24 AM
Last Post: Larz60+
  How to remove form feed from file gurbhej_singh 5 3,490 May-26-2019, 05:51 AM
Last Post: gurbhej_singh

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020