Skip to content

Do not look up stored mappings on complex devices - #963

Open
Karl-G1 wants to merge 1 commit into
OpenEtherCATsociety:masterfrom
Karl-G1:fix/mapping-bug
Open

Karl-G1 wants to merge 1 commit into
OpenEtherCATsociety:masterfrom
Karl-G1:fix/mapping-bug

Conversation

@Karl-G1

@Karl-G1 Karl-G1 commented Mar 19, 2026

Copy link
Copy Markdown

Fixes #962

The SII mapping logic in ecx_map_sii assumes that if no process data was found for CoE devices, earlier matching devices can be used. However, complex devices can have the same ID and lack process data in some instances. This fix works around the issue by only applying previous mapping data if the device is not CoE or SoE enabled.

SOEM/src/ec_config.c

Lines 555 to 567 in b410bf6

static int ecx_map_sii(ecx_contextt *context, uint16 slave)
{
uint32 Isize, Osize;
int nSM;
ec_eepromPDOt eepPDO;
Osize = context->slavelist[slave].Obits;
Isize = context->slavelist[slave].Ibits;
if (!Isize && !Osize) /* find PDO in previous slave with same ID */
{
(void)ecx_lookup_mapping(context, slave, &Osize, &Isize);
}

SOEM/src/ec_config.c

Lines 470 to 473 in b410bf6

/* If slave has SII mapping and same slave ID done before, use previous mapping.
* This is safe because SII mapping is constant for same slave ID.
*/
static int ecx_lookup_mapping(ecx_contextt *context, uint16 slave, uint32 *Osize, uint32 *Isize)

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.

Complex devices with no process data incorrectly use earlier configuration

1 participant