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.

Linking error: unresolved symbols rom.h, pinout.c.

Hello,

I am trying to implement TCP based communication with help of the given example of enet_lwip on a EK-TM4C1294 board.

Compiler: TI v5.2.4

I did try to use relative paths for all header and source files but could not get it working, so I tried a crude method of collecting all .c and .h files in the project directory. I also changed the include paths in the in those source and header files.

Now when I complied the project I get 10 errors and 12 warnings pointing to a same object file  pinout.obj:

warnings:

"../pinout.c", line 71: warning #225-D: function "ROM_SysCtlPeripheralEnable" declared implicitly
"../pinout.c", line 90: warning #225-D: function "ROM_GPIOPinConfigure" declared implicitly
"../pinout.c", line 92: warning #225-D: function "ROM_GPIOPinTypeUART" declared implicitly
"../pinout.c", line 104: warning #225-D: function "ROM_GPIOPinTypeUSBAnalog" declared implicitly
"../pinout.c", line 105: warning #225-D: function "ROM_GPIOPinTypeUSBDigital" declared implicitly
"../pinout.c", line 107: warning #225-D: function "ROM_GPIOPinTypeGPIOInput" declared implicitly
"../pinout.c", line 115: warning #225-D: function "ROM_GPIOPinTypeGPIOInput" declared implicitly
"../pinout.c", line 142: warning #225-D: function "ROM_GPIOPinTypeGPIOOutput" declared implicitly
"../pinout.c", line 147: warning #225-D: function "ROM_GPIOPinWrite" declared implicitly
"../pinout.c", line 157: warning #225-D: function "ROM_GPIOPinTypeGPIOInput" declared implicitly
"../pinout.c", line 158: warning #225-D: function "ROM_GPIOPinWrite" declared implicitly
"../pinout.c", line 163: warning #225-D: function "ROM_GPIOPinTypeGPIOOutput" declared implicitly

errors:

undefined first referenced
symbol in file
--------- ----------------
ROM_GPIOPinConfigure ./pinout.obj
ROM_GPIOPinTypeGPIOInput ./pinout.obj
ROM_GPIOPinTypeGPIOOutput ./pinout.obj
ROM_GPIOPinTypeUART ./pinout.obj
ROM_GPIOPinTypeUSBAnalog ./pinout.obj
ROM_GPIOPinTypeUSBDigital ./pinout.obj
ROM_GPIOPinWrite ./pinout.obj
ROM_SysCtlPeripheralEnable ./pinout.obj

error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "Test_1.out" not built

I did check the pinout.c file and it has the required rom.h and rom_map.h files included and are present in the project directory.

All these functions/symbols (ROM_GPIOPinConfigure..) are present in the rom.h files.

What could be the problem?

Thank you..!

  • Chinmay Admane said:
    I am trying to implement TCP based communication with help of the given example of enet_lwip on a EK-TM4C1294 board.

    I am not familiar with this particular example.  However, I think I can shed some light.

    Regarding these warnings (and others like this) ...

    Chinmay Admane said:
    "../pinout.c", line 71: warning #225-D: function "ROM_SysCtlPeripheralEnable" declared implicitly
    "../pinout.c", line 90: warning #225-D: function "ROM_GPIOPinConfigure" declared implicitly

    This indicates that these functions are called but no prototype is visible.  You say you include the correct header file.  But these messages are still seen.  To debug this problem I recommend you use the compiler switch --gen_acp_raw.  Read about in the ARM compiler manual.

    Regarding these errors ...

    Chinmay Admane said:
    undefined first referenced
    symbol in file
    --------- ----------------
    ROM_GPIOPinConfigure ./pinout.obj
    ROM_GPIOPinTypeGPIOInput ./pinout.obj

    The most likely explanation is your build does not include the library which defines these functions.

    Thanks and regards,

    -George

  • Chinmay Admane said:
    All these functions/symbols (ROM_GPIOPinConfigure..) are present in the rom.h files.

    What could be the problem?

    The driverlib/rom.h include file requires a TARGET_IS_* preprocessor symbol being defined to select which device is in use. There is no actual functions such as ROM_GPIOPinConfigure in a library - the names such ROM_GPIOPinConfigure are macros which result in calling functions stored in the device ROM via look-up tables of function pointers at known addresses.

    See section 35.2 Direct ROM Calls of the TivaWareTM Peripheral Driver Library USER’S GUIDE for details:

  • Thank you for your answer..!! It worked..!

    All I had to do is include : #define TARGET_IS_TM4C129_RA1

    Also I would like to tell that a function used in pinout.c (ROM_GPIOPadConfigSet) is not present in the rom.h  for TM4C129_RA1 so it still shows the unresolved error. So I tried to look and find out how they have handled it in the example enet_lwip and they have replaced that function with MAP_GPIOPadConfigSet. This replacement of "ROM" with "MAP" also works for other functions without defining the target TM4C129_RA1.

    Thank you.

  • Chinmay Admane said:
    This replacement of "ROM" with "MAP" also works for other functions without defining the target TM4C129_RA1.

    The "MAP" macros either end up calling a function in flash (from the TivaWare library) OR a function in ROM.

    E.g. if there is a call to MAP_GPIOPadConfigSet in your code:

    - If rom.h has been included AND a TARGET_IS_* macro defined AND a ROM_GPIOPadConfigSet function is available for the given target then the ROM_GPIOPadConfigSet function is called

    - Otherwise the GPIOPadConfigSet function is called from the TivaWare library, which will be placed in flash by the linker

    Therefore, if you don't define the target TM4C129_RA1 all "MAP" functions will end up as calls to TivaWare library functions in flash.