NefMoto

Technical => Communication Protocols => Topic started by: H2Deetoo on December 12, 2015, 02:37:21 AM



Title: Tricore bootmode canbus protocol
Post by: H2Deetoo on December 12, 2015, 02:37:21 AM
Hi guys,


Did any of you ever work on the Tricore bootmode canbus protocol?
Is there any public info available?

I made a first log attempt (500kb/s 11bit CANID) which shows some data but can't make much sense of it yet.
For example the CANID always is 555h so doesn't look correct ..
555 [8] 31 00 04 00 00 00 00 D0
555 [4] 41 80 82 04
555 [8] 31 00 04 00 04 00 00 D0
555 [4] 46 A0 B3 E4
555 [8] 31 00 04 00 08 00 00 D0
555 [4] 82 06 00 10
555 [8] 31 00 04 00 0C 00 00 D0
555 [4] 24 1C 00 00
555 [8] 33 00 40 01 00 00 00 D4
555 [8] 40 BC 5D 00 0F 00 11 00
555 [8] 00 00 00 00 00 00 00 00
555 [8] 00 00 00 00 10 20 00 F8
555 [8] 08 20 00 F8 54 55 00 A0
555 [8] 49 BE 3A FA DF 10 3D 80
...

I am curious for example how the PASSWORD transaction is done.


Regards,
H2Deetoo


Title: Re: Tricore bootmode canbus protocol
Post by: ozzy_rp on December 13, 2015, 07:27:52 AM
Official information from Infineon


Title: Re: Tricore bootmode canbus protocol
Post by: H2Deetoo on December 13, 2015, 09:51:04 AM
Thanks, I found and read this document already but it doesn't match up to the log I made :-/


Rgs Bonny


Title: Re: Tricore bootmode canbus protocol
Post by: ozzy_rp on December 13, 2015, 01:15:21 PM
With which TriCore processor you work?


Title: Re: Tricore bootmode canbus protocol
Post by: H2Deetoo on December 14, 2015, 02:01:32 AM
EDC17CP14 TC1796


Title: Re: Tricore bootmode canbus protocol
Post by: dream3R on December 14, 2015, 07:48:47 AM
does the canid matter?


Title: Re: Tricore bootmode canbus protocol
Post by: H2Deetoo on December 14, 2015, 07:51:28 AM
According to documentation the CANID should not matter.


Title: Re: Tricore bootmode canbus protocol
Post by: dream3R on December 14, 2015, 07:52:33 AM
http://www.infineonforums.com/archive/index.php/t-1928.html?s=a8c3f47f1403e20f6cff065c9ad77be9


Title: Re: Tricore bootmode canbus protocol
Post by: dream3R on December 14, 2015, 07:56:47 AM
Some sort of init/handshake protocol?


Title: Re: Tricore bootmode canbus protocol
Post by: dream3R on December 14, 2015, 07:58:36 AM
http://www.infineon.com/dgdl/ap1609211_CAN_Bootloader_.pdf?fileId=db3a304412b407950112b409da25039f

tada


Title: Re: Tricore bootmode canbus protocol
Post by: H2Deetoo on December 14, 2015, 10:58:20 AM
Thanks for the file!
The CANID 0x555 is mentioned in this document, but it still isn't a match to the log I made.
Perhaps there's something wrong/missing in my log, or we miss some vital piece of info ...


Rgs H2Deetoo


Title: Re: Tricore bootmode canbus protocol
Post by: dream3R on December 14, 2015, 11:22:46 AM
Welcome.   Perhaps not exact doc.



Title: Re: Tricore bootmode canbus protocol
Post by: H2Deetoo on December 17, 2015, 04:28:50 AM
I think my logger is messing up.
I read in the datasheet something about DOMINANT bit being set by mcu, so this might be the reason why some frames aren't showing up in my log.

Anyway I will try different hardware to log now ...


Regards,
H2Deetoo




Title: Re: Tricore bootmode canbus protocol
Post by: dream3R on December 17, 2015, 11:48:50 AM
I think my logger is messing up.
I read in the datasheet something about DOMINANT bit being set by mcu, so this might be the reason why some frames aren't showing up in my log.

