|
RomRaider
Documentation
Community
Developers
|
| Author |
Message |
|
a33b
|
Post subject: Re: Nissan Petrol\Diesel extended PIDs request Posted: Sat Nov 03, 2018 4:04 am |
|
 |
| Experienced |
Joined: Sat Jun 24, 2017 6:23 pm Posts: 315
|
dschultz wrote: a33b wrote: fenugrec wrote: PS what happens in the spreadsheet with the CIDs > 1300 ? they're weirdly formatted, i.e. "13010" - or would that be CID 1301, bit 0 ? Correct So from this I gather that each bit returned is effectively a switch (on/off), correct? yes dschultz wrote: If the reply to 1301 is a byte, is each bit supported or is it possible that say only 5 of 8 bits contain real values? The bits which are valid are defined in the CID 1300 table which is set up in u32 pairs. One value is the RAM address where the data is saved, and the other value is (usually) a ROM address which defines which bits are supported. dschultz wrote: how would you interpret this? Mode221305 Request = 052213050401 Mode221305 Response = 056213054844 I'm 100% guessing, but assuming the last 4 digits are the actual response data, maybe two digits are the supported bits and the last 2 the data?
|
|
| Top |
|
 |
|
fenugrec
|
Post subject: Re: Nissan Petrol\Diesel extended PIDs request Posted: Sat Nov 03, 2018 5:20 am |
|
 |
| Experienced |
 |
Joined: Thu Jan 09, 2014 3:07 am Posts: 652
|
a33b wrote: The bits which are valid are defined in the CID 1300 table which is set up in u32 pairs. One value is the RAM address where the data is saved, and the other value is (usually) a ROM address which defines which bits are supported. Hmm, that sounded strange but after looking at the disasm I mostly agree with your analysis. I would differ on the format of the two data bytes: I think the first one is the flags (in this case 0x48), second one is support mask (0x44). On ZD89A, if you try CID 1302, and it returns "13 02 xx 3F", then that would also tend to confirm this; 0x3F should be the support mask for CID 1302.
_________________ 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 |
|
 |
|
dschultz
|
Post subject: Re: Nissan Petrol\Diesel extended PIDs request Posted: Sat Nov 03, 2018 1:26 pm |
|
 |
| RomRaider Developer |
Joined: Thu May 21, 2009 1:49 am Posts: 7323 Location: Canada eh!
|
|
For ZD89A, the query followed by the response: 1300 13007FFC2000 1301 13010000 1302 1302003F 1303 13032020 1304 13048090 1305 13054844 1306 13060010 1307 13070442 1308 13080008 1309 13091002 130A 130A0010 130B 130B0002 130C 130C4065 130D 130D003F 130E 130E003F 130F 130F01FF 1310 13100003 1311 13110000 1312 no response 1313 13130007 1314 13140000 1315 no response
1300 says 1302 thru 130E and 1313 are valid CIDs
So for the example of 1302, we get back 003F. So no bits are set, but if they were only the bits that AND with the mask 3F are valid, correct?
What about the case of 1305, we get back 4844. If 44 is the mask then there is a bit set in 48 that is not valid (or undefined)? 48 = 01001000 44 = 01000100 & = 01000000
|
|
| Top |
|
 |
|
fenugrec
|
Post subject: Re: Nissan Petrol\Diesel extended PIDs request Posted: Sat Nov 03, 2018 1:54 pm |
|
 |
| Experienced |
 |
Joined: Thu Jan 09, 2014 3:07 am Posts: 652
|
dschultz wrote: For ZD89A, the query followed by the response: 1312 no response
No response at all? Or a negresp 7F 12 or 7F 78 ? Really shouldn't be the latter, which means "wait for it" - that would make no sense for reading a RAM loc. Quote: So for the example of 1302, we get back 003F. So no bits are set, but if they were only the bits that AND with the mask 3F are valid, correct? That is indeed how I interpret it. As for the case of 1305, the "stray" set bit in 0x48 could just be an internal flag not officially mapped to a CID param.
_________________ 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 |
|
 |
|
a33b
|
Post subject: Re: Nissan Petrol\Diesel extended PIDs request Posted: Sat Nov 03, 2018 3:11 pm |
|
 |
| Experienced |
Joined: Sat Jun 24, 2017 6:23 pm Posts: 315
|
dschultz wrote: 1300 says 1302 thru 130E and 1313 are valid CIDs yup dschultz wrote: So for the example of 1302, we get back 003F. So no bits are set, but if they were only the bits that AND with the mask 3F are valid, correct? Yeah, bits 0 thru 6 are supported, but none of them are set (0=off,1=on for these CIDs). dschultz wrote: What about the case of 1305, we get back 4844. If 44 is the mask then there is a bit set in 48 that is not valid (or undefined)? 48 = 01001000 44 = 01000100 & = 01000000 I don't think the result can be AND'd right away. The mask should be used separately so only valid parameters are displayed in the logger. In this case the bit that is set but not supported is "Rev unit D" and I have no idea what that might be.
|
|
| Top |
|
 |
