RomRaider Logo

RomRaider

Open Source ECU Tools
 FAQ •  Register •  Login 

RomRaider

Documentation

Community

Developers

It is currently Sat Feb 21, 2026 10:23 pm

All times are UTC




Post new topic Reply to topic  [ 73 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject: Re: FastECU development
PostPosted: Tue Jul 02, 2024 6:08 pm 
Offline
Experienced

Joined: Tue Jun 06, 2017 6:11 pm
Posts: 215
alesv wrote:
Quote:
Broke new developed CAN modules


Got it. I'll try to track down all files added by MiikaS, adopt them to support old method and revert changes in SerialPortActions::read_j2534_data. I think I understand what's going on. Thank you for very detailed info!
If I remembered correct, most of my last updates are related to kernel updates, combining can kernel codes, modified kernel makefiles (kerbels are in different repo), added eeprom functionality to them and made changes to modules to use them. All for SH kernels/modules. There's still some work to make atleast eeprom functionality to work right on some models.

As it has been a while wheen last time done anything, I should take a look at the code to be sure. But if anything buzzling comes to mind, just shoot me a message. I'm sure you find losts of 'wtf' moments when reading my code


Top
 Profile  
 
 Post subject: Re: FastECU development
PostPosted: Tue Jul 02, 2024 9:17 pm 
Offline
Experienced

Joined: Fri Aug 21, 2020 10:05 am
Posts: 321
Quote:
Rimwall, could you please create a new branch in your fork and call it somehow, for example 'development-sync'? I'll create PR to that branch and after you approve it, we could check if everything works as expected.

Also please create one more branch and call it like 'development-froze-before-sync'. We will leave it untouched to have point of return.

Good plan. Done. Thanks!

I will pause creating new modules until we have a sync'd code base.


Top
 Profile  
 
 Post subject: Re: FastECU development
PostPosted: Wed Jul 03, 2024 8:43 am 
Offline
RomRaider Donator

Joined: Fri Aug 26, 2016 8:21 am
Posts: 154
I'm stuck a little bit. That's because I know hardware bad. As far as I understand, syncing breaks new TCU modules that work over ISO15765, right?

Heres serial_port_actions.cpp diff

Code:
-            for (unsigned long i = 0; i < rxmsg.DataSize; i++)
-                received.append((uint8_t)rxmsg.Data[i]);
+            if (is_iso15765_connection)
+            {
+                for (unsigned long i = 4; i < rxmsg.DataSize; i++)
+                    received.append((uint8_t)rxmsg.Data[i]);
+            }
+            else
+            {
+                for (unsigned long i = 0; i < rxmsg.DataSize; i++)
+                    received.append((uint8_t)rxmsg.Data[i]);
+            }


It appears that when using ISO15765 first 4 bytes are removed from all received data. Of course this will break everything. But if I return how it was, it will break ECU modules that work over ISO15765 that MiikaS changed. There's too many changes done and I hardly understand what and why was done.

Could you please tell me what modules works over ISO15765? As far as I understand it's eeprom_ecu_subaru_denso_can, flash_ecu_subaru_denso_sh7058_can and flash_ecu_subaru_denso_sh7058_can_diesel only.

_________________
2Boost Subaru mod


Top
 Profile  
 
 Post subject: Re: FastECU development
PostPosted: Wed Jul 03, 2024 8:43 am 
Offline
RomRaider Donator

Joined: Fri Aug 26, 2016 8:21 am
Posts: 154
I'm stuck a little bit. That's because I know hardware bad. As far as I understand, syncing breaks new TCU modules that work over ISO15765, right?

Heres serial_port_actions.cpp diff

Code:
-            for (unsigned long i = 0; i < rxmsg.DataSize; i++)
-                received.append((uint8_t)rxmsg.Data[i]);
+            if (is_iso15765_connection)
+            {
+                for (unsigned long i = 4; i < rxmsg.DataSize; i++)
+                    received.append((uint8_t)rxmsg.Data[i]);
+            }
+            else
+            {
+                for (unsigned long i = 0; i < rxmsg.DataSize; i++)
+                    received.append((uint8_t)rxmsg.Data[i]);
+            }


It appears that when using ISO15765 first 4 bytes are removed from all received data. Of course this will break everything. But if I return how it was, it will break ECU modules that work over ISO15765 that MiikaS changed. There's too many changes done and I hardly understand what and why was done.

Could you please tell me what modules works over ISO15765? As far as I understand it's eeprom_ecu_subaru_denso_can, flash_ecu_subaru_denso_sh7058_can and flash_ecu_subaru_denso_sh7058_can_diesel only.

_________________
2Boost Subaru mod


Top
 Profile  
 
 Post subject: Re: FastECU development
PostPosted: Wed Jul 03, 2024 9:10 am 
Offline
Experienced
User avatar

Joined: Sun Aug 18, 2019 12:10 pm
Posts: 278
Location: Russia, Ulan-Ude (Near Lake Baikal)
I think it's all CAN modules.
eeprom_ecu_subaru_denso_can.cpp
flash_ecu_subaru_denso_sh7xxx_can_.cpp
flash_ecu_subaru_denso_sh705x_can.cpp
flash_ecu_subaru_denso_sh7058_can.cpp
flash_ecu_subaru_denso_sh7058_can_diesel.cpp

Need to replace all things like this:
Code:
if ((uint8_t)received.at(0) == 0x50 || (uint8_t)received.at(1) == 0x43)

To:
Code:
if ((uint8_t)received.at(4) == 0x50 || (uint8_t)received.at(5) == 0x43)


And so on with all questions about received data.

_________________
Subaru Outback BR9 EDM 2010 EJ253 CVT... Subaru Impreza GG2 JDM 2001 EJ152 AT...
Some Hitachi ROM's modifications...


Top
 Profile  
 
 Post subject: Re: FastECU development
PostPosted: Wed Jul 03, 2024 9:12 am 
Offline
Experienced
User avatar

Joined: Sun Aug 18, 2019 12:10 pm
Posts: 278
Location: Russia, Ulan-Ude (Near Lake Baikal)
alesv wrote:
I'm stuck a little bit. That's because I know hardware bad. As far as I understand, syncing breaks new TCU modules that work over ISO15765, right?

Not only TCU, but all TCU/ECU Hitachi/Melco CAN modules.

_________________
Subaru Outback BR9 EDM 2010 EJ253 CVT... Subaru Impreza GG2 JDM 2001 EJ152 AT...
Some Hitachi ROM's modifications...


Top
 Profile  
 
 Post subject: Re: FastECU development
PostPosted: Wed Jul 03, 2024 9:35 am 
Offline
RomRaider Donator

Joined: Fri Aug 26, 2016 8:21 am
Posts: 154
Quote:
I think it's all CAN modules.


Not sure if all. I'll track them down by variable

Code:
is_iso15765_connection = true


Quote:
Need to replace all things like this:


Yeah, you're right! I need to go through every changed file, it will take a time.

Quote:
Not only TCU, but all TCU/ECU Hitachi/Melco CAN modules.


Fix them would be easy - I'll revert serial_port_actions.cpp changes. Thanks a lot!

_________________
2Boost Subaru mod


Top
 Profile  
 
 Post subject: Re: FastECU development
PostPosted: Wed Jul 03, 2024 9:38 am 
Offline
Experienced

Joined: Tue Jun 06, 2017 6:11 pm
Posts: 215
I think all others except Denso bootloader CAN modules use iso15765...


Top
 Profile  
 
 Post subject: Re: FastECU development
PostPosted: Wed Jul 03, 2024 9:53 am 
Offline
Experienced
User avatar

Joined: Sun Aug 18, 2019 12:10 pm
Posts: 278
Location: Russia, Ulan-Ude (Near Lake Baikal)
Sometimes it's at several places:
Attachment:
ISO15765_False.jpg

Attachment:
ISO15765_True.jpg


You do not have the required permissions to view the files attached to this post.

_________________
Subaru Outback BR9 EDM 2010 EJ253 CVT... Subaru Impreza GG2 JDM 2001 EJ152 AT...
Some Hitachi ROM's modifications...


Top
 Profile  
 
 Post subject: Re: FastECU development
PostPosted: Wed Jul 03, 2024 10:25 am 
Offline
Experienced

Joined: Tue Jun 06, 2017 6:11 pm
Posts: 215
Well that's because it is loading Denso CAN kernel to CAN only ECU as you see from code, it first test if CAN kernel is uploaded, if not, switch to iso15765 and uploading CAN kernel and then switch back to CAN mode to continue data download

That is from the time when I couldn't get iso15765 kernel to work, and actually not sure if it works even yet in iso15765 mode as you can see, in diesel and 7058_can it is testing in CAN mode if kernel is running, and switching to iso15765 to upload CAN kernel, and then switch back to CAN mode


Top
 Profile  
 
 Post subject: Re: FastECU development
PostPosted: Wed Jul 03, 2024 10:37 am 
Offline
Experienced
User avatar

Joined: Sun Aug 18, 2019 12:10 pm
Posts: 278
Location: Russia, Ulan-Ude (Near Lake Baikal)
Yes, i can see it :)
I suppose that first 4 bytes must be with source/destination address. And all received data should include it. It's more easy to analyze log's and sniffed data for compare :)
If we use code like this:
Code:
if ((uint8_t)received.at(0) == 0x7F && (uint8_t)received.at(2) == 0x34)

