Git Product home page Git Product logo

a2ltool's People

Contributors

danielt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

a2ltool's Issues

Q: Array support

Thanks for writing this tool! Looks great, so far!

I was trying to update the addresses of an existing file, which somebody produced with a tool called CANape.
Apparently, the person mapped the individual elements of an array to individual measurements:

   /begin MEASUREMENT SomeVoltage._0_ ""
      UWORD NO_COMPU_METHOD 0 0 0 65535
      ECU_ADDRESS 0x4001B852
      ECU_ADDRESS_EXTENSION 0x0
      FORMAT "%.15"
      /begin IF_DATA CANAPE_EXT
        100
        LINK_MAP "SomeVoltage._0_" 0x4001B852 0x0 0 0x0 1 0x8F 0x0
        DISPLAY 0 0 65535
      /end IF_DATA
      SYMBOL_LINK "SomeVoltage._0_" 0
      PHYS_UNIT "mV"
    /end MEASUREMENT
    
     /begin MEASUREMENT SomeVoltage._1_ ""
      UWORD NO_COMPU_METHOD 0 0 0 65535
      ECU_ADDRESS 0x4001B854
      ECU_ADDRESS_EXTENSION 0x0
      FORMAT "%.15"
      /begin IF_DATA CANAPE_EXT
        100
        LINK_MAP "SomeVoltage._1_" 0x4001B854 0x0 0 0x0 1 0x8F 0x0
        DISPLAY 0 0 65535
      /end IF_DATA
      SYMBOL_LINK "SomeVoltage._1_" 0
      PHYS_UNIT "mV"
    /end MEASUREMENT

and so on. The elf file lists SomeVoltage (dumped with the objdump example of the objectcrate):

 Symbol { name: "SomeVoltage", address: 40018f0a, size: a0, kind: Data, section: Section(SectionIndex(b)), scope: Compilation, weak: false, flags: Elf { st_info: 1, st_other: 0 } }

But apparently, the entries get removed when running --update.

From the output of --help I figured the format of the entries is possibly wrong, thus, I tried adding an array value as follows:

$ a2ltool Comboard2.a2l --elffile a.out --measurement SomeVoltage[0] --output Comboard3.a2l --verbose
[...]
Insert skipped: Symbol SomeVoltage[0] could not be added: Remaining portion "[0]" of "SomeVoltage.[0]" could not be matched

So I keep wondering what the correct way of arrays is. Any help would be appreciated.

Linux Support

Hello,

does this application has linux version?

Bests

How to use this tool for A2L merge?

Hello
I'm trying to use this tool to merge two different A2l file, but I don't have some knowledge for the command, when I input './a2ltool.exe --merge <Master.a2l> --merge <Slavel.a2l> --output <new.a2l>', it give feedback on an error, whould you please help me to correct it?
Looking forward to your reply!

A2l file generation

Hello Developer,
May I ask if this tool supports generating a2l files? For example, generated through code or configuration files.

how to use regex to generate with many style parameter

Hello again

There is a elf file, the calibration or measurement parameter using different name style.

I am trying to using regex to generate a2l from elf.
But .?_Cal is working but (.?_Cal |.*?_Write) will not work correctly.

How can I will regex to match many styles?

Many Thanks

Is it possible to generate array parameter from elf file?

Hello Developer

Thanks again for the awesome tool, it help me a lot

Is possible to generate an array parameter instead of separate into abc.1 abc.2 from elf file?

Cause there is a 300elements array Measurement parameter to load.

Thanks,
Rowe

Is it possible to output a2l files as specific version?

Dear Developer

Does this awesome tool support to ouput a2l file as specifice version?
I used below command to create a2l file from elf, but it always output a2l file in ver1.71.
a2ltool --create --elffile abc.elf --characteristic-regex .*?_Cal --measurement-regex .*?_Dis --output abc.a2l

How can I output as another version?

Thanks,
Rowe

it doesn't work in my computer

Hello

I am searching for an open-source tool for making A2L files and found it here.
but this release file doesn't work on my computer.

just the cmd window popped up and closed.

my PC information is below.

Processor : Intel(R) Xeno(R) Gold 6234 [email protected]
RAM : 32GB
OS : windows 10 Enterprise 64Bit

Array type variables, that contain "_" as array index prefix are not updated

I have a a2l generated with canape(from vector) and I tried to update with this tool.
The canape tool generates individual characteristics for each element of the variable example_array[3]
example_array_0_
example_array_1_
example_array_2_
Normal variables are updated, but variables that are arrays: are not updated.
They all have in the output a2l the value 0 for address(as if it did not find the variable name).

Mixed line endings(LF and CRLF) in output file

When updating an exiting a2l file generated with CANAPE, the resulting output file from the a2ltool ( -o option) has mixed line endings.
Would be nice to be normalized, either LF or CRLF, or allow the user to choose.

Missing measurements for bitfields

The latest commit (ddaab36) seems to result in the a2l file lacking information regarding bitfields.

The a2l file I'm updating which was generated by CANape10 contains i.e. the following measurement:

    /begin MEASUREMENT ErrorLog.bit.SomeError1 ""
      UBYTE NO_COMPU_METHOD 0 0 0 1
      BIT_MASK 0x2
      ECU_ADDRESS 0x400216AB
      ECU_ADDRESS_EXTENSION 0x0
      FORMAT "%.15"
      /begin IF_DATA CANAPE_EXT
        100
        LINK_MAP "ErrorLog.bit.SomeError1" 0x400216AB 0x0 0 0x0 1 0x80 0x1
        DISPLAY 0 0 1
      /end IF_DATA
      SYMBOL_LINK "ErrorLog.bit.SomeError1" 0
    /end MEASUREMENT

