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

Fix FMMU and SM reset #241

Merged
merged 3 commits into from
Oct 3, 2024

Conversation

david-boles
Copy link
Contributor

@david-boles david-boles commented Oct 3, 2024

It appears that clearing all SMs and FMMUs on the Kistler 5074B with a single block write doesn't work: In the 6th and 8th packets in the attached "fails" capture you can see that the working counter is zero after attempting to write to Ado 0x600 and 0x800.

I noticed because it results in an incorrect FMMU length being configured, which then causes the subdevice to clobber the PDI with garbage:

let fmmu_config = if fmmu_config.enable {
fmmu_config.length_bytes += sm_config.length_bytes;

I believe the lengths of the memory regions to blank were also wrong/off by one (16*16=256=0x100 for FMMUs, 16*8=128=0x80 for SMs).

Instead, I tried blanking each individually, and in the "succeeds" capture you can see that the first 8 SMs and 8 FMMUs are cleared successfully (working counter of 1); presumably the number of each that this device has.
sm_and_fmmu_reset.zip

Copy link
Collaborator

@jamwaffles jamwaffles left a comment

Choose a reason for hiding this comment

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

Very well spotted, and thanks for the fix! I recaptured the replay tests and pushed them to your branch to get the CI working again - hope you don't mind.

@jamwaffles jamwaffles enabled auto-merge (squash) October 3, 2024 16:35
@jamwaffles jamwaffles merged commit e8402e2 into ethercrab-rs:master Oct 3, 2024
10 checks passed
jamwaffles pushed a commit that referenced this pull request Oct 3, 2024
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.

2 participants