It supposed that we don't use first 4 bytes of data. Not comfortable for me. It's only my opinion of course.

_________________
Subaru Outback BR9 EDM 2010 EJ253 CVT... Subaru Impreza GG2 JDM 2001 EJ152 AT...
Some Hitachi ROM's modifications...


Top
 Profile  
 
 Post subject: Re: FastECU development
PostPosted: Wed Jul 03, 2024 10:50 am 
Offline
RomRaider Donator

Joined: Fri Aug 26, 2016 8:21 am
Posts: 154
Quote:
I think all others except Denso bootloader CAN modules use iso15765...


It looks like SH7058/59 only. I'll check twice.

Quote:
Sometimes it's at several places


Even worse, it could change in runtime several times :(

_________________
2Boost Subaru mod


Top
 Profile  
 
 Post subject: Re: FastECU development
PostPosted: Wed Jul 03, 2024 11:16 am 
Offline
Experienced

Joined: Tue Jun 06, 2017 6:11 pm
Posts: 215
SergArb wrote:
Yes, i can see it :)
I suppose that first 4 bytes must be with source/destination address. And all received data should include it. It's more easy to analyze log's and sniffed data for compare :)
If we use code like this:
Code:
if ((uint8_t)received.at(0) == 0x7F && (uint8_t)received.at(2) == 0x34)

