PCM Hammer P12 development

They go by many names, P01, P10, P12, P59, E38, VPW, '0411 etc.
User avatar
antus
Site Admin
Posts: 9017
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: PCM Hammer fails on P12

Post by antus »

try this payload

Code: Select all

start:
wait01:
    bsr.w   ResetWatchdog
    bsr.w   WasteTime
    jmp.s   wait01
    
WasteTime:
    nop
    nop
    nop
    nop
    rts

ResetWatchdog:
    move.b  #0x55, (0xFFFA55).l			| Reset COP1
    move.b  #0xAA, (0xFFFA55).l
    bclr    #7,	(0xFFFA21).l			| Reset COP2
    bset    #7,	(0xFFFA21).l		
    rts	

.end
Attachments
watchdog.bin
(56 Bytes) Downloaded 217 times
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
User avatar
Tazzi
Posts: 3552
Joined: Thu May 17, 2012 8:53 pm
cars: VE SS Ute
Location: WA
Contact:

Re: PCM Hammer fails on P12

Post by Tazzi »

Antus, is that code not assuming FA21 already has bit 7 enabled? Might be better using the eori.b command instead.
Your Local Aussie Reverse Engineer
Contact for Software/Hardware development and Reverse Engineering
Site:https://www.envyouscustoms.com
Mob:+61406 140 726
Image
User avatar
antus
Site Admin
Posts: 9017
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: PCM Hammer fails on P12

Post by antus »

Thats what I use in my other kernels for ls1-flash free, cut down so its just the delay and watchdog code, updated to the addresses to what should suit here. I think getting rid of compiler weirdness from c and using bare bones known good asm was worth a try.
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
User avatar
Gampy
Posts: 2332
Joined: Sat Dec 15, 2018 7:38 am

Re: PCM Hammer fails on P12

Post by Gampy »

12587603 has bclr/bset, FFFF0000 disassembly is bset/bclr.

Have not ripped the bin posted by darkman5001 apart yet ... However if someone that has, searches for $AAAA and finds,

Code: Select all

    move.w  #$AAAA,(a4)
    move.w  #$5555,(a5)
    move.w  #$A0A0,(a4)
Just below that a little should be the COPs.
What it looks like In 12587603,

Code: Select all

    move.b  #$55,($FFFFFA27).w ; 'U' ; COPA
    move.b  #$AA,($FFFFFA27).w ; COPA
    bclr    #7,($FFFFD006).w ; COPB
    bset    #7,($FFFFD006).w ; COPB
What order is it ... bset/bclr or bclr/bset.

I'll take odds 10 to 1 on a beer that it dies, just like the simplest C with COPs. :thumbup:

What is expected, how will we (or the tester) know what's happened ... It does not complete, therefor there is no completion ack sent.
Wouldn't it be better to have a loop that lives longer then the COP timeout, but not to long, then exit, thus returning an ack, thus we know the scratch is working.
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
Gampy
Posts: 2332
Joined: Sat Dec 15, 2018 7:38 am

Re: PCM Hammer fails on P12

Post by Gampy »

And to advance my ASM skills, does this do that ??
Edit; I'm no math genius, is 1000 enough to out live the COP timeout ... Now that I think about it, it probably should be like 3000 (>2500) ??

Code: Select all

start:
    clr.w   %d0
wait01:
    bsr.w   ResetWatchdog
    bsr.w   WasteTime
    addq.w  #1, %d0
    cmpi.w  #1000, %d0
    beq.w   Exit1
    jmp.s   wait01
   
WasteTime:
    nop
    nop
    nop
    nop
    rts

ResetWatchdog:
    move.b  #0x55, (0xFFFA55).l         | Reset COP1
    move.b  #0xAA, (0xFFFA55).l
    bclr    #7,   (0xFFFA21).l         | Reset COP2
    bset    #7,   (0xFFFA21).l      
    rts   

Exit1:

.end
WatchDog-SimpleLoop-FF2000.bin
(68 Bytes) Downloaded 290 times
It's back ... I do not know for sure how to just end the routine/program and return to the caller!
I don't want to reset, I don't want to rts, I have no way to test ATM ... working on that ASAP!

I took it down posted it back, it's not going to do harm, just educate!
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!
darkman5001
Posts: 252
Joined: Sat Dec 18, 2021 8:15 am
cars: 2005 Yukon, 2004 Suburban, 2001 Tahoe, 2002 Envoy, 2006 Envoy, 2003 Lincoln LS
Location: New Jersey, USA

Re: PCM Hammer fails on P12

Post by darkman5001 »

Has anyone been able to decompile the bin of the flash chip that I uploaded?
User avatar
Gampy
Posts: 2332
Joined: Sat Dec 15, 2018 7:38 am

Re: PCM Hammer fails on P12

Post by Gampy »

I have not tried yet, been a rough morning ...

Try the two posted bin files.
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!
ironduke
Posts: 695
Joined: Thu Feb 13, 2020 11:32 pm
cars: Mainly GM trucks, a Cruze and an Equinox for dailys..

Re: PCM Hammer fails on P12

Post by ironduke »

darkman5001 wrote:Has anyone been able to decompile the bin of the flash chip that I uploaded?
I took a quick peek of the one antus fixed..
Something seems off to me..
The OS looks ok but the OS has the other segments addresses right in the beginning.. The ones I read do not match up. Secondly if you take the vin that's there and go to tis2web and pull up the calibration info the cal id's aren't there anywhere never mind at the beginning of the segment location that the OS pints to for that segment like they usually are..

Gotta say, I don't do much work on the older, pretty much just E38 and E92 but I do see similarities across ecu's including the OS "header" having addresses forthe rest of the segments.. Those addresses in your bin make sense, just the data at the locations don't..

Please whomever feel free to correct me if I am incorrect, this is just my thoughts.. I am sure I am using the wrong terminology, spelling, and thought process, lol..
User avatar
turbo_v6
Posts: 512
Joined: Wed Apr 11, 2018 8:50 am
Contact:

Re: PCM Hammer fails on P12

Post by turbo_v6 »

I'm attempting to disassemble the one antus posted. It seems like it worked, but it is very different from the P01/P59 OS's that I've disassembled.

There seem to be a lot of NOP's throughout.

I'll look a little more but I haven't found what Gampy was looking for, but I found this that looks similar:

Code: Select all

move.b  #$55,(byte_FFFA55).w
move.b  #$AA,(byte_FFFA55).w
eori.b  #$80,(byte_FFFA21).w
Not sure exactly what else I should be looking for, but I can keep looking if that's not right.
LS1 Boost OS Version 5 Available Here. For feature suggestions post in here Development Thread.
User avatar
Gampy
Posts: 2332
Joined: Sat Dec 15, 2018 7:38 am

Re: PCM Hammer fails on P12

Post by Gampy »

I ain't no genius at this disassembly stuff ... I'm stumbling like an old man!
Seems y'all got me beat ... :oops:

Using CPU32, based 0x0/1m, what RAM base/size ??

I did repost my hack of Antus's assembly, it can't hurt, only educate ...
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!
Post Reply