From 8ad0f6f31ccfc0e736a78eeb1acad9201c23b3ab Mon Sep 17 00:00:00 2001 From: Bogdan Marinescu Date: Sat, 2 Aug 2008 17:59:47 +0000 Subject: [PATCH] added option for arm/thumb mode --- src/platform/at91sam7x/conf.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/platform/at91sam7x/conf.py b/src/platform/at91sam7x/conf.py index f1c33e4e..84ba6dcf 100644 --- a/src/platform/at91sam7x/conf.py +++ b/src/platform/at91sam7x/conf.py @@ -1,6 +1,6 @@ # Configuration file for the AT91SAM7X(256/512) backend -cpumode = ARGUMENTS.get( 'cpumode', 'arm' ).lower() +cpumode = ARGUMENTS.get( 'cpumode', 'thumb' ).lower() specific_files = "board_cstartup.s board_lowlevel.c board_memories.c usart.c pmc.c pio.c platform.c tc.c" if cputype == 'at91sam7x256': @@ -11,15 +11,24 @@ else: print "Invalid AT91SAM7X CPU %s", cputype sys.exit( -1 ) +# Check CPU mode +if cpumode == 'arm': + modeflag = '' +elif cpumode == 'thumb': + modeflag = '-mthumb' +else: + print "Invalid CPU mode %s", cpumode + sys.exit( -1 ) + # Prepend with path specific_files = " ".join( [ "src/platform/%s/%s" % ( platform, f ) for f in specific_files.split() ] ) ldscript = "src/platform/%s/%s" % ( platform, ldscript ) # Toolset data tools[ 'at91sam7x' ] = {} -tools[ 'at91sam7x' ][ 'cccom' ] = "arm-elf-gcc -mcpu=arm7tdmi -mthumb %s %s -ffunction-sections -fdata-sections %s -Wall -c $SOURCE -o $TARGET" % ( opt, local_include, cdefs ) -tools[ 'at91sam7x' ][ 'linkcom' ] = "arm-elf-gcc -nostartfiles -nostdlib -mthumb -T %s -Wl,--gc-sections -Wl,-e,entry -Wl,--allow-multiple-definition -o $TARGET $SOURCES %s -lc -lgcc -lm" % ( ldscript, local_libs ) -tools[ 'at91sam7x' ][ 'ascom' ] = "arm-elf-gcc -x assembler-with-cpp %s -mcpu=arm7tdmi -mthumb %s -D__ASSEMBLY__ -Wall -c $SOURCE -o $TARGET" % ( local_include, cdefs ) +tools[ 'at91sam7x' ][ 'cccom' ] = "arm-elf-gcc -mcpu=arm7tdmi %s %s %s -ffunction-sections -fdata-sections %s -Wall -c $SOURCE -o $TARGET" % ( modeflag, opt, local_include, cdefs ) +tools[ 'at91sam7x' ][ 'linkcom' ] = "arm-elf-gcc -nostartfiles -nostdlib %s -T %s -Wl,--gc-sections -Wl,-e,entry -Wl,--allow-multiple-definition -o $TARGET $SOURCES %s -lc -lgcc -lm" % ( modeflag, ldscript, local_libs ) +tools[ 'at91sam7x' ][ 'ascom' ] = "arm-elf-gcc -x assembler-with-cpp %s -mcpu=arm7tdmi %s %s -D__ASSEMBLY__ -Wall -c $SOURCE -o $TARGET" % ( local_include, modeflag, cdefs ) # Programming function for LPC2888 def progfunc_at91sam7x( target, source, env ):