• AVR Freaks

Hot!undefined reference issue

Author
jimctr7
New Member
  • Total Posts : 13
  • Reward points : 0
  • Joined: 2020/04/09 10:34:40
  • Location: 0
  • Status: offline
2020/05/26 10:06:12 (permalink)
0

undefined reference issue

I am getting an undefined reference issue with regards to my SPI driver, even though when I search the project, the references in drv_spi.h and drv_spi.c come up, and if I check my file inclusion/exclusion under project properties, drv_spi.h and drv_spi.c is listed under included files.
 
Any particular reason why these references are not being seen by the compiler when they are clearly part of the project? 
 
OK, I am seeing an anomoly.   The path to drv_spi.c in the Included Files is not quite correct:   it is claiming that the path is .../src/config/default/driver/spi/src/drv_spi.c, but there is no src above drv_spi.c from what I can ascertain looking at the tree.
 
It is not clear to me how to modify this listing to correct the path.  Not certain if this will correct the problem but it is a guess.

Attachment(s)

Attachments are not available: Download requirements not met
#1

4 Replies Related Threads

    RISC
    Super Member
    • Total Posts : 5776
    • Reward points : 0
    • Status: offline
    Re: undefined reference issue 2020/05/26 10:32:24 (permalink)
    +1 (1)
    Hi,
    Did you include the SPI header file in the capsa_epd.c ?
    Regards
    #2
    jimctr7
    New Member
    • Total Posts : 13
    • Reward points : 0
    • Joined: 2020/04/09 10:34:40
    • Location: 0
    • Status: offline
    Re: undefined reference issue 2020/05/26 10:41:15 (permalink)
    0
    Yes, I have tried this, though since these are system files, did not think it necessary. In any case, makes no difference if these are included in capsa_epd.c or not
    #3
    ric
    Super Member
    • Total Posts : 28324
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: undefined reference issue 2020/05/26 13:22:23 (permalink)
    +1 (1)
    jimctr7
    Yes, I have tried this, though since these are system files, did not think it necessary.

    Huh?
    You don't get ANY header files without a #include
    The only difference between COMPILER supplied files and everything else is if you use <> or "" as the delimiters.
    Including header files into the project has NO EFFECT on the compiler. That is just a convenience to help the editor find them.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #4
    jimctr7
    New Member
    • Total Posts : 13
    • Reward points : 0
    • Joined: 2020/04/09 10:34:40
    • Location: 0
    • Status: offline
    Re: undefined reference issue 2020/05/26 13:29:50 (permalink)
    0
    A colleague pointed out the issue to me.  I am using Harmony 3, moving over from a program that worked under Harmony 2.  In any case, the prototypes appearing in the drv_spi.h files have no corresponding function in the drv_spi.c file.  This involves functions DRV_SPI_TransferStatusGet , DRV_SPI_WriteTransferAdd, DRV_SPI_ReadTransferAdd.  
     
    Supposedly, you need to change the SPI driver setting to asynchronous, and the functions are generated in the drv_spi.c file.  I can't say that I totally understand this, in the conventional use of the term synchronous, but this has to do with blocking and non-blocking functions, and with the spi driver listed as synchronous, those functions were removed.
    #5
    Jump to:
    © 2020 APG vNext Commercial Version 4.5