|
a33b
|
Post subject: Re: Nissan Petrol\Diesel extended PIDs request Posted: Sat Nov 03, 2018 3:26 pm |
|
 |
| Experienced |
Joined: Sat Jun 24, 2017 6:23 pm Posts: 315
|
fenugrec wrote: dschultz wrote: For ZD89A, the query followed by the response: 1312 no response
No response at all? Or a negresp 7F 12 or 7F 78 ? Really shouldn't be the latter, which means "wait for it" - that would make no sense for reading a RAM loc. I'm away from my computer, but some of the non supported CIDs can be FFFFFFFF, FFFFFFFF in the table. Might explain it?
|
|
| Top |
|
 |
|
dschultz
|
Post subject: Re: Nissan Petrol\Diesel extended PIDs request Posted: Sat Nov 03, 2018 3:35 pm |
|
 |
| RomRaider Developer |
Joined: Thu May 21, 2009 1:49 am Posts: 7323 Location: Canada eh!
|
fenugrec wrote: dschultz wrote: For ZD89A, the query followed by the response: 1312 no response
No response at all? Or a negresp 7F 12 or 7F 78 ? Really shouldn't be the latter, which means "wait for it" - that would make no sense for reading a RAM loc. Yes it replies with 7F2212, I simplified the response.
|
|
| Top |
|
 |
|
dschultz
|
Post subject: Re: Nissan Petrol\Diesel extended PIDs request Posted: Sat Nov 03, 2018 3:37 pm |
|
 |
| RomRaider Developer |
Joined: Thu May 21, 2009 1:49 am Posts: 7323 Location: Canada eh!
|
a33b wrote: dschultz wrote: What about the case of 1305, we get back 4844. If 44 is the mask then there is a bit set in 48 that is not valid (or undefined)? 48 = 01001000 44 = 01000100 & = 01000000 I don't think the result can be AND'd right away. The mask should be used separately so only valid parameters are displayed in the logger. In this case the bit that is set but not supported is "Rev unit D" and I have no idea what that might be. I would eventually interpret this as bit 6 = 1 and bit 2 = 0.
|
|
| Top |
|
 |
|
dschultz
|
Post subject: Re: Nissan Petrol\Diesel extended PIDs request Posted: Sat Nov 03, 2018 4:56 pm |
|
 |
| RomRaider Developer |
Joined: Thu May 21, 2009 1:49 am Posts: 7323 Location: Canada eh!
|
I suspect there's a timer in the ECU that limits the response to the 2181 command to once every 0.1 secs. We'll need to work on the parameter conversions... Attachment: logging.png
You do not have the required permissions to view the files attached to this post.
|
|
| Top |
|
 |
|
fenugrec
|
Post subject: Re: Nissan Petrol\Diesel extended PIDs request Posted: Sat Nov 03, 2018 5:56 pm |
|
 |
| Experienced |
 |
Joined: Thu Jan 09, 2014 3:07 am Posts: 652
|
dschultz wrote: I suspect there's a timer in the ECU that limits the response to the 2181 command to once every 0.1 secs. Awesome work !! I hope you're not re-sending the SID AC request every time ? Also, have you tried experimented with the TXMode and NResp fields of the 2181 request ?
_________________ 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 |
|
 |
|
dschultz
|
Post subject: Re: Nissan Petrol\Diesel extended PIDs request Posted: Sun Nov 04, 2018 4:41 am |
|
 |
| RomRaider Developer |
Joined: Thu May 21, 2009 1:49 am Posts: 7323 Location: Canada eh!
|
fenugrec wrote: dschultz wrote: I suspect there's a timer in the ECU that limits the response to the 2181 command to once every 0.1 secs. Awesome work !! I hope you're not re-sending the SID AC request every time ? Also, have you tried experimented with the TXMode and NResp fields of the 2181 request ? No, sending 21810401 1msec after received last response. It takes 0.1sec before seeing data from the ECU. If I send 21810402, I do get two messages back. I'll have to think about how to handle that. RR Logger does have a mode where it will just listen for data from the ECU once the ECU is commanded to send based on set addresses. It would be easier to work with that if the Nissan ECU would do the same, send data till stopped. It seems 21810400 does the same as 21810401.
|
|
| Top |
|
 |
|
fenugrec
|
Post subject: Re: Nissan Petrol\Diesel extended PIDs request Posted: Sun Nov 04, 2018 4:55 am |
|
 |
