Skip to content

Conversation

@trns1997
Copy link
Collaborator

@trns1997 trns1997 commented Dec 19, 2025

Closes #226

Slave:

  1. Build and deploy:
./scripts/build_slave_bin.sh freedom-k64f ~/nuttxspace/nuttx && ./examples/slave/nuttx/lan9252/freedom-k64f/deploy.sh build_freedom-k64f/easycat_frdm_k64f.bin

Master

  1. Static map example
sudo ./examples/master/freedom-k64f/freedom_k64f_static_map_example enp8s0
  1. Master requests only accel example
sudo ./examples/master/freedom-k64f/freedom_k64f_accel_map_example enp8s0
  1. Master requests only mag example
sudo ./examples/master/freedom-k64f/freedom_k64f_mag_map_example enp8s0

@trns1997 trns1997 marked this pull request as draft December 19, 2025 14:36
@trns1997
Copy link
Collaborator Author

ping @leducp i would like your input

@trns1997 trns1997 force-pushed the slave-dynamic-pdo-manager branch from 6fd83d6 to 8fa9598 Compare December 24, 2025 14:48
@trns1997 trns1997 requested a review from leducp December 24, 2025 15:00
@trns1997 trns1997 marked this pull request as ready for review December 24, 2025 15:02
if (not entry)
{
slave_error("\n update_process_data_output ERROR\n");
return false;
Copy link
Owner

Choose a reason for hiding this comment

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

better to return a corresponding errno (like ENOENT here)

Copy link
Owner

Choose a reason for hiding this comment

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

Or better: directly the StatusCode?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am not a fan of this method, I want to rework this to avoid having the bit_offset ref being manipulated between function calls (super C like). Need to think a better way to do this, I was thinking of encapsulating the for loop below into this function

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I take it back i cannot really find an alternative. As far as the return code goes. I prefer returning a bool and then configureMapping i can return the appropriate Statuscode for INVALID_INPUT_CONFIGURATION when input mapping is problematic and INVALID_OUTPUT_CONFIGURATION for problems with output mapping


if (pdo_indices.empty())
{
return StatusCode::INVALID_INPUT_CONFIGURATION;
Copy link
Owner

Choose a reason for hiding this comment

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

Maybe we can authorize an empty mapping no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hmmm not sure if its legal?

}
}

return pdo_indices;
Copy link
Owner

@leducp leducp Dec 28, 2025

Choose a reason for hiding this comment

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

We need to check if the mapping size if coherent with the user buffers in/out

@trns1997 trns1997 force-pushed the slave-dynamic-pdo-manager branch from a5df9a0 to f60356b Compare December 30, 2025 16:24
@github-actions
Copy link

github-actions bot commented Dec 30, 2025

File Coverage Lines Branches
All files 83% 84% 82%
lib/include/kickcat/Error.h 87% 91% 83%
lib/include/kickcat/SBufQueue.h 80% 98% 63%
lib/master/include/kickcat/Bus.h 71% 100% 42%
lib/master/src/Bus.cc 82% 85% 80%
lib/master/src/CoE.cc 79% 87% 72%
lib/master/src/Link.cc 98% 100% 97%
lib/master/src/Prints.cc 95% 95% 95%
lib/slave/src/AbstractESC.cc 90% 100% 81%
lib/slave/src/AbstractEmulatedEEPROM.cc 0% 0% 0%
lib/slave/src/ESMStates.cc 94% 99% 88%
lib/slave/src/ESM.cc 92% 93% 90%
lib/slave/src/PDO.cc 31% 36% 27%
lib/slave/src/EEPROM/EEPROM_factory.cc 0% 0% 100%
lib/slave/src/ESC/EmulatedESC.cc 53% 60% 46%
lib/slave/src/slave/Slave.cc 0% 0% 0%
lib/src/Frame.cc 87% 92% 82%
lib/src/Mailbox.cc 64% 71% 56%
lib/src/SIIParser.cc 93% 95% 91%
lib/src/protocol.cc 95% 94% 97%
lib/src/CoE/EsiParser.cc 90% 93% 87%
lib/src/CoE/OD.cc 99% 99% 99%
lib/src/CoE/mailbox/request.cc 78% 83% 74%
lib/src/CoE/mailbox/response.cc 93% 97% 88%
lib/src/EoE/protocol.cc 0% 0% 0%

Minimum allowed coverage is 75%

Generated by 🐒 cobertura-action against 968d0ae

@trns1997 trns1997 force-pushed the slave-dynamic-pdo-manager branch from 94d2b1c to 79f03b4 Compare January 16, 2026 13:32
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.

[Slave] Support automatic PDO configuration + contiguous PDO memory mapping

2 participants