Open source GM OBD2 flash tool using a ELM327 device

They go by many names, P01, P59, VPW, '0411 etc. Also covering E38 and newer here.
Locked
osx86ftw
Posts: 9
Joined: Sun Apr 15, 2018 10:01 pm
cars: 1987 Porsche 944 5.3 swapped

Re: Open source GM OBD2 flash tool using a ELM327 device

Post by osx86ftw »

So everytime I attempt a "Read Full contents" on my 0411 ecu in my 03 S10 (lucky enough to have an 0411 in both my truck and project car :) ) I get this exception thrown:

Code: Select all

[11:06:19:200]  PCM Unlocked
[11:06:19:202]  Unlock succeeded.
[11:06:19:204]  This interface does support VPW 4x
[11:06:19:206]  TX: AT SH 6C FE F0 
[11:06:19:216]  TX: A0
[11:06:19:655]  Read failed: System.FormatException: Could not find any recognizable digits.
   at System.ParseNumbers.StringToInt(String s, Int32 radix, Int32 flags, Int32* currPos)
   at System.Convert.ToByte(String value, Int32 fromBase)
   at Flash411.Utility.<>c__DisplayClass4_0.<ToBytes>b__1(Int32 x) in C:\Users\osx86ftw\Downloads\PcmHacks-master\PcmHacks-master\Prototype\Flash411\Misc\Utility.cs:line 59
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Flash411.Utility.ToBytes(String hex) in C:\Users\osx86ftw\Downloads\PcmHacks-master\PcmHacks-master\Prototype\Flash411\Misc\Utility.cs:line 57
   at Flash411.ScanToolDevice.<SendRequest>d__6.MoveNext() in C:\Users\osx86ftw\Downloads\PcmHacks-master\PcmHacks-master\Prototype\Flash411\Devices\ScanToolDevice.cs:line 168
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Flash411.Vehicle.<VehicleSetVPW4x>d__26.MoveNext() in C:\Users\osx86ftw\Downloads\PcmHacks-master\PcmHacks-master\Prototype\Flash411\Vehicle.cs:line 511
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Flash411.Vehicle.<ReadContents>d__23.MoveNext() in C:\Users\osx86ftw\Downloads\PcmHacks-master\PcmHacks-master\Prototype\Flash411\Vehicle.cs:line 425
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Flash411.MainForm.<readFullContentsButton_Click>d__10.MoveNext() in C:\Users\osx86ftw\Downloads\PcmHacks-master\PcmHacks-master\Prototype\Flash411\MainForm.cs:line 230
Am I missing something here? This is with the latest firmware flashed as well (thanks for the pointers earlier btw)

EDIT: So accessing the allpro directly with Putty I get an OK response to AT SH 6C FE F0 , but then I get nothing for A0. I'm not quite sure what these commands mean yet, I will have to do some more research.
bubba2533
Posts: 498
Joined: Wed Apr 11, 2018 8:50 am
cars: 03 Chevy S10 Turbo V6

Re: Open source GM OBD2 flash tool using a ELM327 device

Post by bubba2533 »

Hopefully I'm not missing something, but how do I go about compiling the firmware for the allpro? Also I downloaded Magic Flash, but I don't know what selections need made (device database etc.) to flash it correctly.

Also with my P59 should I expect anything to work with the current state of master?
LS1 Boost OS V3 Here. For feature suggestions post in here Development Thread. Support future development ->Patreon.
160plus
Posts: 90
Joined: Thu Sep 21, 2017 3:00 pm

Re: Open source GM OBD2 flash tool using a ELM327 device

Post by 160plus »

I'm not at home so I can't share a screen shot of the settings in flash magic, perhaps Nsfw will be around and can post one.

As far as the Pcm Hammer currently it is only sending the flash kernel, there is no code implemented for block mode at this time. We have focused on keeping all devices at the same stage rather then making one device work at a time.

Last I knew there was a bug in the J-2534 when it would try to send the flash kernel that was being worked on. Once the j tool is working the next step will be to adding in the code to read the pcm in block mode and add in methods for error handling should something go wrong.

I haven't pulled the master branch in a couple of weeks but last I knew the flash kernel was not in it. It's an external file that has to be added in for the time being while Antus is making further improvements to his kernel. By keeping the kernel separate from the Pcm Hammer source it allows for testing changes with out needing to touch and of the code. Antus is the only one that has the most recent version of the kernel that is 100% working. I have several of the earlier revisions but they were a work in progress. NSFW would be the only other person that might have a copy of the most recent kernel but last I knew he was working on adding in addition layers for when the block mode code is added in.

This is all a work in progress, it may not look like there's much in the program right now but trust me, the actual code to read the pcm will only be a fraction of what's already in place.
User avatar
NSFW
Posts: 679
Joined: Fri Feb 02, 2018 3:13 pm

Re: Open source GM OBD2 flash tool using a ELM327 device

Post by NSFW »

The AllPro web site has screenshots of the FlashMagic settings to use, here:
http://www.obddiag.net/allpro_prog.html
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: 8250
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: Open source GM OBD2 flash tool using a ELM327 device

Post by antus »

Note that because of the state of flux of development, and the fact we are working on the solid foundations before the features you wont really be able to get anything useful yet. If you want to play or help with development feel free to jump right in. The firmware I posted has been developed further by Alex (from obddiag) and he will be pushing a firmware release 1.17 soon. He has taken by mode but also modified the memory management of the device to get as far as 2k packets. Without the additional memory management I could not get my firmware pas 130 bytes. I do not have Alex's code (only the compiled beta he gave me for testing) and am waiting for that release to go mainstream.

If you want to see a kernel upload to the car, you can compile my allpro branch, modify the packet sizes in the scantool / allpro driver to 130 bytes, and drop a kernel.bin of about 2k bytes in the app dir, and it will upload it to the pcm and tell it to run. You can use random data to see the process work, or if you have a real kernel stand alone you can use that. Fake data will upload then cause the pcm to crash and reboot, and a real kernel will run. The read implementation will probably be the next feature we add.

At the moment the 'master' branch assumes all allpros support 4x and 2k packet. Since yours does not it is crashing on the unexpected responses from allpro when it gets to the business end of the data transfer. When allpro firmware 1.17 is out we'll be able to test if the allpro firmware version is new enough and tell the user if there is a problem nicely. Up until now we didnt know what we would need to test for and it was a safe assumption we had the right device connected on our benches.
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
antus
Site Admin
Posts: 8250
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: Open source GM OBD2 flash tool using a ELM327 device

Post by antus »

Update: It looks like the 4x support made it in to the official release on May the 4th, and a couple of bug fixes since. https://github.com/ObdDiag-Net/allpro/c ... 05810bdfd9
You can probably flash in the official compiled firmware from the obddiag site.
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
bubba2533
Posts: 498
Joined: Wed Apr 11, 2018 8:50 am
cars: 03 Chevy S10 Turbo V6

Re: Open source GM OBD2 flash tool using a ELM327 device

Post by bubba2533 »

Awesome! I flashed the new firmware and now I'm able to read the properties of the PCM.
LS1 Boost OS V3 Here. For feature suggestions post in here Development Thread. Support future development ->Patreon.
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: Open source GM OBD2 flash tool using a ELM327 device

Post by MudDuck514 »

Hi Antus,

What I meant was has anyone tried interfacing a FTDI USB to RS232 adapter such as this one
https://www.aliexpress.com/item/Free-sh ... lsrc=aw.ds

to one of these scan tools
https://www.walmart.com/ip/Refurbished- ... /505219736

or better yet, this one
https://www.scangauge.com/products/scangauge-ii/


in order to connect to a PC?

Just a thought I had the other night.

Mike.
User avatar
NSFW
Posts: 679
Joined: Fri Feb 02, 2018 3:13 pm

Re: Open source GM OBD2 flash tool using a ELM327 device

Post by NSFW »

I won't say it can't be done, but I do think there are better ways to approach the problem. The first thing I'd be worried about with a device that doesn't already have a port that was intended for communication with a PC is that it might not support any of the protocols that the app supports. So even if you get the electrical connection working, the you might need to figure out the protocol next - and since the device wasn't intended for PC communication, documentation might be impossible to find.

There are lots of devices out there that are intended for use with a PC, and do have documented protocols, so those are a much better place to start. But, among those devices, not many support VPW communication at 4x speed. Without 4x support, reading and writing will be painfully slow. So far we've found that the AVT and AllPro devices support it, but the AllPro still required custom firmware.

Anything else is only going to be supported if somebody dives in and does some work to make it happen. The Macchina M2 will probably be supported in the not-too-distant future - the hardware seems capable, but the firmware doesn't exist yet, but redheadedrod intends to write it. And hopefully Thaniel's Arduino-based project can be added to the list too. And maybe, with a little bit of luck, the ScanTool folks will add 4x support to their ObdLink SX/MX/etc, but that's probably just wishful thinking.

My advice at this point is to order yourself an AllPro (the USB version) before the guy who makes them gets overwhelmed with orders. :)
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!
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: Open source GM OBD2 flash tool using a ELM327 device

Post by MudDuck514 »

NSFW,

Thanks for the reply.
As I said, I was just curious if anyone had tried.
I have been following this thread (and those on other websites) with much interest.

I have downloaded the files from the Github repository just so I could take a look at what has been done. VERY promising!

As you said, hopefully the Arduino device will be completed sometime in the near future - I like the Idea of a stand-alone controller!

I will order the AllPro device soon. Just need to save up some money!

Mike
Locked