Pages: [1]
Author Topic: how to find value of SY_FREQCPU from binary  (Read 5868 times)
maZer.GTi
Full Member
***

Karma: +68/-6
Offline Offline

Posts: 246


« on: April 14, 2015, 06:36:36 AM »

Does someone have an idea to find out the value of this constant by binary? without having the .ecu file or definition present? Smiley
thanks
Logged
IamwhoIam
Hero Member
*****

Karma: +52/-115
Offline Offline

Posts: 1070


« Reply #1 on: April 14, 2015, 07:29:09 AM »

I don't think you can... just out of interest, what binary do you need this on?
Logged

I have no logs because I have a boost gauge (makes things easier)
daniel2345
Full Member
***

Karma: +11/-7
Offline Offline

Posts: 197


« Reply #2 on: April 14, 2015, 08:33:01 AM »

You cannot from bin.

SY_* (system constants) are only used during code compilation at system supplier (=Bosch).

They are switches to use different code parts and leave other away. After code compilation they are written to a2l but can not be found in bin...


Logged
maZer.GTi
Full Member
***

Karma: +68/-6
Offline Offline

Posts: 246


« Reply #3 on: April 14, 2015, 09:55:23 AM »

It should work on near all ME7 binarys, but there must be a way to reverse calculate the frequency.
its enaugh if we can read a value and calculate back to frequency.
Its needed for the new version of launch script.
Logged
daniel2345
Full Member
***

Karma: +11/-7
Offline Offline

Posts: 197


« Reply #4 on: April 14, 2015, 12:39:33 PM »

You can try to reverse the base os timing Interrupt settings or the clock settings for the can/serial divider registers.

With that you can recalculate the clock frequency / external osc.

Take formula from Datasheet for those registers and evaluate the formula to the term you need. Mostly fOsc or fCpu. Insert register values loaded in binary and you should have it.

Again: no way to get the SY_* directly.

Good luck
Logged
maZer.GTi
Full Member
***

Karma: +68/-6
Offline Offline

Posts: 246


« Reply #5 on: April 14, 2015, 07:38:43 PM »

You can try to reverse the base os timing Interrupt settings or the clock settings for the can/serial divider registers.

With that you can recalculate the clock frequency / external osc.

Take formula from Datasheet for those registers and evaluate the formula to the term you need. Mostly fOsc or fCpu. Insert register values loaded in binary and you should have it.

Again: no way to get the SY_* directly.

Good luck

Im not sure this way is safe, but i found the "SSC Baudrate Register".
I hope with this register i can get the safe cpu clock.

-- Cutted ASM Code
mov     r12, #4637h
mov     r13, #13h
mov     r14, #2
mov     word_F0B4, r13


-- Notes from me ( values are in hex )
13 = 40MHz
0F = 32MHz
0B = 24MHz
09 = 20MHz


If someone can correct me or have better idea, please tell me.


Edit:
Seems values are very near,
32000KHz / 0Fh = 855h
855h x 13 = 40527 KHz
855h x 0F = 31995 KHz
855h x 0B = 23463 KHz
855h x 09 = 19197 KHz
« Last Edit: April 14, 2015, 08:14:05 PM by maZer.GTi » Logged
dragon187
Full Member
***

Karma: +13/-15
Offline Offline

Posts: 106


« Reply #6 on: October 26, 2021, 04:25:29 AM »

Im not sure this way is safe, but i found the "SSC Baudrate Register".
I hope with this register i can get the safe cpu clock.

-- Cutted ASM Code
mov     r12, #4637h
mov     r13, #13h
mov     r14, #2
mov     word_F0B4, r13


-- Notes from me ( values are in hex )
13 = 40MHz
0F = 32MHz
0B = 24MHz
09 = 20MHz


If someone can correct me or have better idea, please tell me.


Edit:
Seems values are very near,
32000KHz / 0Fh = 855h
855h x 13 = 40527 KHz
855h x 0F = 31995 KHz
855h x 0B = 23463 KHz
855h x 09 = 19197 KHz

Can someone please confirm that this is working ?

Thank you
Logged
dragon187
Full Member
***

Karma: +13/-15
Offline Offline

Posts: 106


« Reply #7 on: October 27, 2021, 11:55:44 AM »

Tried it, seems to be ok.

Regards
Logged
Pages: [1]
  Print  
 
Jump to:  

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