UDS Server Handling of CAN TP problem

A free API for the communication with control devices according to UDS (ISO 14229-1)
Post Reply
Shail
Posts: 49
Joined: Tue 28. Apr 2020, 10:09

UDS Server Handling of CAN TP problem

Post by Shail » Tue 23. Jun 2020, 12:04

Hello,

Example code PCUClient:
We are using function as mentioned below with 4093 byte max transfer from PCUClient.
// UDS Service TransferData with MAX_DATA length
void testTransferDataBigMessage(TPUDSCANHandle Channel, TPUDSNetAddrInfo N_AI)

Example code PCUServer:
// A function that displays UDS messages
void displayMessage(TPUDSMsg* Message, bool isRx)
checking for Message.MSGTYPE != PUDS_MESSAGE_TYPE_INDICATION .

Date more then 8 byte So it's going to pending uds message and create delay for us.
PENDING UDS message from 0x%02x (to 0x%02x, with RA 0x%02x) -> LEN=%i ...\n",

Untill 4096 byte data is not send by client PCU server waiting to response.

Que : Is any way we can avoid wait time server or client since we need to send more amount of data chunks?
how we can handle server response if data more then 8 bytes without delay?

Thanks !

F.Vergnaud
Software Development
Software Development
Posts: 305
Joined: Mon 9. Sep 2013, 12:21

Re: UDS Server Handling of CAN TP problem

Post by F.Vergnaud » Tue 23. Jun 2020, 12:33

Hello Shail,

I do not fully understand your question regarding delays..
But here is how ISO-TP communication is designed:
- Client begins a segmented communication by sending a "First Frame".
- Server receives the First Frame, the API notifies you that a message is pending (you have the information of the full length of the message in this indication).
- Client transfers the remaining segmented frames. When the last frame is received by the server, the API notifies you that a message is complete. A complete message can be successful or not, you have to check the network status of the message's structure (a.k.a. RESULT).

IMHO, it seems wrong to want to answer to a request before you have fully received this request..
You should first have some communication between your client and your server to check if data should be sent (as it is done in UDS transfers).

Anyway you could still:
- analyze the first few bytes of the indication message in order to transmit your response.
- or enable the reception of each CAN frames composing a segmented ISO-TP message. Check parameter PCANTP_PARAM_CAN_UNSEGMENTED. This is not recommended as you will have to process all the CAN frames.
Best regards,
Fabrice

Shail
Posts: 49
Joined: Tue 28. Apr 2020, 10:09

Re: UDS Server Handling of CAN TP problem

Post by Shail » Tue 23. Jun 2020, 13:06

Hello,


Thanks for reply.

-> We need to use testTransferDataBigMessage function from PCUClient which can send data upto 4096 byte using CAN TP.
-> but After using function we need to get acknowledgement from server using sequence number.
-> So we need to wait for acknowledgement sequence number untill to send next chunks of 4096 byte of data.

baud rate : 250 kbps
Is any way we can make this data transfer faster Since we need to program huge data?

Thanks

F.Vergnaud
Software Development
Software Development
Posts: 305
Joined: Mon 9. Sep 2013, 12:21

Re: UDS Server Handling of CAN TP problem

Post by F.Vergnaud » Tue 23. Jun 2020, 14:02

Apart from increasing the baudrate, you can change the following parameters on the server side (in ISO-TP, it is the receiver that defines the communication parameters):
- PCANTP_PARAM_SEPARATION_TIME: 0x00, set it to 0 to reduce the minimum time to wait between each fragmented frames.
- PCANTP_PARAM_BLOCK_SIZE: 0x00, this will remove the need to acknowledge data transfer between client and server.
With these settings, the client will transfer all its data as fast as it can (a possible drawback is that it may disrupt other CAN activities on the bus).
Best regards,
Fabrice

Post Reply