RomRaider Logo

RomRaider

Open Source ECU Tools
 FAQ •  Register •  Login 

RomRaider

Documentation

Community

Developers

It is currently Sat Feb 21, 2026 10:22 pm

All times are UTC





Post new topic Reply to topic  [ 58 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
 Post subject: Re: Nissan reflashing kernel
PostPosted: Wed Oct 26, 2016 1:12 am 
Offline
Experienced
User avatar

Joined: Thu Jan 09, 2014 3:07 am
Posts: 652
mini update... working on the kernel and nisprog in parallel.

in this screenshot (see attachment):
First few lines is the code to match ECUID by similarity to find the most likely keyset to use (yay, no more typing two 32-bit hex keys !)

The last part is a test command "tfl" that compares CRC "checksums" over the whole ROM to determine which memory blocks were modified and need to be reflashed. As you can see in my test, blocks 1, 8 and 13 are different. The reason for this is mainly twofold :

- comparing CRCs takes about 6-7 seconds, instead of comparing a full dump which takes over 3 minutes for a 1MB ROM !!
- reflashing only the required blocks is a huge timesaver (from 8x to 256x faster !)
- bonus : leaving the other blocks alone can help with flash durability

The only drawback is that a CRC is not perfect. Currently I'm using one CRC16 per 256 byte chunks -- that is, 2 bytes of checksum for every 256B of data. It is very possible to find two different chunks that share a same CRC. (this is a well-known probability thing, "birthday problem")
I haven't done the math (someone please do, I'd like to see actual figure), but the takeaway is that it's very unlikely.
This is even more true since even the smallest flash blocks (4kB) are compared with 16 CRCs, and if there is a single different CRC the whole block is reflashed.

Still, I'll provide the reflash command with "orig_rom.bin" and "new_rom.bin" arguments so it can base its modified-block-selection on a file comparison instead. In other words :

  1. provide desired new_ROM.bin file
  2. select blocks to reflash, three options :
    1. full ROM, all blocks
    2. CRC comparison to select blocks, as described above.
    3. compare new_ROM.bin to a user-specified "old_ROM_contents.bin" to select blocks
  3. erase + write selected blocks


You do not have the required permissions to view the files attached to this post.


Top
 Profile  
 
 Post subject: Re: Nissan reflashing kernel
PostPosted: Wed Oct 26, 2016 1:33 pm 
Offline
Newbie

Joined: Tue Dec 01, 2015 2:53 am
Posts: 34
Wow, this is awesome! Makes nisprog way more automated/user friendly and will save a lot of time! Thanks


Top
 Profile  
 
 Post subject: Re: Nissan reflashing kernel
PostPosted: Thu Oct 27, 2016 1:12 am 
Offline
Experienced

Joined: Tue May 24, 2016 5:45 am
Posts: 217
Automated block modification checking? AWESOME!

I can honestly say this will help greatly with adoption by anyone without significant technical skills.

I can't wait to test this thing out!


Top
 Profile  
 
 Post subject: Re: Nissan reflashing kernel
PostPosted: Sat Oct 29, 2016 11:54 pm 
Offline
Experienced

Joined: Tue May 24, 2016 5:45 am
Posts: 217
Tested the kernel for reading my old Sh7055 tonight and got 5.5K/s ! It took all of 90 seconds to do a full dump.


Top
 Profile  
 
 Post subject: Re: Nissan reflashing kernel
PostPosted: Thu Dec 15, 2016 11:48 pm 
Offline
Experienced
User avatar

Joined: Thu Jan 09, 2014 3:07 am
Posts: 652
Updated the kernels to fix a bug affecting some ECUIDs (at least 4M860) where the payload is transferred succesfully but did not respond to commands, requiring a power cycle to reset the ECU.

Source and precompiled bins available on my github as usual, http://github.com/fenugrec/npkern


Top
 Profile  
 
 Post subject: Re: Nissan reflashing kernel
PostPosted: Thu Feb 09, 2017 12:24 am 
Offline
RomRaider Donator

Joined: Thu Feb 09, 2017 12:10 am
Posts: 60
.


