Giter VIP home page Giter VIP logo

Comments (15)

christoph2 avatar christoph2 commented on May 26, 2024 1

XCP based measurement and calibration is a highly complex subject. To start with, I highly recommend

The XCP Reference Book by Vector Informatik.

I'm also working on a project

asamint (ASAM integration package)

which aims to simplify common workflows using packages like pyxcp, pya2ldb, asammdf, ...
(still much work to do…)
Let me know if you have any specific questions.

from pyxcp.

christoph2 avatar christoph2 commented on May 26, 2024 1

OK, maybe there's some additional configuration stuff neccessary to interpret the highest bits.
For the current Autosar release the following holds:

The two most significant bits specify the frame type:

  • 00 CAN message with Standard CAN ID
  • 01 CAN FD frame with Standard CAN ID
  • 10 CAN message with Extended CAN ID
  • 11 CAN FD frame with Extended CAN ID

Can you confirm that you are using CAN-FD in this project?

from pyxcp.

christoph2 avatar christoph2 commented on May 26, 2024 1

The latest patch d0e2e65 now masks out the three most significant bits, i.e. your identifier should be recognized as 'standard'.

from pyxcp.

SaxElectronics avatar SaxElectronics commented on May 26, 2024 1

Hi guys,
I have created an XCP example which receives and decodes data in daq list. I would be happy to share it.
Is it possible to become a contributor?

I also found a bug in the python can driver, which i corrected.

from pyxcp.

christoph2 avatar christoph2 commented on May 26, 2024 1

New contributors are always welcome, just send a pull request.

Regarding DAQ: The christmas release will contain a DAQ related C++ extension module...

from pyxcp.

PuYuuu avatar PuYuuu commented on May 26, 2024

OK, thank you for the reply!

I will start with the two links you recommended. If I have any specific questions later, I will ask you again. Thanks again.

from pyxcp.

PuYuuu avatar PuYuuu commented on May 26, 2024

Hi, christoph !

In the process of using pyxcp, there is an ecu .a2l file that defines CAN_ID_MASTER as 0x4000051A, and CAN_ID_SLAVE as 0x4000051B. This caused pyxcp to report an error at runtime:pyxcp.transport.can.IdentifierOutOfRangeError: 11-bit identifier 'xxxxxxx' is out of range. So I have the following two questions:

  1. I see that the code uses this statement “(identifier & CAN_EXTENDED_ID) == CAN_EXTENDED_ID” to determine whether it is an extended frame. Obviously this statement does not work for can_id like 0x4000051A, is this expected ?
  2. Even if the program successfully determines that the id is an extended frame, it will still report an error because of the statement "if self._id > MAX_29_BIT_IDENTIFIER".Is it because the can_id in the a2l file itself is illegal?
    This a2l file looks like this:
a6643ae94c59

Any reply from you will help me a lot, thank you !

from pyxcp.

christoph2 avatar christoph2 commented on May 26, 2024

Well, CAN_EXTENDED_ID is defined as 0x80000000 which is used per convention to signal extended identifier in several cases (including Autosar). Without a special value it would be undecidable if IDs <= 0x7FF are standard or extended.
(Wasn't 0x40000000 RTR, which nobody should use?)
Yes, from this point of view the behavior is intentional, but I could add a check for values that are clearly extended.
Just to be curious: Which software generated your A2L?

from pyxcp.

PuYuuu avatar PuYuuu commented on May 26, 2024

Wow✨, your replies really help me a lot ! Thank you very much, and i'll keep trying. By the way, The A2L file I used was generated by the software provided by HiRain Technologies.

from pyxcp.

PuYuuu avatar PuYuuu commented on May 26, 2024

Hi,christoph.

With your help, I successfully connected the ECU and obtained the measurement data through 'shortUpload', and configured DAQ to realize the Synchronized measurement of some variables. But when I increased the number of variables in DAQ, I encountered two new problems:

  1. Use the following command:
xcp_master. freeDaq()
xcp_master.allocDaq(1)
xcp_master.allocOdt(0, 60)
for idx in ... :
     xcp_master.allocOdtEntry(0, idx, len(odt))

When executing 'allocOdtEntry' for the 39th time, it will prompt 'ERR_MEMORY_OVERFLOW', it may be that the ECU cannot record so many variables, or I have a problem with the settings, how should I check for this error?

  1. After increasing the number of variables, I found that some variables were not parsed correctly. In the XCP document, I noticed that the DTO package contains the FILL field. Some ODTs have this field, but others do not. How should I judge?
    image

Thank you again!
By the way, i use pyxcp on CAN FD, and run it on nvidia jetson xavier platform.

from pyxcp.

christoph2 avatar christoph2 commented on May 26, 2024

ERR_MEMORY_OVERFLOW in the context of DAQ allocation almost certainly means dynamic configuration memory is exhausted.
Honestly, I don't understand the purpose of the construct len(odt) -- maybe you are trying to allocate way to much ODT entries unintendedly?

The FILL byte ensures that following values greater one byte are evenly aligned.
Consider the following:

#include <stdint.h>

void foo_function(uint8_t * pb)
{
    uint16_t * pw = (uint16_t*)pb;  // Now a 16bit pointer var has an odd address!

}

int main()
{
    uint8_t my_var = 0x42; // May located @ an odd address, e.g. 0x2345,
                           // which is OK for byte-sized variables.

    foo_function(&my_var);
    return 0;
}

Looks innocent, but it isn't -- misaligned access may require some more clock-cycles on many architectures,
but on others this may trigger a bus-trap or similar exceptional state (with more or less catastrophic
consequences...)
Classic case of undefined behaviour according to ISO-C.

from pyxcp.

PuYuuu avatar PuYuuu commented on May 26, 2024

Wow! Good news, christoph. With the help of you and pyxcp, I have successfully obtained and parsed the value of my target variable from the ecu via DAQ. And i think this issue can be closed.

Thank you very much!🌟

from pyxcp.

SaxElectronics avatar SaxElectronics commented on May 26, 2024

i just tried to create a branch and then a PR:

$ git push --set-upstream origin XCP_python_can_DaqListsBugfix
remote: Permission to christoph2/pyxcp.git denied to SaxElectronics.
fatal: unable to access 'https://github.com/christoph2/pyxcp/': The requested URL returned error: 403

i get access denied, I think you have to include me in contributors to be able to create the PR.

from pyxcp.

christoph2 avatar christoph2 commented on May 26, 2024

You can't directly push to pyXCP, create your PR from your fork. Here is a Github guide.

from pyxcp.

SaxElectronics avatar SaxElectronics commented on May 26, 2024

#157

here i created the pull request. Some precommit hooks are failing. Not sure why and how to resolve these...
Bugfix is tested with real ECU.

from pyxcp.

Related Issues (20)

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.