Daewoo Lanos 1.5L Euro II - KDAC with ZXJN

European GM ECUs and PCMs
L2-Max
Posts: 19
Joined: Wed Apr 29, 2009 10:45 pm
cars: Lanos 1.5 SOHC

Daewoo Lanos 1.5L Euro II - KDAC with ZXJN

Post by L2-Max »

I have couple questions :oops:

My car is Daewoo Lanos 1.5L Euro II. ECU installed is KDAC with ZXJN program id.

The question is how do reflash that ECU?. Is it wossible at all? I found no info about ALDL modes which allow flash writing. The ECU fully supports 0,1,2 4 which I tested.
How your program writes flash. I couldnt see that because my ECU not recognised by it.

My guess that ECU should support mode wich allow to write RAM and execute it, then loader will reflash ECU.
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: The FlashTool

Post by antus »

What year is that ECU? Most our testing here is currently with early 90s australian delco ecus, which have a 16bit architecture allowing 64kbyte of address space max (without bank switching, which is done in the VS commodore ecu to allow 128k of data).

If your car is a 2000 model, then the ecu is probably a newer style. It would be great if you could post some pics of it or any info about it. Not much info is public about most euro gm ecus, but feel free to hang around and ask questions and we'll help all we can if you want to figure it out.

This flash tool uses the processors write feature, but that will not work with a standard memcal on eprom. We replace the eprom with nvram, wire the write line if it is not connected, and patch the binary to support a non-official write command. Newer ECUS dont need this as they have flash memory allready, and the process is closer to what you said - unlock the ecu security, upload a flash writer to its ram and execute it, then send the new binary over.
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
VL400
Posts: 4991
Joined: Sun Mar 01, 2009 2:54 pm
cars: VL Calais and Toyota Landcruiser. Plus some toys :)
Location: Perth, WA
Contact:

Re: The FlashTool

Post by VL400 »

L2-Max wrote:Thanks for you work but smalest problem exists.

The read timeout between arrival of two bytes is small. I'm using adapter on ftdi chip and coudnt read any dump of memory. I have run PORTMON NT which capture adapter port and I see that your program has been interrupted by timeout every request it do. It reads not fully data which my ECM transfer.
Thanks for the bug report :) I have had this issue in the past and made a program change to correct it, you can use the 'Comm Timeout' option in the preferences to adjust the timeout. Maybe the timeout needs to be made larger than the default in your case.

Let me know how you go.
L2-Max
Posts: 19
Joined: Wed Apr 29, 2009 10:45 pm
cars: Lanos 1.5 SOHC

Re: The FlashTool

Post by L2-Max »

Portmon log in attacment. There is GetCal request. I did it on my PC with ECU emulation. I purposely set 1 - 10 msecs (randomly) between bytes to forse problem.

By my expirience with my ECU the reading timeout is 1000. / baudRate * bitsPerFrame + constant. (read MSDN for COMMTIMEOUTS::ReadIntervalTimeout field).

Note: if wait for silence is > 0 then program have no time to read any packets on real ECU ;) I think it is caused by ReadIntervalTimeout == -1 and ReadFile functions returns immediately if any bytes in the buffer.
Attachments
Portmon.rar
(8.98 KiB) Downloaded 549 times
User avatar
VL400
Posts: 4991
Joined: Sun Mar 01, 2009 2:54 pm
cars: VL Calais and Toyota Landcruiser. Plus some toys :)
Location: Perth, WA
Contact:

Re: The FlashTool

Post by VL400 »

Thanks, I had a look at the log but cannot see where its failing? Have you tried adjusting the preferences for comm timeout?

The wait for silence is only for before a request is made to stop or start chatter, this is done at the start and end of a read or write function and is used to stop the BCM or ABS from communicating. If you uncheck 'Disable Chatter' The wait for silence is not used.
L2-Max
Posts: 19
Joined: Wed Apr 29, 2009 10:45 pm
cars: Lanos 1.5 SOHC

Re: The FlashTool

Post by L2-Max »

antus wrote:What year is that ECU? Most our testing here is currently with early 90s australian delco ecus, which have a 16bit architecture allowing 64kbyte of address space max (without bank switching, which is done in the VS commodore ecu to allow 128k of data)
My car is 2007 year. Poland (FSO) manufacturer. VIN SUPTF69...........