Last edited by n00bz on Thu Mar 30, 2017 2:14 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Nissan reflashing kernel
PostPosted: Fri Mar 24, 2017 1:19 am 
Offline
Newbie

Joined: Fri Nov 14, 2014 2:33 am
Posts: 67
Location: Caribbean
maybe I have missed it , what command allows reading / writing of the eeprom ?


Top
 Profile  
 
 Post subject: Re: Nissan reflashing kernel
PostPosted: Fri Mar 24, 2017 2:49 pm 
Offline
Experienced
User avatar

Joined: Thu Jan 09, 2014 3:07 am
Posts: 652
swami wrote:
maybe I have missed it , what command allows reading / writing of the eeprom ?

It's only documented inside nisprog if you do "help dump". It's almost the same syntax as a regular dump. But first you need to specify, for your ROM, the location of the eeprom_read() function. Some information about this on the wiki, https://nissanecu.miraheze.org/wiki/Eeprom_code

_________________
If you like nisprog + npkern, you can support me via https://liberapay.com/fenugrec/
For sending me encrypted/secure messages, use PGP key 0xBAC61AEB3A3E6531 available from pool.sks-keyservers.net


Top
 Profile  
 
 Post subject: Re: Nissan reflashing kernel
PostPosted: Fri Mar 24, 2017 2:57 pm 
Offline
Experienced
User avatar

Joined: Tue Oct 13, 2015 5:56 am
Posts: 141
Location: Russia, Voronezh
swami, I also got a patch for nisprog and npkern that allows read/write EEPROM, but only for more recent ECUs with ST95xxx EEPROMs.
I didn't submit it yet to the repo, but have promised to fenugrec to do it long time ago :) one day it will be there for sure


Top
 Profile  
 
 Post subject: Re: Nissan reflashing kernel
PostPosted: Fri Mar 24, 2017 4:05 pm 
Offline
Senior Member

Joined: Mon Jan 19, 2009 6:31 pm
Posts: 1615
Location: Moscow, Russia
There is a lot of variants of EEPROM and EEPROM to SH705xF chip interconnections.
Thus software development is tricky and most probably the user should specify an applicable eeprom/cpu/connections.


Last edited by Sasha_A80 on Sat Mar 25, 2017 9:52 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Nissan reflashing kernel
PostPosted: Sat Mar 25, 2017 8:15 am 
Offline
Newbie

Joined: Fri Nov 14, 2014 2:33 am
Posts: 67
Location: Caribbean
Shuher wrote:
swami, I also got a patch for nisprog and npkern that allows read/write EEPROM, but only for more recent ECUs with ST95xxx EEPROMs.
I didn't submit it yet to the repo, but have promised to fenugrec to do it long time ago :) one day it will be there for sure


the ecus i have are equipped with older 93c66 eeproms


Top
 Profile  
 
 Post subject: Re: Nissan reflashing kernel
PostPosted: Sat Mar 25, 2017 12:08 pm 
Offline
Experienced
User avatar

Joined: Thu Jan 09, 2014 3:07 am
Posts: 652
Sasha_A80 wrote:
There is a lot of variants of EEPROM and EEPROM to SH705xF chip interconnections.


Quite true. That's why I use the method of calling the ROM's own builtin eeprom_read() function, so I don't need to know which IO pins to use.

_________________
If you like nisprog + npkern, you can support me via https://liberapay.com/fenugrec/
For sending me encrypted/secure messages, use PGP key 0xBAC61AEB3A3E6531 available from pool.sks-keyservers.net


Top
 Profile  
 
 Post subject: Re: Nissan reflashing Kernel's​
PostPosted: Sat Mar 25, 2017 1:27 pm 
Offline
Newbie

Joined: Tue Dec 01, 2015 2:53 am
Posts: 34
Swami - FYI, I use an FTDI breakout board and an SOIC clip to read/write my 93C66 eeproms. Much easier and more universal. Seems like Nissan uses them for a number of different things (instrument clusters, etc.)

For dumping ECU eeproms I use niskern/nisprog too.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 58 posts ]  Go to page Previous  1, 2, 3, 4

All times are UTC


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

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subsilver by phpBBservice.nl