This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PROCESSOR-SDK-AM437X: PROFINET issue with latest SDK

Part Number: PROCESSOR-SDK-AM437X


We are currently developing a PROFINET enabled device, and have purchased the Molex PROFINET stack and the Interniche SNMP stack.
As HW we are using AM437x IDK and have the stack up and running.
Our implementation is based on PRU-ICSS-Profinet_Slave_01.00.01.00 example, but replaced with the full stacks. 

Since we were not using the latest SDK I have tried to upgrade to the latest version, but this caused I PROFINET to stop functioning.

It works with PDK 1.0.6 but fails with PDK 1.0.8. By debugging I have found a problem with NDK and the ICSS EMAC driver. I don't think this is a problem I have caused. 

In the file nimu_icssEthDriver.c line 591:

        ioctlParams.command = ICSS_EMAC_STORM_PREV_CTRL_RESET;
        /*Reset the credit values used for Storm prevention*/
        if(ICSS_EMAC_MODE_SWITCH == ((ICSS_EmacObject*)(pi->nimuDrvHandle)->object)->emacInitcfg->portMask)
        {
            strmPreventionEnable1 = (stormPrevention_t*)(((ICSS_EmacObject*)(pi->nimuDrvHandle)->object)->stormPrevPtr);
            strmPreventionEnable2 = ((stormPrevention_t*)(((ICSS_EmacObject*)(pi->nimuDrvHandle)->object)->stormPrevPtr)) + 1;
            if((strmPreventionEnable1->suppressionEnabled) | (strmPreventionEnable2->suppressionEnabled))
            {
                ICSS_EmacIoctl(pi->nimuDrvHandle, ICSS_EMAC_IOCTL_STORM_PREV_CTRL, 0, (void*)&ioctlParams);   // <<<----- portNo is 0 ?!?
            }
        }
        else

1. ICSS_EmacIoctl() is called with argument portNo set to 0.

2. ICSS_EmacIoctl() calls ICSS_EmacValidateFeatureSet() with portNo set to 0

3. But ICSS_EmacValidateFeatureSet() returns -1 (error) if portNo is 0 and thus storm prevetion control (?)  does not get reset?

I am not sure where the error is (is portNo allowed to be 0 or??). But if I skip the call to ICSS_EmacValidateFeatureSet() everything works just fine.

        case ICSS_EMAC_IOCTL_STORM_PREV_CTRL:
//            retVal = ICSS_EmacValidateFeatureSet(icssEmacHandle, portNo, ICSS_EMAC_FW_STORM_PREVENTIION_FEATURE_CTRL);
            retVal = 0;
            if (retVal == 0)
            {
                switch(ioctlCmd->command) {
                    case ICSS_EMAC_STORM_PREV_CTRL_ENABLE:
                        ICSS_EmacEnableStormPrevention(portNo, icssEmacHandle);
                        setCreditValue((*((uint16_t *)ioctlData)), (stormPrevention_t*)(((ICSS_EmacObject*)icssEmacHandle->object)->stormPrevPtr));
                        break;
                    case ICSS_EMAC_STORM_PREV_CTRL_DISABLE:
                        ICSS_EmacDisableStormPrevention(portNo, icssEmacHandle);
                        break;
                    case ICSS_EMAC_STORM_PREV_CTRL_SET_CREDITS:
                        setCreditValue((*((uint16_t *)ioctlData)), (stormPrevention_t*)(((ICSS_EmacObject*)icssEmacHandle->object)->stormPrevPtr));
                        break;
                    case ICSS_EMAC_STORM_PREV_CTRL_INIT:
                        ICSS_EmacInitStormPreventionTable(portNo, icssEmacHandle);
                        break;
                    case ICSS_EMAC_STORM_PREV_CTRL_RESET:
                        ICSS_EmacResetStormPreventionCounter(icssEmacHandle);
                        break;
                    default:
                        retVal = (int8_t)-1;
                        break;
                }
            }

Can anyone help me here?