Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a2l merge, a2l update: string "0xffff000000" could not be interpreted as a number #41

Open
forstefa opened this issue Dec 11, 2024 · 5 comments

Comments

@forstefa
Copy link

forstefa commented Dec 11, 2024

Hi, when i use a2ltool to update or merge a2l files, i get some Parser errors like "Parser error: <path_to_a2_file>:<line_number>: string "0xffff00000000" could not be interpreted as a number.

Note: If i shorten the BIT_MASK from 0xffff00000000 to 0xffff0000 the parser error does not occur

So, how to solve this problem without shorten the BIT_MASK?

a2l sections look like this:

/begin CHARACTERISTIC

    Name_of_Characterisitc
    "Some: Text"
    Value
    0x80B0F8B4
    some_record_layout_uint64
    65535.0
    some_compu_method
    -32768.
    32767

    FORMAT "%5.2"
    BIT_MASK 0xffff00000000       /*<line_number>*/

/end CHARACTERISTIC

...

/begin RECORD_LAYOUT some_record_layout
    FCN_VALUES 1 A_UINT64 COLUMN_DIR DIRECT
    STATIC ADRESS_OFFSETS
/end RECORD_LAYOUT 

...

/begin COMPU_METHOD
    some_compu_method
    "some text"
    RAT_FUNC
    "%10.5"
    "-"

    COEFFS 0.0 -1.0 -32768.0 0.0 0.0 -1.0
    REF_UNIT some_unit

/end COMPU_METHOD

...

/begin UNIT

    some_unit
    ""
    "-"
    EXTENDED_SI
    SI_EXPONENTS 0 0 0 0 0 0 0

/end UNIT
@DanielT
Copy link
Owner

DanielT commented Dec 11, 2024

You found a bug - in version 1.7 of the A2L standard the width of the BIT_MASK and ERROR_MASK was extended from 32 bit to 64 bit.
A2ltool (and the underlying a2lfile library) originally targeted A2L standard 1.6, and these elements were not updated when support for A2L standard 1.7 was added.

Unfortunately there is no workaround, other than changing your program.

@forstefa
Copy link
Author

Are there any plans to update a2ltool (and the underlying a2lfile library) to A2L standard 1.7?

@DanielT
Copy link
Owner

DanielT commented Dec 11, 2024

yes, of course. Apart from this bug, A2L 1.7.1 has been fully supported for several years now
It looks like a bit field inside of a 64 bit value is a very unusual construction, otherwise the problem would have been discovered long ago.
Fixing this is not really complicated, and I will do that sometime in the next few days, but I don't expect that I will build a new release of a2ltool immediately.

@forstefa
Copy link
Author

sounds great, thanks

@DanielT
Copy link
Owner

DanielT commented Dec 12, 2024

I just pushed the fix for this in the a2lfile library. [Commit]

I'll leave this issue open until I also update a2ltool to use the fixed version, but if you wanted to, you could build a fixed version of a2ltool yourself. To do so you would have to update the Cargo.toml in a2ltool to refer to the a2ltool git repo instead of using the released version from crates.io.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants