[En-Nut-Discussion] config flashspace usage on SAM7X256

Timothy M. De Baillie debaillie at ciholas.com
Mon Jun 22 16:30:49 CEST 2009


Bernd Walter wrote:
> Hi Harald,
>  maybe this is of interest for you and others.
> I've reduced the code size about 50k by switching several Ethernut
> files to thumb.
> Thumb running from flash should be faster on SAM7X anyway.
> My own code was thumb already.
>
> os failed because of ISR or assembly code.
> dev and arch were not tried because of possible ISR code.
> Maybe I missed something.
> Others probably want it in a more configureable fashion.
>
> [1491]devel> svn diff contrib/ethernut-4.8.2/
> Index: contrib/ethernut-4.8.2/pro/Makefile
> ===================================================================
> --- contrib/ethernut-4.8.2/pro/Makefile (revision 4191)
> +++ contrib/ethernut-4.8.2/pro/Makefile (working copy)
> @@ -116,6 +116,7 @@
>  LIBDIR = $(top_blddir)/lib
>  include $(top_srcdir)/UserConf.mk
>  include $(top_srcdir)/Makedefs
> +CPFLAGS+= -mthumb
>  
>  SRCS =  dhcpc.c resolv.c httpd.c httpd_p.c rfctime.c httpopt.c ssi.c asp.c auth.c cgi.c dencode.c sntp.c syslog.c ftpd.c \
>         wins.c discover.c snmp.c snmp_agent.c snmp_api.c snmp_auth.c snmp_config.c snmp_mib.c asn1.c \
> Index: contrib/ethernut-4.8.2/fs/Makefile
> ===================================================================
> --- contrib/ethernut-4.8.2/fs/Makefile  (revision 4191)
> +++ contrib/ethernut-4.8.2/fs/Makefile  (working copy)
> @@ -90,6 +90,7 @@
>  LIBDIR = $(top_blddir)/lib
>  include $(top_srcdir)/UserConf.mk
>  include $(top_srcdir)/Makedefs
> +CPFLAGS+= -mthumb
>  
>  SRCS = pathops.c dirent.c fat.c uromfs.c pnutfs.c \
>         phatfs.c phatvol.c phatdir.c phatio.c \
> Index: contrib/ethernut-4.8.2/crt/Makefile
> ===================================================================
> --- contrib/ethernut-4.8.2/crt/Makefile (revision 4196)
> +++ contrib/ethernut-4.8.2/crt/Makefile (working copy)
> @@ -85,6 +85,7 @@
>  LIBDIR = $(top_blddir)/lib
>  include $(top_srcdir)/UserConf.mk
>  include $(top_srcdir)/Makedefs
> +CPFLAGS+= -mthumb
>  
>  SRCC =  close.c clrerr.c ioctl.c open.c getf.c read.c putf.c write.c fclose.c \
>          fcloseall.c fdopen.c feof.c ferror.c fflush.c filelength.c fileno.c flushall.c \
> Index: contrib/ethernut-4.8.2/gorp/Makefile
> ===================================================================
> --- contrib/ethernut-4.8.2/gorp/Makefile        (revision 4191)
> +++ contrib/ethernut-4.8.2/gorp/Makefile        (working copy)
> @@ -45,6 +45,7 @@
>  LIBDIR = $(top_blddir)/lib
>  include $(top_srcdir)/UserConf.mk
>  include $(top_srcdir)/Makedefs
> +CPFLAGS+= -mthumb
>  
>  SRCS =  base64/base64_decode.c \
>          base64/base64_encode.c \
> Index: contrib/ethernut-4.8.2/lua/Makefile
> ===================================================================
> --- contrib/ethernut-4.8.2/lua/Makefile (revision 4192)
> +++ contrib/ethernut-4.8.2/lua/Makefile (working copy)
> @@ -10,6 +10,7 @@
>  
>  include $(top_srcdir)/UserConf.mk
>  include $(top_srcdir)/Makedefs
> +CPFLAGS+= -mthumb
>  
>  SRCS = lapi.c ldo.c ldump.c ldebug.c lfunc.c lgc.c \
>         lmem.c lobject.c lopcodes.c lstate.c lstring.c ltable.c \
> Index: contrib/ethernut-4.8.2/net/Makefile
> ===================================================================
> --- contrib/ethernut-4.8.2/net/Makefile (revision 4191)
> +++ contrib/ethernut-4.8.2/net/Makefile (working copy)
> @@ -86,6 +86,7 @@
>  LIBDIR = $(top_blddir)/lib
>  include $(top_srcdir)/UserConf.mk
>  include $(top_srcdir)/Makedefs
> +CPFLAGS+= -mthumb
>  
>  SRC1 =  tcpsock.c tcpsm.c tcpin.c tcpout.c tcputil.c \
>         udpsock.c udpin.c udpout.c \
>
>   

Bernd,

I attempted to change the CRT to -mthumb. This is the error I received:

collect2: ld terminated with signal 11 [Segmentation fault]
arm-elf/bin/ld: 
/usr/local/gnuarm/lib/gcc/arm-elf/4.2.3/libgcc.a(_udivsi3.o)(__udivsi3): 
warning: interworking not enabled.
first occurrence: nutos/hubblt/libnutcrt.a(fread.o): thumb call to arm
arm-elf/bin/ld: BFD (GNU Binutils) 2.18 assertion fail elf32-arm.c:6532
nutos/hubblt/libnutcrt.a(fread.o): In function `fread':
fread.c:(.text+0x54): dangerous relocation: make: *** [hub.elf] Error 1


Do I have to install a thumb cross compiler or something? If so, where 
do I find such a beast.

I'm running Ubuntu 9.04.


Thanks,
Tim

-- 
Tim DeBaillie




More information about the En-Nut-Discussion mailing list