Nissan Titan XD Forum banner
61 - 72 of 72 Posts

·
Registered User
2019 Titan XD Pro4x Cummins
Joined
·
1,026 Posts
Discussion Starter · #61 ·
I've had no time to look at this project, which saddens me. I'm getting my head absolutely kicked in on the web design school. Not for lack of intelligence, but rather, because I'm not able to follow other peoples instructions or lack thereof.

Going into a web design bootcamp is an absolute waste of money. If you want to get into the field as a salary employee, get a formal education.
 

·
Registered User
2019 Titan XD Pro4x Cummins
Joined
·
1,026 Posts
Discussion Starter · #62 ·
Has it really been nearly three weeks since my last update? Disgusting. My goodness, if I were following this thread I'd be screaming vapourware by now.

So yes, here is some more hot air to keep the vapourware afloat:

I was dropped from the web design bootcamp last week, I'm not able to follow other peoples instructions very well and was unable to complete the course material. I have learned a tremendous amount and I will be putting it to good use.

I have a database design and interface project I need to complete before I can get back onto truck stuff. I have everything I need to document the engine and it's just slightly out of reach because I can't allocate the time to it.
 

·
Registered User
2019 Titan XD Pro4x Cummins
Joined
·
1,026 Posts
Discussion Starter · #63 ·
Today I got frustrated with my database project and decided to put that to the side and work on some stuff for my truck!

Like every other time that I've stepped away from this project it takes me a very long time to get back into the code, remember what I did and how I got there. My commenting is rather atrocious as well, so I'm struggling remembering how the different components work together.

So, like I usually do, I took a somewhat simple solution... rewrite! I know I needed to do, so I started small, quickly built back up to the point of getting a very important answer. I have found the offset, it's 244 bytes. I've found that it exists at the end of only one of the data blocks. I don't know it's purpose, but now that I have that offset, once I get to the point of having all the components working again, then I should have every single itn documented.

The biggest hurdle right now is the time it's taking me to get back up to speed on where I was at, plus the hassle of rewriting, even though I have both projects beside each other... it's easier for me to remember the flow by building things out as I need them. I'm also finding a few places where I was really inefficient with my code. This is as good a time as any to clean some of that up.

So I'm markedly closer to having the ecm documented. Going to try and get a few more hours of coding in tonight, but on one of my self imposed breaks.
 

·
Registered User
2019 Titan XD Pro4x Cummins
Joined
·
1,026 Posts
Discussion Starter · #64 ·
Sometimes knowing what you want to accomplish, mostly understanding the tools you're using... isn't enough to overcome the logical issue at hand. I can reliably and safely import the xcal. I can reliably turn that xcal into one continuous binary. Turning a raw binary into a correctly addressed xcal is sapping my sanity.

I got to spend about six hours on coding today. I've mostly figured out how I wrote my previous version and mostly what's wrong with it. My newest version, as always, the code is shorter, cleaner and more efficent.

My problem? Tracking bytes and keeping things contained within their respective grouping. As I've said before, the block data structure is part of the intel hex document, so, no problem, easy peasy getting the positions from the records themselves.

When I load the raw binary, it goes into an array of bytes. As I read each byte I have to advance the index forward one. Then I need to check that index position against the block data structure and figure out which block that byte belongs to. Then, I further compare the index to the starting address of that block, so that I can know the starting address of the record that contains that byte, and the array position of that byte within that record. There is another complication. The extended linear address. Every 65535 bytes, I have to create a special record which tells the micro controller the 32 bit address block the following records reside in. There is this thing called bit shifting and I'm just starting to understand it. In a 32-bit document there is room for 4.29 billion bytes, expressed as 0xFFFFFFFF.

Math in hexadecimal works the same as normal, it's just base 16 (0 to 9,A to F) so it looks really weird, but allows for bit shifting which is really neat. So in a data record it has a 16 bit address 0x0 - 0xFFFF. In an extended linear address, the address part of the record is 0000, but it shifts bits over on the 32 bit address and stores those two bytes as data.

