Pages: [1]
Author Topic: Tricore BSL CAN Loader  (Read 5489 times)
kuebk
Jr. Member
**

Karma: +3/-0
Offline Offline

Posts: 44



« on: January 21, 2019, 10:21:01 AM »

Hi,

I'm looking into how BSL CAN Loader works and so far so good but I'm having difficulties with unlocking figuring out PFLASH unlock via UCB0.
TC1796 user manual says that the PFLASH is unlocked in BROM but I can't find it there, found it in SB but according to user manual PFLASH has to be unlocked before reading/executing anything from it. So seems like I overlooked something, can someone give me hints or point in better direction?

Thanks.
Logged
H2Deetoo
Sr. Member
****

Karma: +26/-1
Offline Offline

Posts: 256


« Reply #1 on: April 11, 2020, 10:00:11 AM »

For < TPROT7 flashes the passwords can be calculated from the MCUID.
For TPROT8+ they changed it and there are other ways to get the password, like CCP protocol, or even more advanced tricks.


Rgs H2Deetoo
Logged
crystal_imprezav
Newbie
*

Karma: +5/-0
Offline Offline

Posts: 12


« Reply #2 on: April 27, 2020, 03:19:59 PM »

MCU ID @ 17F00 16 bytes
Raw Pass @ 17F90 16 bytes

Reverse the algo. to figure out pass.

To unlock algo consists of:
PMU base address
User level
Protection level
Password1
Password2
Logged
doot47
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 5


« Reply #3 on: December 18, 2023, 12:37:41 AM »

For < TPROT7 flashes the passwords can be calculated from the MCUID.
For TPROT8+ they changed it and there are other ways to get the password, like CCP protocol, or even more advanced tricks.


Rgs H2Deetoo
how to calculate ?
Logged
d3irb
Full Member
***

Karma: +131/-1
Offline Offline

Posts: 186


« Reply #4 on: December 18, 2023, 09:19:37 AM »

how to calculate ?

Flash starts up in User Configuration mode, and the Boot ROM decides whether to lock the controller using the passwords from the UCBs or leave it unlocked, based on the HWCFG pin configuration. I strongly suspect this mechanism is vulnerable to hardware glitching attacks (in old TC before AudoMAX, it was vulnerable to a trivial static voltage glitch where if you didn't give the Flash controller enough voltage it just wouldn't lock). But, I haven't bothered to try one yet against newer Tricore or Aurix.

You don't calculate the Flash passwords on newer Bosch or any Continental ECUs; you need to read the passwords out from Flash itself like crystal_imprezav points out. The passwords are now generated randomly during ECU manufacturing and burned into the OTP area of Flash. In Bosch, they are protected with a silly MCU ID based scrambling algorithm. In Continental they are just in plain text.

Regardless, you need to be able to read Flash to extract them. This is done by finding an exploit in the software running on the ECU, since Flash is already unlocked at boot by the Boot ROM if the ECU is not in BSL mode.

These exploits are ECU software specific (not processor related) and have a wide range. Anything from simple read access left active in the Application Software (CCP, DynamicallyDefineLocalIdentifier, development sessions with ReadMemoryByAddress, etc.) to more complex compromises in the supplier service tool (TSW) or the manufacturer reflashing routines in the customer bootloader, like in https://github.com/bri3d/Simos18_SBOOT . Once you have the passwords they are trivial to send to the Flash controller per the Infineon documentation: https://github.com/bri3d/TC1791_CAN_BSL/blob/main/Bootloader_2/src/FLASH.c#L10 .
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Page created in 0.027 seconds with 17 queries. (Pretty URLs adds 0.001s, 0q)