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

Ulrich Prinz ulrich.prinz at googlemail.com
Sun Dec 18 17:48:34 CET 2011


Hi Uwe,


Am 18.12.2011 13:44, schrieb Uwe Bonnes:
>>>>>> "Ulrich" == Ulrich Prinz <ulrich.prinz at googlemail.com> writes:
> 
>     Ulrich> Hi Uwe, I cannot follow...
> 
>     Ulrich> Here it works without a problem, so I simply set up a new
>     Ulrich> project on STM32F100RBT6 and compiled nut/os then uart
>     Ulrich> application. No problem.
> 
>     Ulrich> Then I saw that you wrote 'outside the branch' and I don't know
>     Ulrich> what you mean. But I checked Makevars.cm3-gcc and found
> 
> E.g. "stm32_can_app" is the application tree. 
> By "out of the branch", I meant e.g.
> ../ethernut/branches/stm32_can_app
> versus "in the branch"
> ../ethernut/branches/devnut_m3n/stm32_can_app

Ok...
What Nut/OS normally suggests is to have a project folder, let's call it
my_prj.

So you have

my_prj
my_prj/nut
my_prj/stm32_can_app
my_prj/stm32_can_bld

In this basic directory setup I normally work. Actually with testing for
several architecures my setup looks like this:

nutos/stm32_4.9.3
nutos/stm32_4.9.3/nut
nutos/stm32_4.9.3/nutapp_stm32_gcc
nutos/stm32_4.9.3/nutbld_stm32_gcc
nutos/stm32_4.9.3/nutapp_stm32_ecoss
nutos/stm32_4.9.3/nutbld_stm32_ecoss
nutos/stm32_4.9.3/nutapp_at91_gcc
nutos/stm32_4.9.3/nutbld_at91_gcc
nutos/stm32_4.9.3/nutapp_eir_gcc
nutos/stm32_4.9.3/nutbld_eir_gcc

...

What I then do is to switch to the desirged nutapp_xxx_yyy directory and
do a simple make clean all program or, if I modified the os itself, I
switch to nutbld_xxx_yyy and do a make clean all install.

That works perfectly.
> 
>     Ulrich> ARCH = cm3 TRGT = arm-none-eabi- MCFLAGS = -mcpu=$(MCU) -mthumb
>     Ulrich> -mlittle-endian -D__CORTEX__
> 
>     Ulrich> // CXXFLAGS_OPT = -Os -fno-delete-null-pointer-checks
>     Ulrich> -fno-exceptions -fno-rtti LDFLAGS = $(MCFLAGS) -g -nostartfiles
>     Ulrich> -T$(LDSCRIPT) -Wl,-Map=$(PROJ).map,--cref,--no-warn-mismatch
>     Ulrich> -L$(LIBDIR)
> 
>     Ulrich> where you can see in the last line that -T$(LDSCRIPT).
> 
>     Ulrich> That one should be build by the .nut files through
>     Ulrich> qnutconf. There is no filename separation from file-path in the
>     Ulrich> lua functions. And it is more or less a copy from existing
>     Ulrich> Makefiles...
> 
> I use the command line tool "nutconf" most of the time, as this fits better
> in a "make" environment than a gui tool.

I just moved from Windows to linux but as lots of people still develop
in Windows and so does my company do, I set priority to Windows. I hoped
not to mess up Linux environment. But there seems to be a problem  now,
let's fix it.

The path is seen from where make is started, what normally is the
projects base directory.
So sticking to the usart example it is my_project/nutapp_can_gcc/usart
Now with setting the path of the linker script, the relative dir is
../../ to get back to my_project/ and then get down to
nut/arch/cm3/ldscripts...

I check the Makefile sequence as normally it should be possible to set
an absolute path for that just by the abilities of make.
> 
>     Ulrich> Have you any suggestion how to solve that? And did you compile
>     Ulrich> in linux or windows?
> 
> Fix lua or work around that defienency? Will try to have a look.
> 
> I primary work on Linux. However I try to keep WIN interoperation in mind. 
> 
I will switch to that soon, I hope, but for now I can work more
efficient in Windows using Tortoise and WinMerge. I hope that they
finish the QT based cross version of WinMerge for Linux soon.

Best regards
Ulrich



More information about the En-Nut-Discussion mailing list