Halting Kernel freezes PCM w/J2534 VCI only

They go by many names, P01, P59, VPW, '0411 etc. Also covering E38 and newer here.
Post Reply
User avatar
Gampy
Posts: 2330
Joined: Sat Dec 15, 2018 7:38 am

Halting Kernel freezes PCM w/J2534 VCI only

Post by Gampy »

Hi all,

Working with Antus's code here: viewtopic.php?f=42&t=6604&start=10#p96929 and find a weird issue that I cannot wrap my pea brain around, thought I would ask if anyone has seen this before, or knows whats up ...

Halting the kernel (6C 10 F0 20) freezes the PCM only when using a J2534 VCI. Tested with a GM MDI Clone and Genuine Bosch Mastertech II.
And I do mean FREEZES, it's hard, disconnect battery hard!

However, it works perfect with non J2534 VCI's, for example, a SparkFun, Allpro and a Generic ELM all work perfect.

Here is the real odd part ... If I change the command to something other than 20, for example changing it to 30, it works perfect even with a J2534 VCI.
And while the kernel is changed to use other then 20, sending 20 still freezes the PCM!

At this point the PCM/kernel has no clue what 20 is ... It should just ignore it and continue.

Any ideas ??

Thanks
-Enjoy
Intelligence is in the details!

It is easier not to learn bad habits, then it is to break them!

If I was here to win a popularity contest, their would be no point, so I wouldn't be here!
kur4o
Posts: 948
Joined: Sun Apr 10, 2016 9:20 pm

Re: Halting Kernel freezes PCM w/J2534 VCI only

Post by kur4o »

Just random ideas.

Watchdog is disabled and pcm goes into infinite loop. pcm DataLinkController errors and stop working.
Pcm crashes and watchdog don`t reboot it.

It is very hard to crash the pcm and it doen`t recover. It needs watchdog reset in infinite loop.

Is this x4 and x1 mode related. It may leave the pcm in x4 mode while vci returns to x1 mode. Need to trace in disassembly what goes in custom code with mode 20. Usually mode 20 resets some stuff and leave watchdog reboot the code. It is maybe related to how pcm exits flash routine.
User avatar
antus
Site Admin
Posts: 8237
Joined: Sat Feb 28, 2009 8:34 pm
cars: TX Gemini 2L Twincam
TX Gemini SR20 18psi
Datsun 1200 Ute
Subaru Blitzen '06 EZ30 4th gen, 3.0R Spec B
Contact:

Re: Halting Kernel freezes PCM w/J2534 VCI only

Post by antus »

It sounds like its crashing the DLC. If its the bitstream not the kernel I'd put a scope on the wire and look for minor electrical differences in the actual VPW signal. VPW isnt the best electrical standard, for example NSFW was unable to get his allpro to talk to his PCM, unless he hung a double adapter off the side of the cable connection. Nothing on it, it just made enough of a difference electrically, probably timing changes from the capacitance, that it then worked.

It could also be similar to the as yet unexplainable crash that only happens on my p04 pcm with pcmhammer with a particular bin, and always at the same place due to the data.

The fix might be guess work - changing the timing just a fraction somewhere while driving the the DLC.

I am glad someone is using that code :thumbup:
Have you read the FAQ? For lots of information and links to significant threads see here: http://pcmhacking.net/forums/viewtopic.php?f=7&t=1396
MudDuck514
Posts: 397
Joined: Wed Jul 05, 2017 8:30 am
cars: 2001 Pontiac Grand AM SE
LD9 2.4l I4, 4T40E
2005 Chevrolet Venture
LA1 3400 V6, 4T65E
Location: North TX, USA

Re: Halting Kernel freezes PCM w/J2534 VCI only

Post by MudDuck514 »

Have you modified THAT code to run on something other than an AVT cable?
If NOT, could that be your problem.

Just a thought.

Mike
User avatar
Gampy
Posts: 2330
Joined: Sat Dec 15, 2018 7:38 am

Re: Halting Kernel freezes PCM w/J2534 VCI only

Post by Gampy »

Hi all,

It appears that simply sending '6c 10 f0 20' causes the issue, if one adds additional bytes it seems to solve the issue, example: '6c 10 f0 20 54 32 10'.
I have not changed PCM Hammer's halt statement, however I have done in the neighborhood of 200 reads within the last couple days using this assembly kernel and it has not once locked up/crashed the PCM!

Anyhow, as stated in the first post I have been thinning my hair with Antus's "test.asm", here are some results.

I am no assembly programmer, I just hack my way through errors by trial, it's a slow tedious process ... But the results are enticing!