Anyway I will try different hardware to log now ...


Regards,
H2Deetoo




More reading mate, can is well, can and made by Bosch lol.

http://www.totalphase.com/support/articles/200472276-CAN-Background


Title: Re: Tricore bootmode canbus protocol
Post by: pollux on December 23, 2015, 07:51:53 AM
You seem to miss the bootloader upload itself and only logged the exchange between the software and the bootloader (apparently reading the MCU ID before preparing for other stuff). The fact that it uses the same CAN ID for requests and response is a simple way to obfuscate a bit the exchanges but it does not matter.

For the password transaction itself, it is well detailed in the Infineon documentation and should not be hard to spot in a bootmode trace.


Title: Re: Tricore bootmode canbus protocol
Post by: H2Deetoo on December 24, 2015, 05:14:42 AM
Could be so .. but the problem is then why my logger isn't showing the initial bootloader upload.
Perhaps it uses a different baudrate, and only later they switch to 500 kbps.

I guess I need to hook up a scope and do some measuring ...

>The fact that it uses the same CAN ID for requests and response is a simple way to obfuscate a bit the exchanges but it does not matter.
Yes it doesn't matter.

>For the password transaction itself, it is well detailed in the Infineon documentation
Do you have documentation describing this then?


Mery Christmas en best wishes to all here!

Rgs Bonny


Title: Re: Tricore bootmode canbus protocol
Post by: pollux on December 26, 2015, 12:46:35 PM
Could be so .. but the problem is then why my logger isn't showing the initial bootloader upload.
Perhaps it uses a different baudrate, and only later they switch to 500 kbps.

I guess I need to hook up a scope and do some measuring ...

Some well known tools out there use some CAN tricks to detect sniffing and won't start the bootloader upload in that case.

Quote from: H2Deetoo
>For the password transaction itself, it is well detailed in the Infineon documentation
Do you have documentation describing this then?

You can find it on the Infineon website:
http://www.infineon.com/dgdl/TC1797_UM_v1.1.pdf?fileId=db3a30431ed1d7b2011efeae5efc6b76 (http://www.infineon.com/dgdl/TC1797_UM_v1.1.pdf?fileId=db3a30431ed1d7b2011efeae5efc6b76)

Look for "Command Sequence Definitions" in the PMU chapter of the Tricore user manual.

Merry Christmas


Title: Re: Tricore bootmode canbus protocol
Post by: dream3R on December 27, 2015, 12:29:25 PM
Some well known tools out there use some CAN tricks to detect sniffing and won't start the bootloader upload in that case.

You can find it on the Infineon website:
http://www.infineon.com/dgdl/TC1797_UM_v1.1.pdf?fileId=db3a30431ed1d7b2011efeae5efc6b76 (http://www.infineon.com/dgdl/TC1797_UM_v1.1.pdf?fileId=db3a30431ed1d7b2011efeae5efc6b76)

Look for "Command Sequence Definitions" in the PMU chapter of the Tricore user manual.

Merry Christmas

Good to know re sniffing guess test turning ack off would fix?


Title: Re: Tricore bootmode canbus protocol
Post by: pollux on December 27, 2015, 12:39:23 PM
Good to know re sniffing guess test turning ack off would fix?

It should. But not all CAN devices/controllers allow you to do that easily.


Title: Re: Tricore bootmode canbus protocol
Post by: dream3R on December 27, 2015, 12:54:01 PM
A simple chipkit for example can, silent mode or something iirc.

Does  this proc run on Simos 8.4?



Title: Re: Tricore bootmode canbus protocol
Post by: H2Deetoo on December 28, 2015, 12:55:31 AM
>Look for "Command Sequence Definitions" in the PMU chapter of the Tricore user manual.

Pollux, you're wrong here.
The password they are talking about in the datasheet is for flash sector protection. This has got nothing to do with the password used to authenticate with the loader.


Rgs H2Deetoo


Title: Re: Tricore bootmode canbus protocol
Post by: pollux on December 28, 2015, 01:44:25 AM
>Look for "Command Sequence Definitions" in the PMU chapter of the Tricore user manual.

