[En-Nut-Discussion] devnut_m3n branch

uprinz uprinz2 at netscape.net
Wed Apr 27 18:18:38 CEST 2011

Hi Uwe,

Uwe Bonnes wrote:
> I am getting lost...
> What I did:
> Compile various gcc for arm-eabi, e.g. from crosstool-NG. 
> Link ~/bin/arm-gcc tp the resulting gcc-xxx-eabi-yyy binary
> nut/tools/nutconf/nutconfigure -bcomstick -cnut/conf/stm32-comStick.conf \
>                                -lcomstick -marm-gcc create-buildtree
> cd comstick
> make
> make -C arch
> make[1]: Entering directory
> `/opt/spare/bon/ethernut1/ethernut_svn1/branches/devnut_m3n/comstick/arch'
>   [CC] ../.././nut/arch/cm3/cmsis/ostimer_cortex.c
> ../.././nut/arch/cm3/cmsis/ostimer_cortex.c:1: error: target CPU does not
> support ARM mode
> make[1]: *** [cm3/cmsis/ostimer_cortex.o] Fehler 1
> make[1]: Leaving directory
> `/opt/spare/bon/ethernut1/ethernut_svn1/branches/devnut_m3n/comstick/arch'
> make: *** [all] Fehler 2

Ups... I am now lost too. 
My make files calls gcc with the following options:
-mcpu=cortex-m3 -mthumb -mlittle-endian -D__CORTEX__ -ffunction-sections
-fdata-sections -fomit-frame-pointer -mfix-cortex-m3-ldrd -Os -Wall
-Wstrict-prototypes -Wa,-a=startmsg  -DSTM32F10X_MD...

The important part should be:
-mcpu=cortex-m3 -mthumb -mlittle-endian -D__CORTEX__ -ffunction-sections
-fdata-sections -fomit-frame-pointer -mfix-cortex-m3-ldrd

Uwe Bonnes wrote:
> Changing 
> -CFLAGS_MCU   = $(MCFLAGS) -mthumb-interwork
> +CFLAGS_MCU   = $(MCFLAGS) -mthumb
> now results in
> ../.././nut/include/arch/arm/irqreg.h:277: warning: #warning "No MCU
> defined"
Looks like linux is pulling other makefiles than I modified. With my ones
the compiler uses -mthumb.
You should use the cm3-gcc line of make* as the arm-gcc line has definitely
the wrong settings.

As I don't have linux development running, I clearly missed to fully develop
the default configuration for CortexM3. As part of that I missed to
predefine a default chip. With nutconf the conf-files will preset the right
options and nutconf will build the needed include/cfg/*.h files.

The problem was, that I found a way to possibly make the whole big family of
STM32F10x chips available in Nut/OS but that needs some carefully selected

What you ma do is to get nutconf, share your working directory via samba,
load one of the STM32 configs and let the nutconf just create the .h files.
So klick on Build, click OK for the first appearing dialog and then abort
for the next one.

Change to linux and run the make in the build directory.
If you have graphical access to the linux, install QT, compile qnutconf and
let this one run.

I 99% of my time developed on STM3210E-EVAL and STM3210C-EVAL kits. I used
the COMsticks only very little. If you look at the date of the .conf files
you see, what happened. I have a couple of these neat sticks so I can put
one to my station and update the configuration for you.

Uwe Bonnes wrote:
> arm-gcc -v
> Using built-in specs.
> Target: arm-unknown-eabi
> ...
> gcc version 4.4.6 (crosstool-NG-hg_default at 2410_3954053fb678)

So far this looks fine. The only thing that makes a newer version of gcc
needed is the flag -mfix-cortex-m3-ldrd. I have no reference when this flag
was introduced. But I will save you a lot of headache. 

Uwe Bonnes wrote:
> Any hints what I do wrong? 

You just came in with linux far to early. I never thought about doing the
development under linux completely. I mean, I have linux on my server and
develop under linux too, but not with nutos till today.

Uwe Bonnes wrote:
> A also have  a Win machine. How do I start STM32 development there?

Hmm... If you can get qnutconf running on your linux, you possibly don't
need to go the windows way as all the needed *.h files will be created like
with windows. 
If you like to try the windows way, install a minimal cygwin (add minimal
binutils and make) and yagarto.
puth cygwin/bin and yagarto/bin in your path and your done with the setup.
Get a precompiled nutconf or qnutconf, load a config and let the things
roll. That's all.

With windows the STM32 setup works astonishingly flawless. Our STM32/NutOS
based systems will go into production in the next two month.


Best regards
View this message in context: http://old.nabble.com/devnut_m3n-branch-tp31479869p31488883.html
Sent from the MicroControllers - Ethernut mailing list archive at Nabble.com.

More information about the En-Nut-Discussion mailing list