Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Got Problem on C Program Running in Keil5

Status
Not open for further replies.

KMW

Newbie level 5
Joined
Jul 8, 2022
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
64
I am beginner to learn TM4C123G LaunchPad. I have managed to build the first project of blinking LED through Keil5.

I tried to run another problem to calculate the area of square and print the result into the UART by simulation function of Keil5.

However, I could not build the target.

Is anyone can help me how to obtain stdio.h and uart.h files such that I can add them into the Sources Group of Keil5?

Thanks in advance!

KMW
 

Please find two files for your reference.

The first is the error messages and the other is the screen-shot of Keil5.

Best Regards
 

Attachments

  • 20220709A-C-01-Error-Message.pdf
    237.7 KB · Views: 227
  • 20220709A-C-01-Keil-Screen-Shot.pdf
    282.5 KB · Views: 156

You must fix problems in the order they appear in the compiler output, since following errors can be caused by an earlier. In this case, make sure that you have the file UART.h, and that it is in the compilers search path for include files.
With an include file name enclosed in double quotation marks (") the compiler will only find it by itself it is in the same directory as the current source file (the file with the #include statement).
 

I had attached the screen-shot file in my former thread to indicate an UART.h has been linked into the sources group.
However, it was still not read by the C program.
 

I don't use Keil but try changing:

"UART.H" to
<UART.h>

It changes the path to where the file is expected to be. I would think something like a UART definition would be part of the compiler package.

Brian.
 

Hi,

still the compiler does not find the UART.h.
Show us the complete path where it is placed.

Klaus
 

For me, it works!!!

Pay attention ion line 10!!! You must have a clear line at the end (newline).

See if all files have this!!!

Don't forget to save all files!!!

1657588170987.png


1657588410940.png


1657588426127.png
 
Last edited:

May I know where USART.h and UART.h have been obtained? Is it automatically generated by Keil5?
 

I've created this files!
Just added the .h file!!!

Simple question, you are using '' ( ' twice) or "?

Where stdio.h has been obtained?

Could you share the project?
 

The stdio.h was linked by keil5. Please find attached the sources files for your trial.
Thanks in advance!
 

Attachments

  • running-C-01.zip
    6.5 KB · Views: 132

You can follow these steps:

1 - Remove the two files thats were wrong:

1657725623825.png


2 - Add again, like image below: (you can skip this step, if you prefer):

1657725917305.png


3 - And replace all comments that use // to /* and */ in UART.h file.
And comment the last line "void Output_Color(uint32_t newColor);".
The type uint32_t is not supported by my compiler, you can change for other supported.

1657726196415.png


4 - And its done!

PS: Sorry for the bad english, it's not my primary language!
 
Last edited:

Thanks! I have modified as per your advice. Now UART.h is readable. However, the outcome is different.
I am also surprised why you did not have any errors from startup.h.
I re-attached the modified UART.h with the supporting files for your reference.
Could you also share your setting in Options for Target and Software Packs for cross-checking?

1657771046378.png
 

Attachments

  • 20220714A-Running-C-01.zip
    6.5 KB · Views: 121

Go to Project, New uVision Project... Select your target...

1657815917493.png


Next window, tick Startup...

1657816236875.png


Click on button Resolve to solve problems...

1657816267895.png


You can use more drivers, if you prefer.
Click on OK button.
Now you must to add code:

1657816366314.png


You can rename Targer 1 and Source Group 1.
Inside the Source Group 1, add your files running-C-01.c and UART.h... startup.s isn't necessary!!!

1657816513834.png


Click on button Save All (Only to prevent any problem).

Click on Project menu, Option for Targeg .... (ALT+F7)

1657816649063.png


You can specify to create .HEX file... tick Create HEX file, on tab Output.

1657816730875.png


If you click on button Build, no expected errors.

1657816757669.png


I sent my project in attach/ts.
 

Attachments

  • Running.zip
    110.4 KB · Views: 119

Thanks again! I have taken your advice steps and successfully made the target. When I run in Debug Mode under either Simulation or Stellaris ICDI, the expected text was unable to show on screen.

With reference to the demo video, the program is not required to select the CMSIS and the Device.
When running in Evaluation Mode on the demo video, another screen of UART #1 is appeared to shown the printout as below.

1658012128557.png




1658011978533.png


Have you perform some similar evaluations before? Could you able to advise me what are missing?
 

Referring to your rectified program, could you able to run it and display the expected context within printf command on the screen?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top