Pollux, you're wrong here.
The password they are talking about in the datasheet is for flash sector protection. This has got nothing to do with the password used to authenticate with the loader.

So far I haven't seen any authentication with a loader. If you need authentication, this is specific to the loader you're using. The Tricore MCU itself does not enforce such thing. Anyway, you don't need any authentication if you're using your own loader.


Title: Re: Tricore bootmode canbus protocol
Post by: H2Deetoo on December 28, 2015, 02:00:23 AM
Yes of course I agree completely.
But my bet is that most tools use the same loader ;-)

Same practice with clusters; there is one smart guy (perhaps even employee of VDO) who writes a loader, even with some form of authentication, and each and every tool out there uses this loader.


Rgs H2Deetoo


Title: Re: Tricore bootmode canbus protocol
Post by: pollux on December 28, 2015, 02:12:19 AM
Implementing some strong authentication in a loader is a tricky thing. Since you can potentially sniff the upload, dump the binary in IDA and figure out how the authentication works.


Title: Re: Tricore bootmode canbus protocol
Post by: H2Deetoo on December 28, 2015, 02:21:20 AM
If the upload of the loader is plain then you're right of course.
But once you encrypt the loader (for example with RSA) then you'll have a hard time decrypting it before you can start analyzing.

Fortunately the tools, which support the authentication algo, are often easier to crack to extract the needed algos.

But in case of Tricore the loader is indeed plain ...


Rgs H2Deetoo


Title: Re: Tricore bootmode canbus protocol
Post by: dream3R on December 28, 2015, 03:44:58 AM
If the upload of the loader is plain then you're right of course.
But once you encrypt the loader (for example with RSA) then you'll have a hard time decrypting it before you can start analyzing.

Fortunately the tools, which support the authentication algo, are often easier to crack to extract the needed algos.

But in case of Tricore the loader is indeed plain ...


Rgs H2Deetoo

are you making your own loader?  I'm reading the datasheet stage so a bit behind. lol  Weird how Simos is lo-hi


Title: Re: Tricore bootmode canbus protocol
Post by: H2Deetoo on December 28, 2015, 04:40:29 AM
No no I have no intentions of writing a loader.
I just was curious to which loader was used by Galletto and Byteshooter for example, and how they do the password transaction.

Anyways, a log is made (indeed in silent mode) and enough is clear now about this subject.


Regards,
H2Deetoo


Title: Re: Tricore bootmode canbus protocol
Post by: dream3R on December 28, 2015, 06:49:57 AM
No no I have no intentions of writing a loader.
I just was curious to which loader was used by Galletto and Byteshooter for example, and how they do the password transaction.

Anyways, a log is made (indeed in silent mode) and enough is clear now about this subject.


Regards,
H2Deetoo

Can you share the raw logs pleeeeease?  Which ECU?


Title: Re: Tricore bootmode canbus protocol
Post by: dream3R on December 28, 2015, 07:00:51 AM
I have the vag loader info for simos 8.4 which I *think* uses that cpu or the tc1766xx (TBC).





Title: Re: Tricore bootmode canbus protocol
Post by: dream3R on January 08, 2016, 11:56:03 PM
No no I have no intentions of writing a loader.
I just was curious to which loader was used by Galletto and Byteshooter for example, and how they do the password transaction.

Anyways, a log is made (indeed in silent mode) and enough is clear now about this subject.


Regards,
H2Deetoo

??


Title: Re: Tricore bootmode canbus protocol
Post by: wertex on November 03, 2016, 02:37:16 PM
No no I have no intentions of writing a loader.
I just was curious to which loader was used by Galletto and Byteshooter for example, and how they do the password transaction.

Anyways, a log is made (indeed in silent mode) and enough is clear now about this subject.


Regards,
H2Deetoo

Galletto and Byteshooter  may change baudrate due to communication to ECU. In this case you can't make log easy. To unlock Tricore they send 16 bytes password to ECU.


Title: Re: Tricore bootmode canbus protocol
Post by: Teitek on March 13, 2017, 04:31:09 PM
Begin at 250kbps for sent the loader and after open a connection at 500kbps.