-
-
Notifications
You must be signed in to change notification settings - Fork 625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDO block download process doesn't continued right after sequence break #170
Comments
I'm working on the fix. Adding additional state CO_SDO_ST_DOWNLOAD_BL_SUB_RESP_2, if resting sequence is not needed, seems nice to me.
@CANopenNode, could you please point me where in specifications this is mentioned that abort code is sent only on the second timeout? Update: In fact I agree with this logic, cause client can send last segment in block and waiting for response, but if it was lost it is not right to abort whole transaction. |
Now additional state CO_SDO_ST_DOWNLOAD_BL_SUB_RESP_2 is used to send response without resetting SDO sequence. Refactoring timeout halding logic in sub-block transfer. Also add missed unsigned indicators for several constants. issue CANopenNode#170
Now additional state CO_SDO_ST_DOWNLOAD_BL_SUB_RESP_2 is used to send response without resetting SDO sequence. Refactoring timeout halding logic in sub-block transfer. Also add missed unsigned indicators for several constants. issue #170
Thank you for this. It is merged. I'm currently working on split-driver. Will check other SDO issues later. |
Thanks for your work. |
Yes, split-driver will be next mayor release. It is working, but I will make some more tests. There is no extra new features, no deeper changes, it is reorganized and clarified. I will fix bugs also in current master and all changes in master will be also updated in split-driver. So if it is easier for you to stay on master some time and do changes there it is OK. |
This is the same as pull request #171, but applied to split-driver branch. Original author: Oleg <ev.mipt@gmail.com> Now additional state CO_SDO_ST_DOWNLOAD_BL_SUB_RESP_2 is used to send response without resetting SDO sequence. Refactoring timeout halding logic in sub-block transfer. Also add missed unsigned indicators for several constants. issue #170
Here the monitor log for block download process (SDO client is the third party device, SDO server is 0x29 CANopenNode from git master branch):
As you see SDO client broke sequence on 107 segment (caused by not relevant internal issue in SDO client). CANopenNode correctly sent block download response with last successfully received segment number 107. SDO client started resend segments from 108, but when it get up to last segment in block (but not in the whole data) CANopenNode not response anything and then sent SDO abort after timeout.
The reason:
After seq break CO_SDO_process goes into CO_SDO_ST_DOWNLOAD_BL_SUB_RESP state, where it sends response and also clears SDO->sequence and return to CO_SDO_ST_DOWNLOAD_BL_SUBBLOCK state. But all further messages will be ignored like sequence was not started and client should retransmit block from the beginning - it is not right.
So in case of sequence break in CO_SDO_ST_DOWNLOAD_BL_SUB_RESP state SDO->sequence must not be cleared. But it must if it is last segment in whole data transfer or also last segment in current block (SDO->sequence >= SDO->blksize).
But zeroed SDO->sequence also is used to decide to do SDO abort timeout or just download response in first time.
How we can do this accurately? Should the timeoutSubblockDownolad be the "global" variable to indicate of abort needed instead of zeroed SDO->sequence?
The text was updated successfully, but these errors were encountered: