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.

TI-RTOS PPP not linking

Hello

I am trying to get a PPP Client example working under TIRTOS with LM3S9D92 processor.

I have added PPP to the CFG file but when I try to create a new HDLC instance I get a linker error

undefined first referenced

symbol in file

--------- ----------------

IFSetPad C:\ti\tirtos_1_01_00_25\products\ndk_2_22_01_14\packages\ti\ndk\tools\hdlc\lib\hdlc.aem3<hdlc.oem3>

 

What else do I need to include to get the PPP to work?

TCP is working fine over my Ethernet port, I tried changing StackLibType from "MIN" to "PPP" and "PPP_PPPOE" and these don't fix issue.

 

  • Hi Barry,

    I still need to investigate this further, but on the surface it looks like a bug.  It looks like that function isn't being built into the NDK libraries because the definition for the function IFSetPad() is surrounded by an #ifdef that's not true (in ti/ndk/stack/res/if.c):

    #ifndef _INCLUDE_NIMU_CODE

    ...

    /*-------------------------------------------------------------------- */
    /* IFSetPad() */
    /* Called to set the header and trailer padding for CreatePacket */
    /*-------------------------------------------------------------------- */
    void IFSetPad( uint Header, uint Trailer )
    {
        /* Record the "worst case" condition */
        if( Header > wcHeader )
            wcHeader = Header;
        if( Trailer > wcPad )
            wcPad  = Trailer;
    }

    ...

    #endif

    You could try to rebuild the NDK libraries and make sure that you undefine _INCLUDE_NIMU_CODE for the stack libraries (or just delete that preprocessor check in if.c for your build).  This should allow you to link, but I have not tested that...

    Steve

  • Hello Steve

    I have taken a copy of the if.c into my project and removed the #ifndef.

    Now compiles and links (Thanks).

    Is this going to be fixed in NDK?

    Regards

    Barry

  • I too am trying to get PPP working on recent NDK (2.22.03.20) on the C6657 EVM.

    As far as I can see IFSetPad() just sets some local variables used by IFCreatePacket(), all of which seems to be old Low Level driver NDK pre-v2.0 code.  IFCreatePacket(), at least in NDK 2.22.03.20 are also #defined something like this:

    #ifndef _INCLUDE_NIMU_CODE

        IFCreatePacket()

    #endif

    or like this:

    #ifndef _INCLUDE_NIMU_CODE

        IFCreatePacket()

    #else

        NIMUCreatePacket()

    #endif

    So I would guess that really all the calls to IFSetPad() should be similarly #defined so that they are only called if we are not building for NIMU ... and they are except for in ndk\tools\hdlc\hdlc.c.

    So now I am confused, sure I can just get this to link, but why would hdlc.c use IFSetPad() if NDK v2.0 was all NIMU?  Is it that the last serial example provided by TI in NDK V2 which should all be NIMU is actually using the old Low Level drivers?  Will I have to rebuild my NDK to not use NIMU to get this to work?  Some pointers would be appreciated...

  • Hello Will

    I have actually changed over to latest TIRTOS - tirtos_tivac_2_00_01_23

    This includes NDK ndk_2_23_01_01 and it appears this has the #define issue resolved as all I needed to do was compile the NDK to include PPP (Default compile doesn't include this) and then it is available to use with no linker errors.

    I haven't delved deeper into the PPP as I have had other projects to complete first and with the TM4CENCPDT yet to be released for production our new product has to be delayed anyway. Also I can't use the PPP until I have my GPRS session code written and tested.

    So I cannot answer your NIMU question, but hopefully someone else can do so for you.

    Might be worthwhile downloading the later NDK and checking what has been changed, this my assist in answering your question.

    Regards

    Barry Andrews

  • Hi Barry, thanks for the reply.

    As far as I can see in NDK 2.23.2.3 (which I will assume is the same as 2.23.1.1 for our purposes...I just instinctively download the latest then saw that I had downloaded a different version to you) hdlc.c hdlcNew() still calls IFSetPad() and if.c still has IFSetPad() inside a #ifndef _INCLUDE_NIMU_CODE ... so unless you are still providing IFSetPad() yourself or are building the NDK with _INCLUDE_NIMU_CODE undefined I am confused as to how the serial client example from NDK 2.0 which uses hdlc could build.

    I don't have time right now to pursue this further and PPP was only required for an early demo so I suspect that is the last you will hear from me on the matter ... I'll just code up a straight serial connection forgoing the benefits of TCP/IP for the moment.  The final application is TCP/IP over Ethernet and has no need of PPP.

    All the best,

     

    Will