P01
PcmHammer_debugLog_20230320@013101.txt
(1.54 MiB) Downloaded 52 times
P04 AMD, no Intel P04 to test.
PcmHammer_debugLog_20230320@013515.txt
(1.54 MiB) Downloaded 48 times
P10
PcmHammer_debugLog_20230320@013941.txt
(1.54 MiB) Downloaded 45 times
P12
PcmHammer_debugLog_20230320@014535.txt
(3.08 MiB) Downloaded 49 times
P12b
PcmHammer_debugLog_20230320@015616.txt
(6.15 MiB) Downloaded 45 times
P59 Intel
PcmHammer_debugLog_20230320@020216.txt
(3.08 MiB) Downloaded 48 times
P59 AMD
PcmHammer_debugLog_20230320@020755.txt
(3.08 MiB) Downloaded 48 times
E54 (older 2002)
PcmHammer_debugLog_20230320@021638.txt
(1.54 MiB) Downloaded 48 times
Now that it's stable, I will work on writes, CRC is going to be tough, likely tougher then I, I do not know how to calculate a CRC in the first place, plus I am an absolute math dummy, but I'll look at a disassembly of PCMHammers kernel and see if I can muddle my way through.
Regardless it's not going to happen overnight, or possibly even before I run out of time, but I'll plug along as long as I can!

Sure wish I knew an assembly coder, I would entice them with green hard cash ...

If anyone knows of any CRC code in assembly could you please point me to it, architecture does not matter, however m68k would be nice. :)

-Enjoy
Intelligence is in the details!

It is easier not to learn bad habits, then it is to break them!

If I was here to win a popularity contest, their would be no point, so I wouldn't be here!
User avatar
antus
Site Admin
Posts: 8237
Joined: Sat Feb 28, 2009 8:34 pm
cars: TX Gemini 2L Twincam
TX Gemini SR20 18psi
Datsun 1200 Ute
Subaru Blitzen '06 EZ30 4th gen, 3.0R Spec B
Contact:

Re: Halting Kernel freezes PCM w/J2534 VCI only

Post by antus »

Nice work!

For the CRC the C version is here: https://github.com/LegacyNsfw/PcmHacks/ ... nels/crc.c

Being that its not going to be so timing critical as the parts of the code that drive the hardware, you might be able to compile it with heavy optimisation and then decompile it to get a tight asm example which you could also compare to the source to try and follow the code.

You could run a compiled version with any level of optimisation, and any asm code you write in http://www.easy68k.com/ as you wont need anything hardware specific. This will make your development cycles quicker and allow you to confirm its stable and functionally equivalent before you attempt to put it in in the kernel.

The biggest gotcha I hit with 68k was that certain operations dont clear the register, only update part of it. So you can write code and believe a register will be empty after a certain opcode, only to find that its crashing because its not. An emulator should make this visible in a way you wont be able to see on the pcm.
Have you read the FAQ? For lots of information and links to significant threads see here: http://pcmhacking.net/forums/viewtopic.php?f=7&t=1396
In-Tech
Posts: 778
Joined: Mon Mar 09, 2020 4:35 pm
Location: California

Re: Halting Kernel freezes PCM w/J2534 VCI only

Post by In-Tech »

Hiya,
I've only done assy on 8 and a small amount of 16bit, never any '332 stuff. I would bet it still trickles 8 bit stuff, just a guess though. It will take a bit of work but I can alter my assembler with new opcodes :)
User avatar
Gampy
Posts: 2330
Joined: Sat Dec 15, 2018 7:38 am

Re: Halting Kernel freezes PCM w/J2534 VCI only

Post by Gampy »

antus wrote:For the CRC the C version is here: https://github.com/LegacyNsfw/PcmHacks/ ... nels/crc.c
And the original works of that CRC code is here: Barr Group

-Enjoy
Intelligence is in the details!

It is easier not to learn bad habits, then it is to break them!

If I was here to win a popularity contest, their would be no point, so I wouldn't be here!
In-Tech
Posts: 778
Joined: Mon Mar 09, 2020 4:35 pm
Location: California

Re: Halting Kernel freezes PCM w/J2534 VCI only

Post by In-Tech »

Gampy wrote:
antus wrote:For the CRC the C version is here: https://github.com/LegacyNsfw/PcmHacks/ ... nels/crc.c
And the original works of that CRC code is here: Barr Group

-Enjoy
Hiya, and yes, another complication of CRC because of a new complicated version of assemblies, focking ridiculous. Anyhoosit, :comp:
Post Reply