Tools for patching P59 code

Programs / Tools / Scripts
User avatar
NSFW
Posts: 802
Joined: Fri Feb 02, 2018 5:13 am

Re: Tools for patching P59 code

Post by NSFW »

Tazzi wrote: Tue Sep 16, 2025 11:15 am I typically find either running a debugger to step through code and see where the stack is, or even outputting a debug message to the communication line helps with validating how much space is being taken up.
Have you done that with M68k code? If so, what debugger did you use?
Please don't PM me with technical questions - start a thread instead, and send me a link to it. That way I can answer in public, and help other people who have the same question. Thanks!
User avatar
antus
Site Admin
Posts: 10012
Joined: Sat Feb 28, 2009 10:34 am
cars: TX Gemini 2L Twincam 8psi
TX Gemini SR20 18psi
Datsun 1200 Ute
Subaru Blitzen '06 EZ30 4th gen, 3.0R Spec B
Subaru WRX 2007

Re: Tools for patching P59 code

Post by antus »

I think to debug a PCM over BDM you'd need a motorola spec BDM interface. There are open source designs available, but they generally bit bang from an old school parallel port and probably wont work with USB parallel emulation. There are some commercial USB options, but not cheap. You'd also need to patch the OS to disable the watchdog and update checksum and flash it back. I had to do this to get BDM talking to my E54 (no, I was not able to get re-flash over BDM working on E54 in the end). viewtopic.php?p=132511#p132511
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: 3626
Joined: Thu May 17, 2012 10:53 am
cars: VE SS Ute
Location: WA

Re: Tools for patching P59 code

Post by Tazzi »

NSFW wrote: Wed Sep 17, 2025 12:25 am Have you done that with M68k code? If so, what debugger did you use?
My testing has been with newer PPC ECUs (non VPW based), so I have not had the need for the older M68K.

In saying that, I know Li from USBJtag has demonstrated previously being able to peek/poke/step and control via BDM on a M68K. I am not sure if he ever implemented an option to implement a breakpoint style setup, but Id guess this could be a possibility to implement for him.

Most of the time, I will only use a JTAG/BDM/debugger interface to get register values when entering into a specific function for R&D or to dump RAM at a specific stage to identify areas in use. :thumbup:
Your Local Aussie Reverse Engineer
Contact for Software/Hardware development and Reverse Engineering
Site:https://www.envyouscustoms.com
Mob:+61406 140 726
Image
usbbdm
Posts: 20
Joined: Sat Sep 04, 2021 6:00 pm

Re: Tools for patching P59 code

Post by usbbdm »

If anyone needs debug feature please contact me and I will what I can do for you.
User avatar
antus
Site Admin
Posts: 10012
Joined: Sat Feb 28, 2009 10:34 am
cars: TX Gemini 2L Twincam 8psi
TX Gemini SR20 18psi
Datsun 1200 Ute
Subaru Blitzen '06 EZ30 4th gen, 3.0R Spec B
Subaru WRX 2007

Re: Tools for patching P59 code

Post by antus »

Its probably a big ask but if you can make it work with linux drivers and gdb then I think it'd talk to ida and that would be a huge win.
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
AngelMarc
Posts: 612
Joined: Sat Apr 08, 2023 11:23 am
cars: A CB450 running to 8,000RPM with a P59.

Re: Tools for patching P59 code

Post by AngelMarc »

+1 on the Linux support, just to keep away from windows being required.
can't switch my desktop for other reasons (niche audio stuff), would love to do fedora on my laptop and be able to use all these cool things.
The niche audio stuff is active audio cross over. meaning splitting the audio into highs and lows with software, then putting those on their own channels of a soundblaster so bass has it's own amp. Just a complicated 2.2 setup. If anybody knows how to do that on modern Linux (wayland/pipewire), message me.
Don't stress specific units.
User avatar
AngelMarc
Posts: 612
Joined: Sat Apr 08, 2023 11:23 am
cars: A CB450 running to 8,000RPM with a P59.

Re: Tools for patching P59 code

Post by AngelMarc »

For anybody trying to get real deep into it. This is some math I did for the 24x wheel (for my custom ECU).
Somewhere buried in the logic, I bet you'll find these numbers (or a multiple of them). "The per degree" is just that.
RPMTime is one tooth to the next.
Assuming it's based on 720 degrees.
Capturef.PNG
Assuming it's maybe always 360 degrees.
Capturew.PNG
Also shown is microsecond per full rotation.

Just in case this helps anybody figure it out even more.
You do not have the required permissions to view the files attached to this post.
Don't stress specific units.