pgmfi.org

Hacking up Honda's ECU
It is currently Fri Mar 29, 2024 7:10 am

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue Oct 25, 2016 8:33 am 
Offline

Joined: Mon Mar 07, 2016 1:40 pm
Posts: 24
Hi, i'm trying to remake something similare than the tool Flash N Burn is doing. Reading and writing chips on the burn2

I use the popular chip model SST27ST512, its a 64kb chips (0x0000 to 0xFFFF) file are 32kb (0x8000 to 0xFFFF)

exemple that I want to read 256bytes (from 0x8000 to 0x8100)

moates protocol :
Read from an SST27SF512 chip ....
Code:
'5'+'R'+n+MSB+LSB+CS


I use this Write array commands :
Code:
byte SendArray = new byte [6]{53, 82, 0, 128, 0, CS};
Serial.Write(SendArray, 0, 6);


1. = 5, for sst27sf512 chip model
2. = R, for reading the chips
3. = 0, for reading 256bytes
4. = 0x80, for region 0x8000
5. = 0x00, ending region 0x8000
6. = Checksum

What checksum do I use, and how do I dertermine it out ?

and now to poll back the reading, I only read 3F or FF, but none of the value I have on the chips. I tried 2 possible way.
First way :
Code:
byte bytesArray = new byte[256];

Serial.Read(bytesArray, 0, 256);

for (int i = 0; i < bytesArray.Length; i++)
     Console.Write(bytesArray[i]);


Second way :
Code:
for (int i = 0; i < 256; i++)
     Console.Write(Serial.ReadByte());


the blue leds trigger between on/off like it should, I really dont know what I do wrong.


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 25, 2016 4:16 pm 
Offline

Joined: Mon Mar 07, 2016 1:40 pm
Posts: 24
i'Ve found it out, thread fixed

checksum actually is a checksum of the commands.

for the commands 53,82,0,128,0
we calculate like so : 53 + 82 + 0 + 128 = 263
since 263 is over 1byte value. we extract 1byte : 263 - 256 = 7

New commands with checksum :

53,82,0,128,0,7

and now i'm able to read back the bytes


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group