Repository navigation
fix: wait for the highest configured address during discovery - #21
Merged
Merged
Conversation
Discovery compared the device count against the number of configured slaves. Devices without a configured slave, such as EtherCAT switch ports, also occupy bus positions, so a bus could pass while its last devices had not enumerated yet; the address check then aborted startup. It now waits until the bus reaches the highest configured address. Drop the [DEBUG] lines logged at ERROR level on every healthy start, and mark devices with no configured slave in the device list.
The SDO and state-change error paths looked the name up as slaves_[address - 1], but slaves_ is in registration order and devices without a configured slave take bus positions too. Messages named a different slave than the failing one, and addresses past the number of configured slaves read out of bounds. Look the name up by address. sdoWrite and sdoRead also printed the AL status code of the previous bus position (slavelist[slave - 1]); print the failing slave's own.
firesurfer
reviewed
Oct 15, 2026
firesurfer
reviewed
Oct 15, 2026
firesurfer
reviewed
Oct 15, 2026
firesurfer
reviewed
Oct 15, 2026
firesurfer
reviewed
Oct 15, 2026
firesurfer
left a comment
Contributor
There was a problem hiding this comment.
@mbloechli I wrote a few comments. How far did you test this PR? E.g. on purpose not connect a drive ?
ecx_detect_slaves and ecx_config_init return negative SOEM error codes (EC_NOFRAME, EC_OTHERFRAME, EC_ERROR). Clamping them to 0 hid which one occurred.
firesurfer
approved these changes
Oct 15, 2026
Contributor
Author
I did test if modifying a drives address to being above the detectable adresses would stop the discovery from passing. And I tested if pulling out the ethercat dongle from the PC shuts the system down as intended. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and Why
sdoWrite/sdoReadprinted the AL status code of the previous bus position; they now print the failing slave's own.