Comments (8)
First of all, I'm glad you're using RasPI / SocketCAN like I do; in this case my infamous [xcpdump] (https://github.com/christoph2/xcpdump) may useful, it's just like the "official" candump but showing you XCP traffic in a readable form.
Note: command packets are basically max. 8 bytes (with the exception of WRITE_DAQ_MULTIPLE), what makes the difference are command response packets.
OK, given you're using xcpdump, the important thing to watch for is the CONNECT response, if maxCto isn't greater than 8, your ECU / simulator wasn't (obviously) compiled to support larger frames.
I suggest to use examples/xcphello.py as a starting point. If GET_ID resp. returns a value > 7 then the following UPLOAD will provoke an FD frame.
Yes, set FD=True and you're done. Works for me, if I'm using my counterpart project BlueparorrtXCP on a (virtual) CAN connection.
You may also add the following lines (before x.disconnect()) :
x.setMta(0xcaffe) # some readable address
x.fetch(0x120) # arbitrary size
from pyxcp.
Thanks for your prompt response and thanks for letting me know about your "xcpdump" project!! I can see how it will come in handy for my needs.
It does make sense the use of 8 bytes, regular CAN frames for most of the commands, and switch to CAN-FD frames as needed on the slave response data, however, I'm not really sure what the ASAM/XCP specification says about mixing CAN/CAN-FD frames though... (I'm seeing CAN regular frames 8 data bytes (for connect) coming out from the master, not FD 8 data bytes as I said... perhaps the FD=True flag is not being propagated properly?)... anyways, unfortunately my ECU (Autosar based module), does filter out the regular CAN frames, so it seems that I need a 'pure' FD master because I'm not able to establish a connection. I will look deeper into your code (when I have a chance) to see what it takes to switch all the transmitting commands to FD... I'm guessing it shouldn't be that difficult, since I believe you are using python-can as underlying driver, Am I correct?
from pyxcp.
Well, I think I've tracked down the issue, but it shows some interesting behavior of python-can (not sure if it is intended) :
If one just passes fd = True
to a interface constructor, python-can does "FD-on-
demand", as it was observed by you.
What was missing: to do pure classic / FD networking, the is_fd
parameter to Message() also has to be set (fixed by 28da1b2)
Please let me know if it really fixes the issue.
from pyxcp.
Yes, it indeed fixes the issue. I can see now the connect command coming out as CAN-FD, with 8 data bytes. However, I'm not able to go further with my testing because I just found out that the Autosar CAN driver in my ECU is also dropping the XCP frames not matching max DLC... I think I inadvertently set this up in the Autosar configuration, and never noticed because we use CANape with fixed data bytes length equal to 64, so all commands are sent with max DLC. I'll try to change that setting in my ECU's code tomorrow, unless there is a way to force the commands DLC to 64 on pyxcp of course.
Thanks for your support!!!
from pyxcp.
OK, now pyxcp behaves like required by Autosar.
Add the following to your config:
MAX_DLC_REQUIRED = true
MAX_CAN_FD_DLC = 64
PADDING_VALUE = 0
Note: The last two values are defaults, so they are not really needed in this case.
To see what's going on check out transport/can.py
P. S. : If you're using CANape, are you also using Microsar?
P. P. S: While issues could be "abused " for interesting talks, why not start a discussion?
Checkthis one.
from pyxcp.
Wait a minute, I've published a draft by mistake, the changes are not yet pushed!
from pyxcp.
Yes, I agree, let's keep the issues were they belong! BTW, I tried the settings you suggested in the configuration file and they didn't work, the frames keep being sent as 8 data bytes (CAN-FD though) [Perhaps a new issue?]… I'll switch to the discussion now!
from pyxcp.
Just confirming that upgrading to 0.16.8 fixes the issue. I probably tested too soon.
from pyxcp.
Related Issues (20)
- How to use HOT 12
- SLAVE_ID vs MASTER_ID HOT 3
- Transport ETH socket bind HOT 1
- SeedAndKey DLL returned: ERR_COULD_NOT_LOAD_DLL HOT 1
- python can filter is not correct HOT 7
- XcpResponseError [ERR_ACCESS_LOCKED] - Seed and Key unlock process error HOT 6
- No more queues! HOT 1
- How to collect and save the XCP data ? HOT 15
- REINIT_DAQ HOT 7
- [Question] Retrieve timestamp from frame HOT 1
- How to get daq data?
- Help HOT 2
- ERR_CMD_UNKNOWN HOT 1
- Python 3.12 wheels HOT 2
- XCP-Download command problem HOT 13
- Read error HOT 11
- ERROR:pyxcp.errorhandler:XcpTimeoutError [Response timed out [block_receive].] HOT 7
- How to get DAQ data. HOT 3
- CAN-FD transport MAX_DLC_REQUIRED HOT 4
- Concurrent pyxcp method calls with asyncio HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyxcp.