Hi,
My application is to send a binary file from PC to MCU, so that iam CAN ISO tp protocol.
For To understand well PCAN-ISO TP apis, in example 006 we have heavy data around 8936bytes.so my aim is transmit the data by 4096 bytes at once as standard can tp protocol says.
1) now by using 006 example i compiled successfully.
i am trying to send 300 bytes first with a FC frame as follows.
PC TO MCU
res = CANTP_MsgDataInit_2016(&tx_msg, mapping.can_id, mapping.can_msgtype, 300, HEAVY_DATA, &mapping.netaddrinfo);
MCU TO PC
FC ==>0x03 0x2A 0x14
i sent FC frame successfully but From Vs code its not sending 42 frames every time and some time it sends and some times even it ended up with just send 17 bytes too.
How can i solve the above issue, is it due to loopback or any other timing parameters mismatch?
How can i know the status of whether fc frame received in VS Code or not?
Since iam using for PC to MCU communication and vice versa, is it mandatory to use Source and destination address? but how can i include while sending MCU to PC as FC frame or any other response?
is source and address is it only for Vs code port (USB1 or USB2) to understand the direction or else should i include in my firmware code?
Regards
Sandeep
CAN ISO TP FLOW CONTROL FRAME, SOURCE DESTINATION ADDRESS? How to send more than 4096 bytes?
-
- Sales & Support
- Posts: 1083
- Joined: Fri 20. Sep 2019, 13:31
Re: CAN ISO TP FLOW CONTROL FRAME, SOURCE DESTINATION ADDRESS? How to send more than 4096 bytes?
Hello Sandeep,
Thank you for contacting us.
Please note, that we cannot teach the ins and outs of using the ISO-TP protocoll, you'll have to do your own research
regarding this. As to your questions:
Protocol frames from ISO-TP (First, Flow, Consecutive frames) are handled by our API:
A user doesn’t need to read those (and they cannot be read them unless some specific configuration is set).
The API allows to send and receive ISO-TP messages:
Regardless of it being a transmission or reception, you must always read messages to check if an error occurred.
If an error does occur, two things will happen:
1)
The network error will be set in the result member of the received message.
2)
the returned status of the Read function will not be OK if the result member of the received message is not OK.
Regarding your comment:
"i sent FC frame successfully but From Vs code its not sending 42 frames every time and some time it sends and some times even it ended up with just send 17 bytes too."
you have to check both the return status of the read function and the result member of the received message when this issue occurs,
otherwise you won't be able to determine a cause.
Best Regards
Marvin
Thank you for contacting us.
Please note, that we cannot teach the ins and outs of using the ISO-TP protocoll, you'll have to do your own research
regarding this. As to your questions:
Protocol frames from ISO-TP (First, Flow, Consecutive frames) are handled by our API:
A user doesn’t need to read those (and they cannot be read them unless some specific configuration is set).
The API allows to send and receive ISO-TP messages:
Regardless of it being a transmission or reception, you must always read messages to check if an error occurred.
If an error does occur, two things will happen:
1)
The network error will be set in the result member of the received message.
2)
the returned status of the Read function will not be OK if the result member of the received message is not OK.
Regarding your comment:
"i sent FC frame successfully but From Vs code its not sending 42 frames every time and some time it sends and some times even it ended up with just send 17 bytes too."
you have to check both the return status of the read function and the result member of the received message when this issue occurs,
otherwise you won't be able to determine a cause.
Best Regards
Marvin
---
Marvin Heidemann
PEAK-Support Team
Marvin Heidemann
PEAK-Support Team