Skip to content
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

Adding retransmit functionnality to sdo block download #324

Merged
merged 3 commits into from
Aug 8, 2022

Conversation

samsamfire
Copy link
Contributor

I am submitting a pull request to add retransmission functionnality for sdo block download.
I faced a hardware issue (silicon errata) on a DSP where in some very rare cases the CAN rx fifo would swap the reception of two or more CAN frames causing the block transfer to fail, this was a nice solution to overcome the problem.

Copy link
Owner

@christiansandberg christiansandberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR!

"Will start retransmission") % (ackseq, self._blksize))
# Sub blocks betwen ackseq and end of corrupted block need to be resent
# Copy block to resend, and clear it so that multiple retransmits can be done
block = self._current_block[ackseq:].copy()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe just subindexing a list will return a copy already.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you are absolutely right !

@@ -731,14 +736,38 @@ def _block_ack(self):
raise SdoCommunicationError("Server did not respond with a "
"block download response")
if ackseq != self._blksize:
# Sequence error, try to retransmit
self.sdo_client.abort(0x05040003)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite remember the spec, is this abort code still needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
This is taken from the spec and apparently an SDO abort is only necessary in case of a fatal error, so I will remove it.
However it still worked with this abort message, so we probably have a bug on our side.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it's not very common for clients to send abort codes to the server, so some servers may just ignore them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, good to know.

@christiansandberg christiansandberg merged commit e3829fc into christiansandberg:master Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants