[En-Nut-Discussion] devnut_m3n and possibly others: Locating the Linker script

Ulrich Prinz ulrich.prinz at googlemail.com
Sat Dec 17 23:49:13 CET 2011


Hi Uwe,

I cannot follow...

Here it works without a problem, so I simply set up a new project on
STM32F100RBT6 and compiled nut/os then uart application. No problem.

Then I saw that you wrote 'outside the branch' and I don't know what you
mean. But I checked Makevars.cm3-gcc and found

ARCH       = cm3
TRGT       = arm-none-eabi-
MCFLAGS    = -mcpu=$(MCU) -mthumb -mlittle-endian -D__CORTEX__

// CXXFLAGS_OPT = -Os -fno-delete-null-pointer-checks -fno-exceptions
-fno-rtti
LDFLAGS   = $(MCFLAGS) -g -nostartfiles -T$(LDSCRIPT)
-Wl,-Map=$(PROJ).map,--cref,--no-warn-mismatch -L$(LIBDIR)

where you can see in the last line that -T$(LDSCRIPT).

That one should be build by the .nut files through qnutconf. There is no
filename separation from file-path in the lua functions. And it is more
or less a copy from existing Makefiles...

Have you any suggestion how to solve that? And did you compile in linux
or windows?

Best regards
Ulrich

Am 07.12.2011 18:32, schrieb Uwe Bonnes:
> Hello,
> 
> compiling the examples for the devnut_m3n branch outside the branch doesn't
> pick up the common stm32f10x_flash.ld linker script:
> 
> arm-none-eabi-gcc caltime.o -mcpu=cortex-m3 -mthumb -mlittle-endian
> -D__CORTEX__ -nostartfiles
> -T../../devnut_m3n/nut/arch/cm3/ldscripts/stm32f107xC_flash.ld
> -Wl,-Map=caltime.map,--cref,--gc-sections -L../.././stm32_can/lib
> -Wl,--start-group ../.././stm32_can/lib/nutinit.o -lnutpro -lnutgorp
> -lnutcrt -lnutos -lnutdev -lnutarch  -Wl,--end-group -o caltime.elf 
> /opt/spare/bon/stm/yagarto/install/bin/../lib/gcc/arm-none-eabi/4.6.0\
> /../../../../arm-none-eabi/bin/ld:
> cannot open linker script file stm32f10x_flash.ld: No such file or directory 
> 
> If I give a search path on the command line, all is fine:
> 
> arm-none-eabi-gcc caltime.o -mcpu=cortex-m3 -mthumb -mlittle-endian
> -D__CORTEX__ -nostartfiles -L../../devnut_m3n/nut/arch/cm3/ldscripts/
> -Tstm32f107xC_flash.ld -Wl,-Map=caltime.map,--cref,--gc-sections
> -L../.././stm32_can/lib -Wl,--start-group ../.././stm32_can/lib/nutinit.o
> -lnutpro -lnutgorp -lnutcrt -lnutos -lnutdev -lnutarch  -Wl,--end-group -o
> caltime.elf
> 
> To repeat:
> Replaceing
> -T../../devnut_m3n/nut/arch/cm3/ldscripts/stm32f107xC_flash.ld
> with 
> -L../../devnut_m3n/nut/arch/cm3/ldscripts/ -Tstm32f107xC_flash.ld
> 
> helps.
> 
> Is this something that others need too?


More information about the En-Nut-Discussion mailing list