up till now the following was generated when using --update

    /begin MEASUREMENT ErrorLog.bit.SomeError1""
      ULONG NO_COMPU_METHOD 0 0 0 1
      BIT_MASK 0x40000000
      ECU_ADDRESS 0x400216A8
      ECU_ADDRESS_EXTENSION 0x0
      FORMAT "%.15"
      /begin IF_DATA CANAPE_EXT
        100
        LINK_MAP "ErrorLog.bit.SomeError1" 0x400216A8 0x0 0 0x0 1 0x80 0x1E
        DISPLAY 0 0 1
      /end IF_DATA
      SYMBOL_LINK "ErrorLog.bit.SomeError1" 0
    /end MEASUREMENT

(aparrently we use the inverted bitfields setting in CANape, thus the mask is different).
But now the measurements for bits are completely missing.

(*) This is by the C code, by the way

typedef union __ErrorLogFlags
{
    struct
    { 
        uint32_t ModulNo             : 10;
        uint32_t reserved            : 19;
        uint32_t SomeError2          : 1;                    // 0x00004
        uint32_t SomeError1          : 1;                    // 0x00002
        uint32_t SomeError0          : 1;                    // 0x00001
    } bit;
    uint32_t all;
} ErrorLog;

Performance of `insert_many`

When inserting into an empty a2l file, a2ltool takes a very long time to perform the task.

I recorded a flamegraph using cargo flamegraph:

cargo flamegraph  --bin=a2ltool -o baseline.svg --  \
    a2ltool --create --elffile path/to/filename.out  --characteristic-regex "Settings.*"  --output test.a2l

Please find the svg file attached. Interactive viewing works fine in e.g. firefox:

baseline

Apparently, lots of time is spent inside the hash table and creating strings. Due to the string creation, I was wondering if jemalloc had any impact. But its flamegraph is very similar and I stopped a2ltool after > 60 Minutes, so I cannot say if it would have been any faster.

baseline-jemalloc

Assertion due to unprocessed type info

I just tried HEAD to check out the lastest changes and noticed I hit a recently introduced assert in typereader.rs.
Aparrently, there are still wip_items left. A quick hack

diff --git a/src/dwarf/typereader.rs b/src/dwarf/typereader.rs
index 3adfcf0..3f86923 100644
--- a/src/dwarf/typereader.rs
+++ b/src/dwarf/typereader.rs
@@ -45,6 +45,11 @@ impl<'elffile> DebugDataReader<'elffile> {
                         }
                         typereader_data.wip_items.clear();
                     }
+                    if !typereader_data.wip_items.is_empty()
+                    {
+                        println!("WARNING: Unprocessed type info, ignoring:\n{:?}", typereader_data.wip_items);
+                        typereader_data.wip_items.clear();
+                    }
                     assert_eq!(typereader_data.wip_items.len(), 0);
                 }
             }

yields:

WARNING: Unprocessed type info, ignoring:
[WipItemInfo { offset: 124267, name: Some("CAN_CONFIG"), tag: DwTag(22) }, WipItemInfo { offset: 124199, name: None, tag: DwTag(19) }, WipItemInfo { offset: 124340, name: None, tag: DwTag(15) }]
WARNING: Unprocessed type info, ignoring:
[WipItemInfo { offset: 124283, name: Some("CAN_MB_CONFIG"), tag: DwTag(22) }, WipItemInfo { offset: 124069, name: None, tag: DwTag(19) }, WipItemInfo { offset: 124340, name: None, tag: DwTag(15) }]
WARNING: Unprocessed type info, ignoring:
[WipItemInfo { offset: 498045, name: None, tag: DwTag(1) }, WipItemInfo { offset: 492863, name: Some("lwip_socket_multicast_pair"), tag: DwTag(19) }, WipItemInfo { offset: 497538, name: None, tag: DwTag(15) }, WipItemInfo { offset: 495412, name: Some("lwip_sock"), tag: DwTag(19) }, WipItemInfo { offset: 497550, name: None, tag: DwTag(15) }, WipItemInfo { offset: 493009, name: Some("netconn"), tag: DwTag(19) }]

I'm not really sure what's the issue here or if the items are required for something.

Add "section" CLI option

Daniel,
Well done! this tool is excellent!

I would like to request an "add measurement from section" command line option. My diagnostic and/or calibration variables are often placed in their own sections (.diag and .cal in my case). It would be very convenient to have the ability to create measurements and/or characteristics for all symbols in a particular section.

Keep up the good work!

ti arm compiler generated elfs have issues

Hello Daniel,
I was playing arround with the Jacinto from TI, and I wanted to write some code for an ARM R5 core. At one point, I wanted to do some calibration using a2ls, I used the "--create" option and got this:
"
evaluate_exprloc eval result is unhandled: RequiresMemory {
address: 536912364,
size: 1,
space: None,
base_type: UnitOffset(
0,
),
}
evaluate_exprloc eval result is unhandled: RequiresMemory {
address: 0,
size: 1,
space: None,
base_type: UnitOffset(
0,
),
}"

The elf I used is the one from the TI demo website: https://software-dl.ti.com/codegen/docs/tiarmclang/compiler_tools_user_guide/getting_started_guide/building_simple_application.html
build using command line, not ccs.
Any idea what could be the issue?

Adding READ_WRITE option for meassurements

Please, could it be possible to add READ_WRITE option to meassurements?

    /begin MEASUREMENT Signal1 "FreeRTOS"
      UBYTE FreeRTOS_ENUM_Signal1  0 0 0 1
      ECU_ADDRESS 4273875998
      READ_WRITE
      SYMBOL_LINK "Signal1 " 0
    /end MEASUREMENT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.