What I did is taking the /demos/ARMCM4-STM32F407-DISCOVERY project and modify the Makefile. I removed main.c from the CSRC variable. Then I added the following to the very bottom of the Makefile:
Code: Select all
chibios.a: $(OBJS)
arm-none-eabi-ar r $@ $^
This way I could create the chibios.a library by executing
Code: Select all
make chibios.a
To create the actual project, I added only the main.c to the CSRC variable and I also added the chibios.a library to the ULIBS variable. Then I ran the Makefile normally just by executing
Code: Select all
make
I sadly don't know where the problem is but I am quite sure that it has something to do with how I create the static library. I don't really see through all the Makefile magic inside of /os/ports/GCC/ARMCMx/rules.mk to find out what I'm doing wrong.
I attached the .map file of the working project and the one with the library. The .map file of the library project does show some difference to the other at the start address:
Code: Select all
startup
*(vectors)
constructors 0x08000000 0x0
0x08000000 PROVIDE (__init_array_start, .)
whilst the working one is
Code: Select all
startup 0x08000000 0x188
*(vectors)
vectors 0x08000000 0x188 build/obj/vectors.o
0x08000000 _vectors
Can anybody help?
~ Tectu