Code:
0x80020000 >> 16 bits
  =
0x00008002
  split the bytes to store as data:
0x80, 0x02
Well I know it's mostly rambling but it does help me organize my thoughts. All because one bin has an extra, unneeded 244 bytes and I have to account for it! GAH!
 

·
Registered User
2019 Titan XD Pro4x Cummins
Joined
·
1,026 Posts
Discussion Starter · #65 ·
<Insert a bunch of colourful metaphors here>

I have a bit of fiddling to do... but I now have what appears to be a perfect xcal of 23701EZ45C. Now I have to go back to my other application, figure out some of my code, so I can deal with the offset that I now know... but, I'm sighing a huge sigh of relief. I reverse engineered the binary and now have an xcal. The possibility of installing the tune with Nissan consult is now even closer to reality.

Now once I figure out what I did before... deal with the offset, the xcal will be fully documented and I can finally start working on the engine parameters themselves. So excited!
 

·
Registered User
2019 Titan XD Pro4x Cummins
Joined
·
1,026 Posts
Discussion Starter · #66 ·
Wow... I... uhh... feel weird.

I was able to map 17237 of 17631 parameters. I can't tell if the last 400 or so are actually in the map pack, but everything else seems to be there. I'm going to see if I can get the remaining parameters, but now I get to go back to learning about the engine. It's time to start picking through the engine parameters, making sure that the values appear correct, and start changing the settings to completely disable the emissions components.

Not sure how long this process will take, it's something I have to get help with. Rawze has been tremendously helpful in my learning, so hopefully I won't drive him insane with the questions I'll be bombarding him with.

My editor is still not assembling the tables in a visible format, but if you're interested, this is what the list of parameters looks like:
 

Attachments

·
Registered User
2019 Titan XD Pro4x Cummins
Joined
·
1,026 Posts
Discussion Starter · #67 ·
<more, perhaps less happy colourful metaphors>

So I made a really dumb mistake, but it's going to cause me a massive rewrite of the program that converts the winols map pack to ecfg.

When a computer stores an integer, it's stored as bytes, so the whole number 255 could be expressed in bytes as
0b11111111 or in hex, 0xFF. When you extract the raw bytes, the keyboard warrior has to decide what type of integer he wants, signed or unsigned. That same byte, 0xFF can equal -127 or 255 depending on if it's signed or not. Well, not thinking, I used the signed integer datatype in my program and I should have used unsigned integer.

Fun. I wanted to work on engine parameters... not more code... but here I am. My wife noticed some more grey hairs recently too. I wonder if it's related.
 

·
Registered User
2019 Titan XD Pro4x Cummins
Joined
·
1,026 Posts
Discussion Starter · #68 ·
I'm no longer having any issues in terms of dealing with unsigned vs signed integers, but despite knowing the offset, knowing the block data structure, I'm still doing something wrong in terms of getting the final parameters to line up.

So two nights ago, I got mad and thought, you know what, let's just experiment with javascript and see if I can get any closer with it. Turns out I'm not as bad as I thought at javascript as I'm as close as I've ever been, but it's still seems just "one more line" away from working.

I'll get there but my goodness sometimes it can be tiring when I spend days trying to find the answer.
 

·
Registered User
2019 Titan XD Pro4x Cummins
Joined
·
1,026 Posts
Discussion Starter · #72 ·
I'm struggling a bit, it's driving me nuts.

I'm at the point where I have to create some kind of user interface so I can go through everything one parameter at a time and check that I've got the correct data. Doing it individually view code, doing another build, rinse repeat is taking forever and is having some unreliable results.

The other struggle is that this is pushing me, again, right to the edge of my capabilities. I can handle coding, but I'm not a great coder. I start to get overwhelmed when there are so many things going on at once and I've got to find a way to simplify what I'm doing so I can see it better. It's just so many steps, so many conversions, it's getting to be overwhelming. Not giving up, but venting. I wanted to have a good tune on my truck six months ago and here I am still fighting with the same problems. sigh.
 
61 - 72 of 72 Posts
Top