Just4Trionic
Well, if you came here I guess you either wondered what the name meant, or you are a regular at www.trionictuning.com and forum.ecuproject.com.
Just4Trionic is an alternative to the Lawicel CANUSB dongle - and then some :-)
Just4Trionic Project Software Code: Just4Trionic Software
Just4Trionic Wiring and Circuit Board Designs: Just4Trionic_mini.zip
Ecuproject and Trionictuning forum member 'uglybug' made this neat version of Just4Trionic for me. He also drew the wiring circuit and circuit board design, using EagleCAD
Performance of Built-in CAN FLASH Functions
CAN (615 kbps or P-BUS)
Operation | Trionic5.5 | Trionic7 | Trionic8 |
---|---|---|---|
DUMP | 47s | 1m38s | 10m32s |
FLASH | 50s(1) | 40s | 2m55s |
RECOVER | n/a | 2m15s | 2m56s |
BDM
Operation | Trionic5.5 | Trionic7 | Trionic8 |
---|---|---|---|
DUMP | 8s | 17s | 33s |
FLASH | 28s(1) | 26s | 56s |
NOTES
- If you have a T5.5 ECU with so-called 'bad FLASH' chis and want to replace them I recommend Microchip SST39SF010 chips. FLASHing times with these chips are 35s for the CAN interface and 14s for BDM.
Pros:
- Cheaper than Lawicel CANUSB
- Combined BDM and CAN Bus programming solution
- Open Source, Customisable - there's nothing to stop you from adding your own special tweaks and features...
Cons:
- Something of a work in progress - but is quite usable now...
- It's a DIY project - unless someone with a little entrepreneurial spirit comes up with a pre-packaged solution.
Current Project Status:
- Trionic Suite integration
- FLASHing and DUMPing works with the TxSuites and Flashers
- Logging needs some work (low FPS, often disconects)
- Stand alone CAN and BDM DUMP, FLASH and RECOVERY (T8) capabilities
- use any computer operating system, Linux, Windows, Apple and a terminal emulator (e.g. PuTTY)
CAN Connection
- DUMP and FLASH BIN files over the CAN Bus for Trionic 5.x,7 and 8 ECUs:
- CAN Bootloader for Trionic 5.2 and Trionic 5.5 ECUs works with original 28F512/28F010 FLASH chips and many replacement 29F010 FLASH chip types.
- Reliable T7 CAN FLASHing on I-BUS as well as P-BUS
- T8 CAN DUMP, FLASH and RECOVER using P-BUS
BDM Connection
- DUMP and FLASH BIN files over the BDM connection for Trionic 5.x, 7 and 8 ECUs.
- BDM FLASHing using Target Resident Drivers for speed
- Works with all original FLASH chips and many types of replacement 29/39F010 FLASH chips in T5.x ECUs
History
23rd April 2016 - Version 1.6
- Faster T7 CAN P-BUS FLASH algorithm
25th April 2015 - Version 1.5 is a Major update:
- Supports BDM and CAN read and write of T5.x, T7 and T8 ECU's plus T8 recovery.
- Target Resident Driver for BDM gives BDM operations a big speed boost.
- Supports many alternative replacement FLASH chips for T5.x ECU's:
- AMD29F010, ST29F010, AMIC A29010l, Atmel 29C010/512, SST39SF010.
11th September 2013 - Added T8 CAN DUMP and FLASH capability (recovery still to do)
7th June 2011 - Very basic T7 CAN FLASHing and DUMPing for P-BUS connection only at the moment - Also needs MyBooty v2.x for T5 CAN flashing
(NOTE: MyBooty isn't needed for T7 CAN or BDM FLASHing)
14th Dec 2010 - IMPORTANT - changes to BDM connections to allow faster BDM speeds. Uglybug (thank you) has provided an updated wiring circuit at forum.ecuproject.com:
http://forum.ecuproject.com/showthread.php?2645-Project-Just4Trionic-A-DIY- CAN-Bus-programmer-and-more&p=64451&viewfull=1#post64451
Small update which fixes Trionic 7 FLASH chip detection - It's now possible to use BDM to FLASH T7 ECUs :-)
14th Sept 2010 - Finally I got around to releasing a version of the software with BDM connection! I have updated the web-links - thank you Sukkin for telling me they didn't work.
21st July 2010 - Update to say that the BDM connection is now working (but only just) and some more information (BDM software is based on johnc's USB BDM software).
19th May 2010 - First version with CAN bus connection only.
OLD AND LARGELY OUTDATED INFORMATION, BUT GIVES SOME IDEA HOW TO USE JUST4TRIONIC
This is a link to the latest version of the program that you need on mbed:
Just4Trionic
Here are the previous versions - Just4Reference:
Just4Trionic NOTE: This is the last version that uses MyBooty v1.x and T5 615 kbps CAN speed
Just4Trionic
Just4Trionic
Now with CAN and BDM interfaces. Lots of changes in version 1.1:
BDM interface
More or less automatic - no need to interpret the cryptic CAN messages. Both CAN and BDM software work out the type of ECU that is connected and check the BIN file to make sure it matches the ECU type. Consequently much of the description below isn't needed any more because the software does most of the working out and checking for itself now :-)
Follow the link above and use the download link to copy the program to your own mbed. You can also import the program into your own compiler area too.
As well as the Just4Trionic program you will need to copy my bootloader to the mbed to allow you to DUMP and FLASH your T5 ECU. Get my bootloader from the forum.ecuproject.com on this page:
http://forum.ecuproject.com/showthread.php?2623-Project-T5-Bootloader-for- AMD29F010-FLASH-chips
Download the .ZIP file and copy the 'MyBooty.S19' file to your mbed.
Future Plans:
Make CAN connection work with Trionic 8 too.
Proper integration with Dilemma's Trionic Suites.
Self-contained in-car DUMPing and FLASHing without needing to connect to a laptop (similar in concept to a BSR PPC tuning unit)
Lots and lots of tidying up and prettyfication :-)
Other Possibilities:
Add USB Bluetooth using Peter Barrett's BlueUSB project - then it might be able to make something like Dilemma's CarPC program for mobile phones (I have seen something called Carman that works on Nokia mobile phones, maybe there are others)
Add some switches to DUMP and FLASH at the press of a button
Add an LCD display for 'live' engine data (a mini CarPC) - see this cookbook example: http://mbed.org/projects/cookbook/wiki/MobileLCD
Add an SD or microSD card to save the mbed 'disk' wearing out as reccomended by the mbed staff - see this topic: http://mbed.org/forum/mbed/topic/672/ and this cookbook example: http://mbed.org/projects/cookbook/wiki/SDCard
Sukkin Pang has very recently made a commercial product along these lines: http://mbed.org/forum/news-announcements/topic/900/
although it does not have Just4Trionic's BDM interface (and is it just me or is there something coincidental about it being topic 900 :-).
What I have achieved so far :
This is my Just4Trionic system with CAN bus and BDM connections. The CAN bus connection can be used to read (known as 'dumping') and program (known as 'FLASHing') BIN files without opening the Trionic ECU box. Sometimes things can go wrong though :-( and that is where the BDM connection can be used to revive an ECU if the CAN connection method fails for some reason.
PLEASE note that the T5 ECUs are quite old and the FLASH chips in them sometimes fail completely, not even the BDM completely. Some people have been able to fix their T5 ECUs by using high voltages others may have had some success with my 'forced' erase script for BD32. johnc has written an article about a special technique that can help: http://forum.ecuproject.com/viewtopic .php?f=73&t=2489&p=27653&hilit=berr+pin#p27653. But often the only way to fix a failed ECU is to replace the FLASH chips which is discussed in this topic: http://forum.ecuproject.com/viewtopic.php?f=20&t=1078
This is what the Just4Trionic wiring looks like (NOTE this picture is a little out of date and some of the BDM connections have changed since it was taken):
The CAN bus connection is from this cookbook example: http://mbed.org/projects/cookbook/wiki/CanBusExample1. The BDM connections are simple wires to the square connector. uglybug has very kindly posted the wiring circuits here: http://forum.ecuproject.com/viewtopic.php?f=51&t=2957#p31979 the files are Eagle CAD files (for free @ www.cadsoft.de) (thank you johnc for telling me what they are - although I haven't seen them for myself yet :roll:).
A very big thank you to Mackan who very kindly sent me the special Trionic connector which makes it a lot easier to connect up the whole system. Also in the photo are the power unit I use and a special 'T9' screwdiver needed to undo the 'star' screws on the T5 ECU.
My power unit is 16 Volts and 0.93 Amperes (how precise, I'm sure there's a good reason for it :lol:)
UPDATE: The BDM connection now works:
Dumping a BIN file and saving it onto the mbed 'disk' takes less than 8 seconds! (of which 6 seconds is to save the the BIN file, the BDM part takes just 1.66 seconds). FLASHing and Erasing are much slower because far more data has to be sent over the BDM connection. FLASHing my BIN file takes around 34 seconds , erasing takes longer still and is around 80 seconds. Of course the FLASH chips must be erased before FLASHing the new BIN file so whilst it only takes 8 seconds to read the BIN file it takes almost a whopping (by comparison) 2 minutes to FLASH the new BIN file. johnc are working on ideas for a faster method (which isn't really necessary, but is becoming something of an obsession :lol:)
One thing I would do differently would be to use a different connector for the CAN Bus - more than once I've accidentally plugged into the BDM connector and wondered why nothing was happening! * uglybug's says he has put a different connector for the CAN bus connection in his wiring circuit *
Using Just4Trionic
Just4Trionic is controlled using the USB/serial interface. You have to install the mbed driver to get that working. The mbed driver is here:
http://mbed.org/projects/handbook/wiki/WindowsSerialConfiguration
You can use TeraTerm or, I have since found out that Hyperterminal works too. Set it to connect to your mbed 'COM' port with a speed set to 115,200. I have found that the mbed connection is a bit tricky. I find it most reliable if I unplug the CAN bus connector on my mbed, plug everything else in, set up TeraTerm or Hyperterminal and then plug the CAN Bus connector into mbed last of all. Otherwise I find that Tera Term / Hyperterminal don't work and I have to change the 'COM' port to another one and back again. There seems to be some sort of power-surge or something that happens if you plug power into the T5 ECU that causes this.
Once you've got everything together you'll want to know how to use Just4Trionic I suppose. At the moment it's very basic - I've only written enough software code to do a few basic things - and you'll have to interpret what you see on the Tera Term program to work out if it's working properly or not!
**
**
Things That You Can do with Just4Trionic:
Without MyBooty: Read out the software version, symbol table and adaption data
With MyBooty: DUMP and FLASH, check the checksum and show the type of FLASH chips in your ECU.
Using Just4Trionic
So, you've come this far, everything is plugged in, you've started TeraTerm or Hyperterminal. Now press the reset button on mbed and you should see this screen displayed:
Just4Trionic Command Menu
b/B - Start BDM interface (NOT DONE)
o/O - Open Lawicel CAN232 type interface (NOT DONE)
5 - Start Trionic5 ECU CAN interface
So far only the CAN interface works so press the '5' key on your keyboard to see this screen displayed:
Trionic 5 Command Menu
b - upload and start MyBooty.S19 bootloader
c - get T5 ECU FLASH checksum (need toupload BOOTY.S19 before using this command)
d - dump the T5 FLASH BIN file and write it to ORIGINAL.HEX
f - FLASH the upate file MODIFIED.S19 to the T5 ECU
e - erase the FLASH chips in the T5 ECU
r - read SRAM and write it to ADAPTION.HEX file
s - read Symbol Table, display it and write it to SYMBOLS.TXT
v - read T5 ECU software version, display it and write it to VERSION.TXT
q - exit the bootloader and reset the T5 ECU
t - read the FLASH chip type in the T5 ECU
S - send 's' message (to get symbol table)
V - send 'S' message (to get software version)
'Enter' Key - send an CR message
a - send an ACK
A - read a single symbol from the symbol table
'ESC' - return to mbed CAN tool Menu
h/H - show this help menu
If all is well you should also see 2 CAN messages from the T5 ECU:
w00c8ffffffffffffff00 ÿ
w0088ffffffffffffffff ÿ
These mean that the T5 ECU has started and has worked out it is connected to something (I think)
options 'r'. 's' and 'v' all work without loading MyBooty.S19. They are not useful for Just4Trionic at the moment, but will be useful when Just4Trionic is integrated with Dilemma's Trionic Suites.
'r' reads the adaption data from your ECU and saves it in a file called 'ADAPTION.HEX' on the mbed 'disk'
's' reads the Symbol Table from your ECU, displays it and saves it in a file called 'SYMBOLS.TXT' on the mbed 'disk'.
'v' displays the ECUs software version string and also saves it to a file called 'VERSION.TXT' on the mbed 'disk'
Still to do is a 'w' function which writes back the adaption data. This will allow you to write back the adaption data after a FLASH update. One day it will be there :-)
**
**
Starting the Bootloader
OK, what we really want to do is DUMP or reprogram the FLASH. to do this we need to upload MyBooty.S19. this is simply done by pressing the 'b' key on the keyboard and you should see:
Starting the bootloader, so far so goodcalculated the address, checksum is
OK, and we're done :-)
Uploading and starting the bootloader took 0.423833 seconds.
w0058c100005000000000
Remember I mentioned that you will need to check things have worked OK, In this case everything is OK, the 'C100' part of the message from the T5 ECU shows that the bootloader start message was recognised and the bootloader started - the '00' means OK, anything else means there was a problem (the 5000 part means that MyBooty start address is 0x5000 - which is the correct address for MyBooty - other bootloaders might have different start addresses).
**
**
Calculating the BIN file's Checksum
Press 'c' to calculate the checksum of the BIN file in your ECU it typically takes under a second to calculate the checksum:
w00c8c80000a8a6260808
T5 ECU took took 0.667748 seconds to calculate it's checksum.
'C800' part means that the checksum command was understood and the checksum was calculated OK. This BIN file's checksum is 0x00A8A626 the '0808' at the end are extra bytes to fill out the CAN message to 8 bytes - all CAN messages are 8 bytes long.
This is an example of the checksum calculation failing:
w00c8c801080808080808
T5 ECU took took 0.002473 seconds to calculate it's checksum.
'C801' - 'C8' means that MyBooty recognises the checksum command, but '01' shows that the checksum failed (The rest of the message is filled out with 080808080808 to make the message 8 bytes long). This is what you will see if you calculate the checksum after erasing the FLASH, it's not surprising the checksum failed!
**
**
Finding out what type of FLASH chip you have
To see what type of FLASH chips you have just press the 't' key, a few examples:
w00c8c9000004000001a7
Getting the FLASH chip id took 0.007223 seconds.
'01A7' at the end of the message - '01' AMD, 'A7' 28F010.
w00c8c900000400000120
Getting the FLASH chip id took 0.028259 seconds.
'0120' at the end of the message - '01' AMD, 'A7' 29F010.
w00c8c90000040000FFF7
Getting the FLASH chip id took 0.028259 seconds.
'FFF7' at the end of the message - this means there is a problem with the programming voltage! Check you have a good connection on pin 65.
The 40000 part shows that this is a T5.5 ECU, 0x40000 is the start address for T5,5 ECUs. f you have a T5.2 ECU you (should) see 60000 instead.
**
**
Dumping The BIN file from your T5 ECU
You will want to DUMP the BIN file from your T5 ECU so that you can modify it using T5Suite or T5Suite2. Just press the 'd' key on your keyboard and Just4Trionic will read out the BIN file from your ECU and write it to a file called 'ORIGINAL.HEX' on the mbed 'disk'. DUMPing the BIN file takes just over half a minute during which time 2 of the LEDs on mbed should twinkle. If they don't twinkle something is wrong! After 30 seconds or so you should see this:
getting FLASH BIN file
opened FLASH BIN file
Getting the FLASH BIN took 30.806751 seconds.
**
**
Erasing your FLASH chips
WARNING - DON'T DO THIS IF YOU DON'T HAVE A SPARE ECU! Be prepared for the possiblilty that erasing or reFLASHing your ECU might fail. It seems that AMD 28F010 chips sometimes fail and it is IMPOSSIBLE to get them working again. If this happens to you then you will have to find another ECU or replace your FLASH chips. Experience varies and the problem is though to be due to these chips being quite old now. As far as I know there isn't a problem with the software algorithms used for programming etc as it is independant of the method used for programming, i.e. it happens with the BDM method too.
CAUTION - don't turn off your T5 ECU after erasing the FLASH chips otherwise you will have to use the BDM method to reFLASH!
Press the 'e' key to erase the flash. The time taken to erase FLASH varies. This is probably because some chips need more erase and programming pulses than others. Erasing the FLASH takes several seconds, unfortunately I haven't any way of showing what's happening during the erase process at the moment because it all happens internally to the T5 ECU. As a guide though it should take less than 30 seconds, if nothing happens within this time then something has gone wrong!:
w00c8c000080808080808
Erasing the FLASH took 3.916372 seconds.
About 4 seconds for AMD 29F010 FLASH chips. 'C000' - 'C0' erase command recognised '00' FLASH was erased OK
w00c8c000080808080808
Erasing the FLASH took 12.641552 seconds.
Over 12 seconds for older 28F010 FLASH chips.
Check this message carefully because you don't get any warning that erasing might have failed, some examples
w00c8c0010004cafe0808
Erasing the FLASH took 12.641552 seconds.
'C001' failed to erase! the address that couln't be erased was 0x4CAFE
w00c8c0020004babe0808
Erasing the FLASH took 12.641552 seconds.
'C002' failed to write '0x00' to all addresses before erasing! the address that couln't be written to 0x00 was 0x4BABE
There are also other numbers, but essentially anything other than 'C000' is a failure - you might have bad FLASH chips :-( The only thing to try is erasing again a few times - with your fingers crossed - I wish you good Karma if you find yourselve in this situation.
**
**
FLASHing a new .S19 file
Copy your new BIN file in .S19 format to the mbed 'disk'. The filename must be 'MODIFIED.S19' (You can use T5Suite's export to .S19 to get the BIN file in the correct format)
press the 'f' key to FLASH the new BIN file. FLASHing takes nearly a minute and involves sending lots of CAN messages to and from the T5 ECU. You should see 2 of the mbed LEDs twinkling during the FLASHing process. If the LEDs don't twinkle then something went wrong. You should see this after a while
Opened MODIFIED.S19 and we're done :-)
Uploading the FLASH update file took 49.933315 seconds.
Unfortunately the FLASHing bit doesn't check anything yet. The quickest way of checking that the FLASHing went OK is to use the checksum command described earlier. If the checksum fails after FLASHing you might have run into the 'bad' FLASH chips problem. You can of course try to repeat the FLASH process a few times - good luck!
EC9EBC10-A766-E563-A146-17E54371C003
1.03.01
7 comments on Just4Trionic:
Please log in to post comments.
Hello Sophie.
Can you tell me what should i use according to try read/flash T7 ECU?
What will work and what i must stay out?
I'm about to try it, but dont have spair ECU, so... needs to be sure "what i am doing"