I was given the compiled program from an automotive ECU by my colleagues in HEX-format, as well as the corresponding A2L-file. For my project I need to read the applied parameters from that HEX-file. I want to do this automatically, via a MATLAB function, as the parameters are used as inputs in a Simulink model.
Now as an example the HEX-file looks like this:
[…] :2001C00000000000000000000000000000000000000000000000000000000000000000001F :2001E0000000000000000000000000000000000000000000000000000000000000000000FF :2002000054710780809A0780809A0780809A07808C530680000011A0140011A000000000D4 :200220000000000000000000000000000000000000000000000000000000000000000000BE :2002400000000000000000000000000000000000000000000000000000000000000000009E :2002600000000000000000000000000000000000000000000000000000000000000000007E […]
(please note that it is just an exemplary excerpt)
The address for a certain parameter can be read from the A2L for example as
From the specification on the XCP-protocol I know that the address in the A2L is 40-bit long (32-bit address and 8-bit extension).
As you can see the address I read is 64-bit.
Now if I got it right in my exemplary address
‘A01’ is reserved,
‘4’ is the address extension and
‘3B0B’ is the actual 32-bit address.
Can anyone confirm this or correct me if I am mistaken?
Reading the data from the HEX-file in position
‘3B0B’ is incorrect. My colleagues exported the data for me in a text file to verify my results, and they clearly differ.
Are the ‘:’ counted when the position is addressed?
Edit: I just found out that
'A01' defines the RAM-Segment the data is written in. But how can I find this Segment within the HEX-File?