pylessard / python-udsoncan

Python implementation of UDS (ISO-14229) standard.
MIT License
575 stars 199 forks source link

How to implement the canfd flash based on the python-can library #182

Closed hanlfa closed 10 months ago

hanlfa commented 10 months ago

How to implement the canfd flash based on the python-can library

hanlfa commented 10 months ago

my code:

bus = can.interface.Bus(interface="kvaser",channel=0, fd=True,   timing=can.BitTimingFd.from_sample_point(
    f_clock=80_000_000,
    nom_bitrate=500_000,
    nom_sample_point=75.0,
    data_bitrate=8_000_000,
    data_sample =  70 ))

config = {
            'p2_timeout':5, #0.05,1
            'request_timeout': 20, 
            'use_server_timing': False, 
        }
        isotp_params = {
            'stmin':20,
            'blocksize': 8,  
            'tx_padding': 0xAA, 
            'rx_flowcontrol_timeout': 1000,  
            'rx_consecutive_frame_timeout': 1000,  
            'max_frame_size': 4095 
        }
# txid = diag_funcreq- 7DF
tp_addr_fun = isotp.Address(isotp.AddressingMode.Normal_11bits, txid=diag_funcreq,rxid=diag_phyresp)  
stack = isotp.CanStack(bus=self.bus, address=tp_addr_fun,params=isotp_params)  # 
conn = PythonIsoTpConnection(stack)  # 
with Client(conn, config=config) as client:
        client.change_session(3)
pylessard commented 10 months ago

there's a parameter in the isotp params that you can set called can_fd See: https://can-isotp.readthedocs.io/en/latest/isotp/implementation.html#can_fd

pylessard commented 10 months ago

Should we close that?

hanlfa commented 10 months ago

ok,close it发自我的手机-------- 原始邮件 --------发件人: Pier-Yves Lessard @.>日期: 2023年11月6日周一 13:09收件人: pylessard/python-udsoncan @.>抄送: hanlfa @.>, Author @.>主 题: Re: [pylessard/python-udsoncan] How to implement the canfd flash based on the python-can library (Issue #182) Should we close that?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>