Linking Errors External Library

Comments

8 comments

  • Avatar
    Jon Elliott

    From what you've described, it sounds like you've done everything required to link in a library.

    Can you attach your .hzp file?

    0
    Comment actions Permalink
  • Avatar
    cutaway

    I believe I have.  It is always that "one little thing" that throws it all off.  HZP file attached.

    Thank you,

    Cutaway

    0
    Comment actions Permalink
  • Avatar
    Jon Elliott

    Looking at the .hzp file, the USB project is a "Staging" project rather than a "Library" project - this means it will copy the source files rather than compile them and create a library.

    0
    Comment actions Permalink
  • Avatar
    cutaway

    Jon,

       Excellent.  Actually, I noticed that but since I am new to Crossworks I wasn't sure I was right.  Good.  Most likely I will just delete that project and re-add it.  But, for future reference, is there a way to convert projects?  Move it from a "staging" project to a "library" project, without deleting what I already have?

    Thank you,

    Cutaway

    0
    Comment actions Permalink
  • Avatar
    cutaway

    Well, I guess my problems go deeper than what we have covered.  Here is what I did.

    1. Removed dependency from the primary project.

    2. Removed the old USB project.

    3. Created a static library project and used a dynamic folder to point it to the directory with the usb files.

    4. Cleaned and recompiled both projects.

    Now I am getting assembly errors with the AT91SAM7X256.h file in the USB project.  Here is a snippit:

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

    Building "USB" in configuration "ARM Flash Debug"
    ARM Flash Debug/board_cstartup.o does not exist.
    Assembling board_cstartup.S
    /home/cutaway/Documents/CrossWorks Projects/SAM7-EX256_USB-ext/../usb/.//ARM Flash Debug/at91lib/boards/sam7-ex256/at91sam7x256/AT91SAM7X256.h: Assembler messages:
    /home/cutaway/Documents/CrossWorks Projects/SAM7-EX256_USB-ext/../usb/.//ARM Flash Debug/at91lib/boards/sam7-ex256/at91sam7x256/AT91SAM7X256.h:65: Error: bad instruction `typedef volatile unsigned int AT91_REG'
    /home/cutaway/Documents/CrossWorks Projects/SAM7-EX256_USB-ext/../usb/.//ARM Flash Debug/at91lib/boards/sam7-ex256/at91sam7x256/AT91SAM7X256.h:75: Error: bad instruction `typedef struct _AT91S_SYS{'
    /home/cutaway/Documents/CrossWorks Projects/SAM7-EX256_USB-ext/../usb/.//ARM Flash Debug/at91lib/boards/sam7-ex256/at91sam7x256/AT91SAM7X256.h:76: Error: bad instruction `at91_reg AIC_SMR[32]'

    [snip]

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

     

    I guess it wasn't going through this step before, so I wasn't seeing these errors.  I have included the directories in my User Include Directories.  I could try updating some of the "Additional C Compiler Only Options" but I really don't think I should have to.  And I don't want to muck up the project too much.

    Cutaway

    0
    Comment actions Permalink
  • Avatar
    cutaway

    Here is the new Solution file.

    Cutaway

    0
    Comment actions Permalink
  • Avatar
    Jon Elliott

    From the build log it looks like a C/C++ typedef is being used in assembly code - check the correct header file is being included or if any preprocessor definitions are required to disable the C code in the header file.

    Also, board_cstartup.S sounds like startup code and you are already using our startup code in the main executable project (AT91SAM7_Startup.s").

    0
    Comment actions Permalink
  • Avatar
    cutaway

    Jon,

       Excellent.  It appears that I was not deleting the "ARM Flash Debug" folder when I recreated my USB project. 

       Unfortunately it appears that I have reached an impasse with the ATMEL USB code.  I am now receiving an error with their included version of <stdio.c> as the "variable 'r' has initializer but incomplete type" error.  Tracking this down I found this thread http://www.at91.com/forum/viewtopic.php/f,8/t,5352/ which lead me to the following information from ATMEL's support site

    ----------

    Linux vs. Software Package Cross Toolchains
    Question

    Linux vs. Software Package Cross Toolchains

    Answer

    The cross toolchain used to compile Linux under Linux4SAM.org web site does NOT allow to compile the GNU Software Package Examples provided on the ATMEL web site.

    Go to the Code Sourcery web site, section Download Sourcery G++ Lite Edition for ARM: http://www.codesourcery.com/sgpp/lite/arm/portal/subscription?@template=lite

    Target OS must be selected to dowload the correct Cross Toolchain version:

    • EABI to compile the GNU Software package examples
    • GNU/Linux to compile the Linux4SAM source files.

    ----------

    So, I guess, since I am using Linux, that I will be chopping up their USB code to try and get it to function properly using Crossworks.  Maybe a different version will work. *shrug*

    Sign.  It never just works.

    Thanks again, Jon.  You were a big help.

    Cutaway

     

    0
    Comment actions Permalink

Please sign in to leave a comment.