0
\$\begingroup\$

I am learning keil. And I want to compile a project that I found in GITHUB link here. But some of them doesn't include .uvprojx file. So I decided to create an empty uvision project and coppied all files on GITHUB to my new uvision project. But whenever I try to do this, it causes errors like

Error: L6218E: Undefined symbol asd_asd (referred from main.o). So my questions are;

  1. How can I fix this error?
  2. Is there another way to do this than 'coppy and paste'?

Or is KEIL wrong software to do this?

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

The Github project you linked is not a KEIL project but the source for the program you are trying to compile. This has nothing to do with KEIL, so let me go into your specific questions:

1) How can I fix this error?

If you want to use KEIL, you need to configure your new project such that it knows what to do. Simply copying the files into the project folder wont be enough. You need to import them from within the IDE and tell it how to treat them. As your repository does not contain any actual source code (I don't understand why this repo exists then), only pre-compiled .o-files, you need to tell the linker to use them as input.

2) Is there another way to do this but copy and paste.

As you might have noticed, the repository contains a Makefile. This is like a recipe for your computer to take the ingredients (source files etc.) and how to process them in order to build the executable you are trying to create. You can use make to do so (given the right configuration; out of the scope in this question) and program it via a programmer.

I don't know how experienced you are in embedded programming, but I would suggest you look into how what you want to achieve works (i.e. how to control a servo using PWM signals) and then use an example from STmicroelectronics themselves, either using KEIL or STM32CubeMX.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.