| Experienced |
 |
Joined: Thu Jan 09, 2014 3:07 am Posts: 652
|
dschultz wrote: No, sending 21810401 1msec after received last response. It takes 0.1sec before seeing data from the ECU. Silly question, but are you sure the 100ms delay is not between the function call and the actual data on the bus ? Then again, I haven't taken a logic analyzer to the K bus in a long time, I don't know if that delay is usual. IIRC when dumping ROMs with SID AC, I can practically saturate the 10400 link speed, i.e. near 1ms per byte. Quote: It would be easier to work with that if the Nissan ECU would do the same, send data till stopped. I think TXmode=6 does that (i.e. 21 81 06 01) but I don't know how to stop the stream. I didn't investigate a lot, I remember trying briefly and drowning in a flood of responses.
_________________ 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 |
|
 |
|
dschultz
|
Post subject: Re: Nissan Petrol\Diesel extended PIDs request Posted: Sun Nov 04, 2018 2:11 pm |
|
 |
| RomRaider Developer |
Joined: Thu May 21, 2009 1:49 am Posts: 7323 Location: Canada eh!
|
fenugrec wrote: dschultz wrote: No, sending 21810401 1msec after received last response. It takes 0.1sec before seeing data from the ECU. Silly question, but are you sure the 100ms delay is not between the function call and the actual data on the bus ? Then again, I haven't taken a logic analyzer to the K bus in a long time, I don't know if that delay is usual. IIRC when dumping ROMs with SID AC, I can practically saturate the 10400 link speed, i.e. near 1ms per byte. That timing is up to the J2534 cable. Code: 20980 TRACE [Thread-5] - Write Msg: [protocolID=4 | rxStatus=0x00 | txFlags=0x00 | timestamp=0x0 | dataSize=6 | extraDataIndex=0 | data=0421810401AB] 21076 TRACE [Thread-5] - Read Msg: [protocolID=4 | rxStatus=0x02 | txFlags=0x00 | timestamp=0x269413d9 | dataSize=0 | extraDataIndex=0 | data=] 21078 TRACE [Thread-5] - Read Msg: [protocolID=4 | rxStatus=0x00 | txFlags=0x00 | timestamp=0x2694851b | dataSize=9 | extraDataIndex=0 | data=076181050000925ADA]
Here is the J2534 write msg followed by the Start of Msg indication. The time, the first value in msecs shows ~0.1 between the msg write and the J2534 cable indicating data is coming. The data is read 2msec later. RR Logger can send requests and process responses in under 1msec if the ECU can keep up and the line is fast enough. i.e.: on CAN we can process upwards of 80queries/sec. fenugrec wrote: Quote: It would be easier to work with that if the Nissan ECU would do the same, send data till stopped. I think TXmode=6 does that (i.e. 21 81 06 01) but I don't know how to stop the stream. I didn't investigate a lot, I remember trying briefly and drowning in a flood of responses. I'll have a look at this.
|
|
| Top |
|
 |
|
fenugrec
|
Post subject: Re: Nissan Petrol\Diesel extended PIDs request Posted: Sun Nov 04, 2018 5:08 pm |
|
 |
| Experienced |
 |
Joined: Thu Jan 09, 2014 3:07 am Posts: 652
|
dschultz wrote: That timing is up to the J2534 cable. True, unless somehow the USB request was buffered / delayed in queue, but your log confirms it's not the case. Then maybe it's rather a combination of parameters, have you modified those ? I would recommend setting P4_MIN=0, and mayber shortening P3_MIN a bit ; the defaults are 5ms and 50ms respectively. That could help with some of the delay.
_________________ 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 |
|
 |
|
dschultz
|
Post subject: Re: Nissan Petrol\Diesel extended PIDs request Posted: Mon Nov 05, 2018 4:56 am |
|
 |
| RomRaider Developer |
Joined: Thu May 21, 2009 1:49 am Posts: 7323 Location: Canada eh!
|
fenugrec wrote: dschultz wrote: That timing is up to the J2534 cable. True, unless somehow the USB request was buffered / delayed in queue, but your log confirms it's not the case. Then maybe it's rather a combination of parameters, have you modified those ? I would recommend setting P4_MIN=0, and mayber shortening P3_MIN a bit ; the defaults are 5ms and 50ms respectively. That could help with some of the delay. I hadn't changed the defaults for initial testing. Setting P4_MIN to 0 bumped the query rate up with about 0.07 secs between responses. Settings P3_MIN has the greatest affect. At setting of 10 gives about 30 queries/sec for a small packet of only four parameters.
|
|
| Top |
|
 |
Who is online |
Users browsing this forum: No registered users and 15 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
|
|