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.

UART code Problem

Error[Li005]: no definition for "UART_InString" 
Error[Li005]: no definition for "UART_InUDec" 
Error[Li005]: no definition for "UART_OutUDec" 
Error[Li005]: no definition for "UART_InUHex" 
Error[Li005]: no definition for "UART_OutUHex" 

This is my Errors and my code is

#include <stdint.h>
#include "PLL.h"
#include "UART.h"

//---------------------OutCRLF---------------------
// Output a CR,LF to UART to go to a new line
// Input: none
// Output: none
void OutCRLF(void){
UART_OutChar(CR);
UART_OutChar(LF);
}

int main(void){
char i;
char string[20]; // global to assist in debugging
uint32_t n;

PLL_Init(); // set system clock to 120 MHz
UART_Init(); // initialize UART
OutCRLF();
for(i='A'; i<='Z'; i=i+1){// print the uppercase alphabet
UART_OutChar(i);
}
OutCRLF();
UART_OutChar(' ');
for(i='a'; i<='z'; i=i+1){// print the lowercase alphabet
UART_OutChar(i);
}
OutCRLF();
UART_OutChar('-');
UART_OutChar('-');
UART_OutChar('>');
while(1){
UART_OutString("InString: ");
UART_InString(string,19);
UART_OutString(" OutString="); UART_OutString(string); OutCRLF();

UART_OutString("InUDec: "); n=UART_InUDec();
UART_OutString(" OutUDec="); UART_OutUDec(n); OutCRLF();

UART_OutString("InUHex: "); n=UART_InUHex();
UART_OutString(" OutUHex="); UART_OutUHex(n); OutCRLF();

}
}

AND my files are 

And one last Question should I add startup.s file also and is I added the startup file it give me more than 300 error + warrings extra

What should I do please help. its urgent

  • Error are
    Building configuration: UART_1 - Debug
    Updating build tree...
    Linking
    Error[Li005]: no definition for "PLL_Init" [referenced from C:\Users\sesa448607\Desktop\THis is final\TM4C1294\UART\Debug\Obj\UARTTestMain.o]
    Error[Li005]: no definition for "UART_Init" [referenced from C:\Users\sesa448607\Desktop\THis is final\TM4C1294\UART\Debug\Obj\UARTTestMain.o]
    Error[Li005]: no definition for "UART_OutChar" [referenced from C:\Users\sesa448607\Desktop\THis is final\TM4C1294\UART\Debug\Obj\UARTTestMain.o]
    Error[Li005]: no definition for "UART_OutString" [referenced from C:\Users\sesa448607\Desktop\THis is final\TM4C1294\UART\Debug\Obj\UARTTestMain.o]
    Error[Li005]: no definition for "UART_InString" [referenced from C:\Users\sesa448607\Desktop\THis is final\TM4C1294\UART\Debug\Obj\UARTTestMain.o]
    Error[Li005]: no definition for "UART_InUDec" [referenced from C:\Users\sesa448607\Desktop\THis is final\TM4C1294\UART\Debug\Obj\UARTTestMain.o]
    Error[Li005]: no definition for "UART_OutUDec" [referenced from C:\Users\sesa448607\Desktop\THis is final\TM4C1294\UART\Debug\Obj\UARTTestMain.o]
    Error[Li005]: no definition for "UART_InUHex" [referenced from C:\Users\sesa448607\Desktop\THis is final\TM4C1294\UART\Debug\Obj\UARTTestMain.o]
    Error[Li005]: no definition for "UART_OutUHex" [referenced from C:\Users\sesa448607\Desktop\THis is final\TM4C1294\UART\Debug\Obj\UARTTestMain.o]
    Error while running Linker

    Total number of errors: 9
    Total number of warnings: 0
  • Hello harshal

    Where is the function prototype for the functions giving the errors?
  • I have added the the file uart.h it declared this fuctions.
    thanks in advance.
  • Hello Harshal

    Please be aware that uart.h is a driverlib file as well. What about the C file which contains the actions performed by the functions that are deemed missing. It seems that they are not available for the linker.
  • I have uart.c file it is stored in the same folder where the uart.h file is stored. so should i added it in the linker. if it is then how
  • Hello Harshal

    Is this the same as uart.c from TivaWare?
  • I am Pretty much confused. look I am trying to use uart for serial communication to send a character on taraterm. now what should I do this code will work if not what should i do please suggest. And I am degugger at one usb port and by using serial to ttl board and using Trendnet cable connecting the second usb port. I have also install Trendnet driver now please help
  • Hello Harshal,

    In that case why don't you import the TivaWare example for uart_echo as is in your IDE, if you are looking to send a character to TeraTerm?

    I am trying to help you out here (in absence of access to your code) by asking the questions which is required for me to understand why the error is there in the first place. If you have your own uart.c and .h, it does create an issue since the same file exists in TivaWare. Now are you using TivaWare or not; i don't know, so you may as well want to clarify the same. If not then have you compiled uart.c in your project for the linker to link the functions. If yes to the previous question on TivaWare, then there is a basic issue of functions being over-ridden when the uart.obj file is invoked.
  • Hello, 

    Accordingly with the document: TivaWare™ Peripheral Driver Library Chapter 2 - Programming Model, 

    there are 2 programming methods:  the direct register access model and the software driver model.

    Each model can be used independently or combined,

    based on the needs of the application or the programming environment desired by the developer.


    Each programming model has advantages and disadvantages. 

    Use of the direct register access model generally results in smaller and more efficient code than using the software driver model.

    However, the direct register access model requires detailed knowledge of the operation of each
    register and bit field, as well as their interactions and any sequencing required for proper operation
    of the peripheral; the developer is insulated from these details by the software driver model,
    generally requiring less time to develop applications.

    This sample code uses direct register access.  

    Did you get it from Dr. Valvano's book, right? I suspect because I have the same code here that I downloaded from his 

    web page.

    Here, he teaches how he developed the code: 

    www.youtube.com/watch
    www.youtube.com/watch
    www.youtube.com/watch

    Just as a tip, remember to keep the license header. 


    /* This example accompanies the book
    "Embedded Systems: Real Time Interfacing to Arm Cortex M Microcontrollers",
    ISBN: 978-1463590154, Jonathan Valvano, copyright (c) 2015

    Copyright 2015 by Jonathan W. Valvano, valvano@mail.utexas.edu
    You may use, edit, run or distribute this file
    as long as the above copyright notice remains
    THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
    OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
    MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
    VALVANO SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
    OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
    For more information about my classes, my research, and my books, see
    users.ece.utexas.edu/.../
    */

    Basically, you just need to import your project and run. Do you know how to import a project? If don't I can help you. 

    Do you know how to import a project? If don't I can help you. 

    You can run this code in both compilers CCS or Keil. Both of them works. I have both compilers here, The example works in both. 

    Here are my test output: 

    I used termite. It is simple and I like it. In order to run this code, you'll need to configure the "transmitted test to APPEND CR-LF"  

    Otherwise, it never moves to the next input.  

    Good Luck!