It supposed that we don't use first 4 bytes of data. Not comfortable for me. It's only my opinion of course.

Yes, you are right. I think it should contain also src/dest addresses and should be modified. Don't remeber why it was in the first place done like that...


Top
 Profile  
 
 Post subject: Re: FastECU development
PostPosted: Wed Jul 03, 2024 11:24 am 
Offline
Experienced

Joined: Tue Jun 06, 2017 6:11 pm
Posts: 215
alesv wrote:
Quote:
I think all others except Denso bootloader CAN modules use iso15765...


It looks like SH7058/59 only. I'll check twice.

Quote:
Sometimes it's at several places


Even worse, it could change in runtime several times :(

For Denso ECUs, SH7055 use Extended CAN mode with Denso CAN bootloader (default is K-Line), SH7058/9 default is iso15765 BUT it also has Denso CAN bootloader that uses Extended CAN. So when dealing with SH7058/9 ECUs, kernel is uploaded in iso15765 mode so not to mess say TCU when flashing (as they have Denso CAN bootloader also) but switched back to CAN as the kernel is CAN kernel. At the time when I was testing Diesel ECUs and EEPROM reads, I didn't have enough time to make kernel work as iso15765 mode so it left like that.


Top
 Profile  
 
 Post subject: Re: FastECU development
PostPosted: Wed Jul 03, 2024 11:49 am 
Offline
RomRaider Donator

Joined: Fri Aug 26, 2016 8:21 am
Posts: 154
OK, I got one more question. In eeprom_ecu_subaru_denso_can.cpp file in function upload_kernel_subaru_denso_subarucan serial port is reopened at the end with is_iso15765_connection=false. Next function is read_mem_subaru_denso_subarucan. Should I treat connection as non iso15765?

_________________
2Boost Subaru mod


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 73 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subsilver by phpBBservice.nl