November 22, 2024, 07:30:47 PM

Problem makefile STM32-E407

Started by Veronica, September 23, 2014, 06:13:59 PM

Previous topic - Next topic

Veronica

Hi,
I use Olimex's OpenOCD Development Suite to develop a firmware for Olimex's demoboard STM32-E407.
I started with example project STM32-E407_blink_FLASH and I added lwIP libraries provided by ST.
For example I added Eth Driver (stm32f4x7_eth) in the same folder of StdPeriph_Driver and I changed the makefile but I have a problem.

On console the error is:
arm-none-eabi-gcc -Wall -fno-common -c -g -mcpu=cortex-m3 -mthumb -g -O0 -I./ -I./lib/ -I./lib/StdPeriph_Driver/inc/ -I./lib/StdPeriph_Driver/inc/../../../    -DTRACE_LEVEL=5 -o obj/stm32f4x7_eth.o ./lib/StdPeriph_Driver/src/stm32f4x7_eth.c          #mio_n
arm-none-eabi-gcc.exe: no input files
make: *** [obj/stm32f4x7_eth.o] Error 1

The changes in my makefile are commented with '#add'

# include folders
INCLUDES = -I./
INCLUDES += -I./lib/
INCLUDES += -I./lib/StdPeriph_Driver/inc/                  #add
INCLUDES += -I./lib/StdPeriph_Driver/inc/../../../                    #add
#INCLUDES += -I./lib/Ethernet_Driver/inc/         

# Objects built from C source files
C_OBJECTS = $(OBJ)/main.o
C_OBJECTS += $(OBJ)/system_stm32f4xx.o
C_OBJECTS += $(OBJ)/stm32f4xx_gpio.o
C_OBJECTS += $(OBJ)/stm32f4xx_rcc.o
C_OBJECTS += $(OBJ)/stm32f4xx_it.o
C_OBJECTS += $(OBJ)/misc.o                         #add         
C_OBJECTS += $(OBJ)/stm32f4xx_exti.o                     #add         
C_OBJECTS += $(OBJ)/stm32f4x7_eth.o                     #add   

$(C_OBJECTS): main.c system_stm32f4xx.c
   @ echo ".compiling"
   $(CC) $(CFLAGS) -o $(OBJ)/main.o main.c
   $(CC) $(CFLAGS) -o $(OBJ)/system_stm32f4xx.o system_stm32f4xx.c
   $(CC) $(CFLAGS) -o $(OBJ)/stm32f4xx_it.o stm32f4xx_it.c   
   @ echo ".compiling libraries"
   $(CC) $(CFLAGS) -o $(OBJ)/stm32f4xx_gpio.o $(LIBRARYSRC)/stm32f4xx_gpio.c
   $(CC) $(CFLAGS) -o $(OBJ)/stm32f4xx_rcc.o $(LIBRARYSRC)/stm32f4xx_rcc.c
   $(CC) $(CFLAGS) -o $(OBJ)/stm32f4xx_exti.o $(LIBRARYSRC)/stm32f4xx_exti.c   #add
   $(CC) $(CFLAGS) -o $(OBJ)/misc.o $(LIBRARYSRC)/misc.c            #add
   $(CC) $(CFLAGS) -o $(OBJ)/stm32f4x7_eth.o $(LIBRARYSRC)/stm32f4x7_eth.c      #add

What is the problem? I would appreciate any help here.

Regards,
Veronica

JohnS

I don't see anything (which may well just mean I missed it).  At least check you don't have anything odd about the file, such as non-printing chars or mixed line endings.

You might try changing the order of lines to see what happens.

John

Veronica

hi,
thanks for the advice but I had already tried to change the order of the lines and the compiling crashes at the same point.
stm32f4x7_eth.c not compile.
I tried to include other libraries that are to be used for communication ethernet, but the problem persists.
in command lines
$(CC) $(CFLAGS) -o $(OBJ)/stm32f4x7_eth.o $(LIBRARYSRC)/stm32f4x7_eth.c
I have to enter all the file .h that stm32f4x7_eth.c use?
is there a guide that explains how to create/modify the makefile?

Thanks

Veronica


JohnS

Makefiles go back many years and make was in UNIX so there are tutorials, manuals etc all over the net.

Maybe there's a bad char somewhere.  od -c and so on should show you.

About all else you could do is carefully zip all the files (except ones built by make, i.e. leave out obj etc) and hope someone will try it.  I don't have the board but do have a suitable toolchain...

John

Veronica

hi,
sorry but I don't know how to attach the file zip. There isn't a button.
:o

Veronica

JohnS

Interesting.  I never tried to upload a zip and I also can't see how.

Rename and upload as an image?  Put on dropbox (or wherever) and put the URL?  Those are allowed (but you have to choose Reply not Quick Reply I think).

John


JohnS

#7
OK, got it :)

For me it says:
./lib/StdPeriph_Driver/src/stm32f4x7_eth.c: No such file or directory

which is true because the file is in another place:
./lib/Ethernet_Driver/src/stm32f4x7_eth.c

---

When I copied it there (quick hack!) I get lots of compile errors which look like it needs to #include more things.

John

Veronica

sorry,
I changed the path of file for testing and I forgot to correct it.
I edit the Makefile with correct path and I upload the zip file in dropbox.

sorry for the inconvenience :-[

Regards

Veronica

JohnS

No worries but as I posted it looks to be missing one or more #include

Probably needs stdint.h at least as it needs such as uint32_t -- I get errors like
./lib/Ethernet_Driver/inc/stm32f4x7_eth.h:58:3: error: unknown type name 'uint32_t'

John

Veronica

Hi,
I add stdint.h library, but I have other errors.
I update the project in dropbox folder.
I suppose there is a problem in stm32f4xx.h file: I can't open library file core_cm4.h, system_stm32f4xx.h and stdint.h with F3 button and I don't know why.
If I try to include this library in another file (for example main.h) I can open them with F3.
What is the problem?
why I don't see the same errors you have in Eclipse's console?



JohnS

I seem to be debugging beginner C problems and sorry I am out of time now.

I am not using Eclipse.

John