I'm not familary fith microcontrollers but what I found:
There is 68HC11 8bit microcontroller (but I'm not sure).
There is flash memory installed.

I attach original prom image for my car.

I want to know is there ALDL mode to download image exists or FlashTool uses some loader to reflash ? What is the mode ?
Attachments
Daewoo_Lanos_ZXJV.rar
(19.08 KiB) Downloaded 649 times
Last edited by L2-Max on Fri May 01, 2009 5:23 am, edited 1 time in total.
User avatar
VL400
Posts: 4991
Joined: Sun Mar 01, 2009 2:54 pm
cars: VL Calais and Toyota Landcruiser. Plus some toys :)
Location: Perth, WA
Contact:

Re: The FlashTool

Post by VL400 »

The flash tool uses either mode 11 or mode 12 - mode 11 writes in 8 byte blocks and mode 12 in 128byte blocks. These are ALDL modes that have been added, they are not part of a factory GM ECM code.

The bin you have attached looks like HC11 code, can see in the init area that it sets the stack to 0x03FF (so thats the size of RAM). But what modes, would have to disassemble the bin for that really.
L2-Max
Posts: 19
Joined: Wed Apr 29, 2009 10:45 pm
cars: Lanos 1.5 SOHC

Re: The FlashTool

Post by L2-Max »

VL400 wrote:Thanks, I had a look at the log but cannot see where its failing?
Look start from 41 packet. You send request then you start to read echo. Read only 2 bytes then abort serial line. It means adapter has no time to reply. It is appears aon most packets ant not only while echo sent.

Then look at 36 packet. RI:-1 RM:-1 RC:60 WM:0 WC:60
What MSDN says:
If an application sets ReadIntervalTimeout and ReadTotalTimeoutMultiplier to MAXDWORD and sets ReadTotalTimeoutConstant to a value greater than zero and less than MAXDWORD, one of the following occurs when the ReadFile function is called:



If there are any bytes in the input buffer, ReadFile returns immediately with the bytes in the buffer.
If there are no bytes in the input buffer, ReadFile waits until a byte arrives and then returns immediately.
If no bytes arrive within the time specified by ReadTotalTimeoutConstant, ReadFile times out.
Looks like first case is your, but I cant excactly determine problem because I don't know how you process replies.

That's timeouts which I set in my tool RI:37 RM:20 RC:0 WM:20 WC:50

If you interest full source code and binaries
http://depositfiles.com/files/90q7ppp5e or http://filestore.com.ua/?d=F540E4713
and disscussion http://lanos.com.ua/forum/viewtopic.php?f=71&t=28615 in russian, sorry :roll:
Last edited by L2-Max on Thu Apr 30, 2009 7:14 pm, edited 1 time in total.
L2-Max
Posts: 19
Joined: Wed Apr 29, 2009 10:45 pm
cars: Lanos 1.5 SOHC

Re: The FlashTool

Post by L2-Max »

VL400 wrote:The flash tool uses either mode 11 or mode 12 - mode 11 writes in 8 byte blocks and mode 12 in 128byte blocks. These are ALDL modes that have been added, they are not part of a factory GM ECM code.

The bin you have attached looks like HC11 code, can see in the init area that it sets the stack to 0x03FF (so thats the size of RAM). But what modes, would have to disassemble the bin for that really.
All is clear ... only loader will resque me :roll:
L2-Max
Posts: 19
Joined: Wed Apr 29, 2009 10:45 pm
cars: Lanos 1.5 SOHC

Re: The FlashTool

Post by L2-Max »

I read M68HC11RM document from frescale. I found Boot loader listing. There is a comment:
* THIS BOOTSTRAP PROGRAM ALLOWS THE USER TO
* DOWNLOAD A PROGRAM OF EXACTLY 256 BYTES.
* THE PROGRAM MUST START AT $0000.
* EACH BYTE OF THE PROGRAM IS RECEIVED BY THE
* SCI, STARTING WITH THE $0000 BYTE AND WORKING
* UP TO THE $00FF BYTE.

reading listing I see set BAUD tu 8192 and wait for FF byte to start download ...

Why boot loader sets stack to 0x0FF if memory up to 0x400?

Does somebody use that loader to download user program into RAM (I mean - does realy work?)?.
Post Reply