-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make demo.elf fails #9
Comments
I fixed it by setting absolute paths for LIBROOT, TOOLROOT and TEMPLATEROOT but now encounter a new error:
|
Which directory is the .h file in (I haven't looked at this for several
years). Once you know the directory, you can add a
-I directive to the Makefile.
Geoffrey
…On Thu, Jun 14, 2018 at 12:40 PM, baybled ***@***.***> wrote:
Hello, I am following along with your book "Discovering the STM32
Microcontroller". On page 49 there is instruction to type "make" in the
demo folder. The stm32f10x.h file cannot be found despite Makefile.common
pointing to the right place. I even checked by navigating to the location
and looking at the file!
This is the error from make:
~/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi-gcc -c -O1 -g -mcpu=cortex-m3 -mthumb -I.. -I/gcc-arm-none-eabi_samples/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x -I/gcc-arm-none-eabi_samples/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport -I/gcc-arm-none-eabi_samples/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc -I. -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -DUSE_FULL_ASSERT -I../Library/ff9/src -I../Library ../startup_stm32f10x.c -o startup_stm32f10x.o
../startup_stm32f10x.c:3:23: fatal error: stm32f10x.h: No such file or directory
compilation terminated.
make: *** [../Makefile.common:66: startup_stm32f10x.o] Error 1
Please could you send help, I would like to carry on with this book
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#9>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/ABq_UpnMASE-AwpNLWxT9cTCZai8jqTxks5t8pISgaJpZM4UoS3E>
.
|
Sorry do you mean the "startup_stm32f10x.h" file? I've done a grep search and found nothing matching this. In the same directory as Makefile.common there is a "startup_stm32f10x.c" file. Do you know where this file could be located? and also, thank you for writing this book. I appreciate the way your writing employs brevity and if there is a more current edition, or a better version, could you please let me know |
I don't think so -- here's the error message
../startup_stm32f10x.c:3:23: fatal error: stm32f10x.h: No such file or directory
…On Thu, Jun 14, 2018 at 1:31 PM, baybled ***@***.***> wrote:
Sorry do you mean the "startup_stm32f10x.h" file? I've done a grep search
and found nothing matching this. In the same directory as Makefile.common
there is a "startup_stm32f10x.c" file. Do you know where this file could be
located?
and also, thank you for writing this book. I appreciate the way your
writing enlists brevity and if there is a more current edition, or a better
version, could you please let me know
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABq_UvnbMbZNwoJ0tgTcl48acsUQCGCNks5t8p3zgaJpZM4UoS3E>
.
|
E: download https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads as toolchain to fix problems Solution found (this writeup is to help those who are struggling) tl;dr copy from a github of someone who uploaded all the software back in 2014 and update Makefile.common Now I have a path to a pair of files called system_stm32f10x and start_stm32f10x in a separate directory. My Makefile contains a reference to those files. I have found other files are not included and so, I have a repo that I am borrowing files from thanks to @emdarcher. I just run the program and look at which file is missing and where it was expected. The repo has it in the right place so it's just a case of copying across to my own personal system. Here is the branch where the files are located, it includes a link to the repo: https://github.com/emdarcher/stm32-learning/tree/master/books/discovering-stm32/STM32-Template @emdarcher also did many of the exercises and I have no doubt that when I am stuck, I will look into his solutions to try and gain a better understanding (there's no point copying, the only use here is to use his files for hints) thank you again @geoffreymbrown |
This looked promising, so I tried to follow your advice, but I still can't get this to work in Windows. Could you expand a little on what you did, and maybe share your makefile? I would still have to edit it, for use on Windows, but it might at least get me a bit further with trying to work through Geoffrey's book. I have two different versions of the ARM GCC toolchain set up, and I have compiled and built a couple of projects successfully - where I already had a working makefile, or one that only needed paths changing. In this case, I'm getting nowhere. I followed the advice in issue #2, about the same error message (correcting the path for the library folder to the current location), and perhaps got a bit further, but I still get this error: " No rule to make target 'system_stm32f10x.o', needed by 'Demo.elf' " FWIW, I'm not a beginner, as a programmer - just to this environment. I have yet to find any useful guide to writing or understanding make files for GCC, and it's a long time since I used any sort of make utility at all. I'm not sure how many beginners would be able to get anywhere with building the code examples, any more. From what I've read so far, being on Linux doesn't necessarily help - everything depends on the particular version of everything else. |
Okay, I figured out how to get past that, to get Demo.elf to compile. I thought I'd write this here, before I forget. This was the error I was getting before:
After fixing the paths in Makefile.common, I copied these three files from where I'd put the STM32F10x_StdPeriph_Lib_V3.5.0, to the Library folder, in emdarcher's version of the project (see posts above) ; stm32f10x.h from:
to:
To avoid confusion, I've given the full paths, on my PC, though of course, this needs changing to where they're actually put. The key changes to Makefile.common were the paths in these lines, altered to correspond to where I'd put the library:
Using quotes allows for spaces and backslashes in the Windows paths, so they can be copied from an explorer window, using "Copy address as text", by right clicking on the address bar at the top (that may need to be enabled, in Tools->Folder options, in some versions of Windows). I've now been able to compile it successfully, using two versions of GCC for Windows - GNU Tools for ARM Embedded Processors 7-2017-q4-major 7 2017, and GNU Tools for ARM Embedded Processors 8-2018-q4-major 8 2018. In each case, I started (inside the Demo folder) with;
followed by
|
Hello, I am following along with your book "Discovering the STM32 Microcontroller". On page 49 there is instruction to type "make" in the demo folder. The stm32f10x.h file cannot be found despite Makefile.common pointing to the right place. I even checked by navigating to the location and looking at the file!
This is the error from make:
Please could you send help, I would like to carry on with this book.
I can see the first linked library is "-I.." could that be where the problem lies? I will carry on looking at the files and wait for your reply.
The text was updated successfully, but these errors were encountered: