]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
- Added new Makefile.linux in bootrom directory
authoredouard@lafargue.name <edouard@lafargue.name@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Sat, 25 Apr 2009 21:19:59 +0000 (21:19 +0000)
committeredouard@lafargue.name <edouard@lafargue.name@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Sat, 25 Apr 2009 21:19:59 +0000 (21:19 +0000)
- Cleaned up Makefile.linux in armsrc directory
- Added Linux toolchain build script in tools directory
- Made LCD support optional (disabled by default) in armsrc
- Small formatting changes

12 files changed:
.cdtproject [new file with mode: 0644]
.cproject [new file with mode: 0644]
.project [new file with mode: 0644]
.settings/org.eclipse.cdt.core.prefs [new file with mode: 0644]
armsrc/Makefile
armsrc/Makefile.linux
armsrc/appmain.c
bootrom/Makefile.linux [new file with mode: 0644]
include/usb_cmd.h
tools/at91sam7s256-armusbocd-flash-program.cfg [new file with mode: 0644]
tools/at91sam7s256-armusbocd.cfg [new file with mode: 0644]
tools/install-gnuarm4.sh [new file with mode: 0755]

diff --git a/.cdtproject b/.cdtproject
new file mode 100644 (file)
index 0000000..07ab80b
--- /dev/null
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.make.core.make">
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="scannerConfiguration">
+<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
+<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+<buildOutputProvider>
+<openAction enabled="false" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="makefileGenerator">
+<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+<parser enabled="false"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="false" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="false"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="false" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="false"/>
+</scannerInfoProvider>
+</profile>
+</item>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</item>
+<item id="org.eclipse.cdt.make.core.buildtargets">
+<buildTargets>
+<target name="all" path="linux" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
+<buildCommand>make</buildCommand>
+<buildArguments/>
+<buildTarget>all</buildTarget>
+<stopOnError>false</stopOnError>
+<useDefaultCommand>true</useDefaultCommand>
+</target>
+<target name="all" path="armsrc" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
+<buildCommand>make</buildCommand>
+<buildArguments/>
+<buildTarget>all</buildTarget>
+<stopOnError>false</stopOnError>
+<useDefaultCommand>true</useDefaultCommand>
+</target>
+<target name="Linux" path="armsrc" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
+<buildCommand>make</buildCommand>
+<buildArguments>-f Makefile.linux</buildArguments>
+<buildTarget>all</buildTarget>
+<stopOnError>false</stopOnError>
+<useDefaultCommand>false</useDefaultCommand>
+</target>
+<target name="Linux clean" path="armsrc" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
+<buildCommand>make</buildCommand>
+<buildArguments>-f Makefile.linux</buildArguments>
+<buildTarget>clean</buildTarget>
+<stopOnError>false</stopOnError>
+<useDefaultCommand>false</useDefaultCommand>
+</target>
+</buildTargets>
+</item>
+</data>
+</cdtproject>
diff --git a/.cproject b/.cproject
new file mode 100644 (file)
index 0000000..c157cc5
--- /dev/null
+++ b/.cproject
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?>
+
+<cproject>
+<storageModule moduleId="org.eclipse.cdt.core.settings">
+<cconfiguration id="converted.config.1059849428">
+<storageModule moduleId="scannerConfiguration">
+<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
+<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+<buildOutputProvider>
+<openAction enabled="false" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="makefileGenerator">
+<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+<parser enabled="false"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="false" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="false"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="false" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="false"/>
+</scannerInfoProvider>
+</profile>
+</storageModule>
+<storageModule moduleId="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
+</storageModule>
+<storageModule buildSystemId="org.eclipse.cdt.core.defaultConfigDataProvider" id="converted.config.1059849428" moduleId="org.eclipse.cdt.core.settings" name="convertedConfig">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
+<buildTargets>
+<target name="all" path="bootrom" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
+<buildCommand>make</buildCommand>
+<buildArguments>-f Makefile.linux</buildArguments>
+<buildTarget>all</buildTarget>
+<stopOnError>false</stopOnError>
+<useDefaultCommand>false</useDefaultCommand>
+<runAllBuilders>true</runAllBuilders>
+</target>
+<target name="Linux clean" path="bootrom" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
+<buildCommand>make</buildCommand>
+<buildArguments>-f Makefile.linux</buildArguments>
+<buildTarget>clean</buildTarget>
+<stopOnError>false</stopOnError>
+<useDefaultCommand>false</useDefaultCommand>
+<runAllBuilders>true</runAllBuilders>
+</target>
+<target name="all" path="linux" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
+<buildCommand>make</buildCommand>
+<buildArguments/>
+<buildTarget>all</buildTarget>
+<stopOnError>false</stopOnError>
+<useDefaultCommand>true</useDefaultCommand>
+<runAllBuilders>true</runAllBuilders>
+</target>
+<target name="Clean" path="linux" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
+<buildCommand>make</buildCommand>
+<buildArguments/>
+<buildTarget>clean</buildTarget>
+<stopOnError>false</stopOnError>
+<useDefaultCommand>true</useDefaultCommand>
+<runAllBuilders>true</runAllBuilders>
+</target>
+<target name="Linux" path="armsrc" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
+<buildCommand>make</buildCommand>
+<buildArguments>-f Makefile.linux</buildArguments>
+<buildTarget>all</buildTarget>
+<stopOnError>false</stopOnError>
+<useDefaultCommand>false</useDefaultCommand>
+<runAllBuilders>true</runAllBuilders>
+</target>
+<target name="Linux clean" path="armsrc" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
+<buildCommand>make</buildCommand>
+<buildArguments>-f Makefile.linux</buildArguments>
+<buildTarget>clean</buildTarget>
+<stopOnError>false</stopOnError>
+<useDefaultCommand>false</useDefaultCommand>
+<runAllBuilders>true</runAllBuilders>
+</target>
+</buildTargets>
+</storageModule>
+</cconfiguration>
+</storageModule>
+</cproject>
diff --git a/.project b/.project
new file mode 100644 (file)
index 0000000..0ad67cd
--- /dev/null
+++ b/.project
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>Proxmark3-SVN</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.cdt.make.core.makeBuilder</name>
+                       <triggers>clean,full,incremental,</triggers>
+                       <arguments>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.append_environment</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.stopOnError</key>
+                                       <value>false</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.build.command</key>
+                                       <value>make</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.build.target.inc</key>
+                                       <value>all</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.build.arguments</key>
+                                       <value></value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.environment</key>
+                                       <value>PATH=/usr/local/new/gnuarm-4.3.0/bin:/home/lafargue/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games|</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+                                       <value>false</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.build.target.auto</key>
+                                       <value>all</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.build.target.clean</key>
+                                       <value>clean</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.build.location</key>
+                                       <value></value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.core.errorOutputParser</key>
+                                       <value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
+                               </dictionary>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.cdt.core.cnature</nature>
+               <nature>org.eclipse.cdt.make.core.makeNature</nature>
+               <nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
+       </natures>
+</projectDescription>
diff --git a/.settings/org.eclipse.cdt.core.prefs b/.settings/org.eclipse.cdt.core.prefs
new file mode 100644 (file)
index 0000000..a006178
--- /dev/null
@@ -0,0 +1,3 @@
+#Tue Apr 21 17:19:37 CEST 2009
+eclipse.preferences.version=1
+indexerId=org.eclipse.cdt.core.fastIndexer
index e8db3b31f9a8e5d39f64040446bc9aef6a88583a..574e4f0813c2265b182022e5c82dbd0744d47e6b 100644 (file)
@@ -10,17 +10,20 @@ INCLUDE = -I../include
 INCLUDES = ../include/proxmark3.h ../include/at91sam7s128.h ../include/config_gpio.h ../include/usb_cmd.h apps.h\r
 LIB = "..\..\devkitARM\lib\gcc\arm-elf\4.1.0\interwork"\r
 \r
+# Add the "-DWITH_LCD" flag in CLFAGS to add support for LCD\r
+# and add OBJLCD to OBJ too\r
 CFLAGS = -O6 -c $(INCLUDE) -Wall\r
 \r
+OBJLCD = $(OBJDIR)/fonts.o \\r
+               $(OBJDIR)/LCD.o\r
+\r
 OBJ =  $(OBJDIR)/start.o \\r
                $(OBJDIR)/appmain.o \\r
                $(OBJDIR)/fpga.o \\r
                $(OBJDIR)/iso14443.o \\r
                $(OBJDIR)/iso14443a.o \\r
                $(OBJDIR)/iso15693.o \\r
-               $(OBJDIR)/util.o \\r
-               $(OBJDIR)/fonts.o \\r
-               $(OBJDIR)/LCD.o\r
+               $(OBJDIR)/util.o\r
 \r
 OBJFPGA = \\r
                $(OBJDIR)/fpgaimg.o\r
index 0f2d0d4eec7b07404667f2b52feea76bd370c2e8..98c9c38609a609af467709c9b0c458b467e33986 100644 (file)
@@ -1,67 +1,77 @@
 # This makefile needs to be edited to reflect the location
-# of your own arm-elf-gcc installation (LIB variable)
+# of your own arm-elf-gcc toolchain (LIB variable)
 
 CC     = arm-elf-gcc
 AS     = arm-elf-as
 LD     = arm-elf-ld
 OBJCOPY = arm-elf-objcopy
 
-INCLUDE = -I../include
-
-INCLUDES = ../include/proxmark3.h ../include/at91sam7s128.h ../include/config_gpio.h ../include/usb_cmd.h apps.h
+# Indicate where your gnuarm toolchain libgcc.a library is located:
 LIB = /usr/local/new/gnuarm-4.3.0/lib/gcc/arm-elf/4.3.0/interwork
 
+# Add -DWITH_LCD to EXTRA_CFLAGS if you want support for LCD
+# in your firmware (add OBJLCD to OBJ too!)
+#EXTRA_CFLAGS = -DWITH_LCD
+EXTRA_CFLAGS =
+
+### You should not need to edit below this line
+
+INCLUDE = -I../include
+INCLUDES = ../include/proxmark3.h ../include/at91sam7s128.h ../include/config_gpio.h ../include/usb_cmd.h apps.h
 CFLAGS_COMMON = -O6 -c $(INCLUDE) -Wall  -mthumb-interwork
-CFLAGS = $(CFLAGS_COMMON) -mthumb
+CFLAGS = $(CFLAGS_COMMON) $(EXTRA_CFLAGS) -mthumb
 
 
 OBJDIR = obj
-OBJ =  start.o \
-               appmain.o \
-               fpga.o \
-               iso15693.o \
-               iso14443.o \
-               util.o\
-               LCD.o\
-               fonts.o
 
-OBJFAST =      iso14443a.o
+OBJLCD = $(OBJDIR)/LCD.o\
+                $(OBJDIR)/fonts.o
+
+OBJ =  $(OBJDIR)/start.o \
+               $(OBJDIR)/appmain.o \
+               $(OBJDIR)/fpga.o \
+               $(OBJDIR)/iso15693.o \
+               $(OBJDIR)/iso14443.o \
+               $(OBJDIR)/util.o
 
-OBJFPGA =      fpgaimg.o
 
-OBJCOMMON =    usb.o
+OBJFAST =      $(OBJDIR)/iso14443a.o
 
+OBJFPGA =      $(OBJDIR)/fpgaimg.o
+
+OBJCOMMON =    $(OBJDIR)/usb.o
 
 all: osimage.s19 fpgaimage.s19 fullimage.s19
 
 fpgaimage.s19: $(OBJFPGA)
        @echo fpgaimage.s19
-       $(LD) -g -Tldscript-fpga -o fpgaimage.elf $(patsubst %.o, obj/%.o, $^)
-       $(OBJCOPY) -Osrec --srec-forceS3 fpgaimage.elf fpgaimage.s19
+       $(LD) -g -Tldscript-fpga -o $(OBJDIR)/fpgaimage.elf $^
+       $(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)/fpgaimage.elf fpgaimage.s19
 
 osimage.s19: $(OBJ) $(OBJFAST) $(OBJCOMMON)
        @echo osimage.s19
-       $(LD) -g -Tldscript -o osimage.elf $(patsubst %.o, obj/%.o, $^) $(LIB)/libgcc.a
-       $(OBJCOPY) -Osrec --srec-forceS3 osimage.elf osimage.s19
+       $(LD) -g -Tldscript -o $(OBJDIR)/osimage.elf $^ $(LIB)/libgcc.a
+       $(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)/osimage.elf osimage.s19
 
 fullimage.s19: $(OBJ) $(OBJFAST) $(OBJCOMMON) $(OBJFAST) $(OBJFPGA)
        @echo fullimage.s19
-       $(LD) -g -Tldscript-full -o fullimage.elf $(patsubst %.o, obj/%.o, $^)  $(LIB)/libgcc.a
-       $(OBJCOPY) -Osrec --srec-forceS3 fullimage.elf fullimage.s19
-
-$(OBJ): %.o : %.c
-       $(CC) $(CFLAGS) $< -o $(OBJDIR)/$@
+       $(LD) -g -Tldscript-full -o $(OBJDIR)/fullimage.elf $^  $(LIB)/libgcc.a
+       $(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)/fullimage.elf fullimage.s19
 
-$(OBJFPGA): %.o : %.c
-       $(CC) $(CFLAGS) $< -o $(OBJDIR)/$@
+# Directives to put the *.o in the OBJDIR directory:
+$(OBJ): $(OBJDIR)/%.o : %.c
+       $(CC) $(CFLAGS) $< -o $@
 
+$(OBJFPGA): $(OBJDIR)/%.o : %.c
+       $(CC) $(CFLAGS) $< -o $@
 
-$(OBJFAST): %.o : %.c
-       $(CC) $(CFLAGS_COMMON) $< -o $(OBJDIR)/$@
+$(OBJFAST): $(OBJDIR)/%.o : %.c
+       $(CC) $(CFLAGS_COMMON) $< -o $@
        
-$(OBJCOMMON): ../common/usb.c
-       $(CC) $(CFLAGS) ../common/usb.c -o $(OBJDIR)/usb.o
+$(OBJCOMMON): $(OBJDIR)/%.o : ../common/%.c
+       $(CC) $(CFLAGS) $< -o $@
 
+# Those do not work on the current firmware !
 flash-fpga: fpgaimage.s19
        ../linux/flasher fpga fpgaimage.s19
 
@@ -78,6 +88,6 @@ jtag-flash: osimage.s19
        ../../OpenOCD/openocd -c "halt; flash write_image osimage.s19 0x00100000; halt; reset; resume; poll; exit"
 
 clean:
-       rm -f $(OBJDIR)/*.o *.elf *.s19
+       rm -f $(OBJDIR)/*.o $(OBJDIR)/*.elf *.s19
 
 .PHONY: all clean
index 372bcf68fd53d54ce2fbf0227638bcb49975f0c2..a0bb00d35039cd69a83e03a55566e7cc7fd7b036 100644 (file)
@@ -4,10 +4,14 @@
 // Jonathan Westhues, Mar 2006\r
 // Edits by Gerhard de Koning Gans, Sep 2007 (##)\r
 //-----------------------------------------------------------------------------\r
+\r
+\r
 #include <proxmark3.h>\r
 #include "apps.h"\r
 #include "fonts.h"\r
+#ifdef WITH_LCD\r
 #include "LCD.h"\r
+#endif\r
 \r
 // The large multi-purpose buffer, typically used to hold A/D samples,\r
 // maybe pre-processed in some way.\r
@@ -682,11 +686,11 @@ void UsbPacketReceived(BYTE *packet, int len)
                        SimulateTagLowFrequency(c->ext1);\r
                        LED_A_OFF();\r
                        break;\r
-\r
+#ifdef WITH_LCD\r
                case CMD_LCD_RESET:\r
                        LCDReset();\r
                        break;\r
-\r
+#endif\r
                case CMD_SWEEP_LF:\r
                        SweepLFrange();\r
                        break;\r
@@ -694,11 +698,11 @@ void UsbPacketReceived(BYTE *packet, int len)
                case CMD_SET_LF_DIVISOR:\r
                        FpgaSendCommand(FPGA_CMD_SET_DIVISOR, c->ext1);\r
                        break;\r
-\r
+#ifdef WITH_LCD\r
                case CMD_LCD:\r
                        LCDSend(c->ext1);\r
                        break;\r
-\r
+#endif\r
         case CMD_SETUP_WRITE:\r
                case CMD_FINISH_WRITE:\r
                        USB_D_PLUS_PULLUP_OFF();\r
@@ -745,6 +749,8 @@ void AppMain(void)
        // Load the FPGA image, which we have stored in our flash.\r
        FpgaDownloadAndGo();\r
 \r
+#ifdef WITH_LCD\r
+\r
        LCDInit();\r
 \r
        // test text on different colored backgrounds\r
@@ -767,6 +773,8 @@ void AppMain(void)
        LCDFill(0, 1+8*14, 132, 8, CYAN);\r
        LCDFill(0, 1+8*15, 132, 8, MAGENTA);\r
 \r
+#endif\r
+\r
        for(;;) {\r
                UsbPoll(FALSE);\r
                WDT_HIT();\r
diff --git a/bootrom/Makefile.linux b/bootrom/Makefile.linux
new file mode 100644 (file)
index 0000000..d558cc7
--- /dev/null
@@ -0,0 +1,65 @@
+CC       = arm-elf-gcc
+AS       = arm-elf-as
+LD       = arm-elf-ld
+OBJCOPY = arm-elf-objcopy
+
+OBJDIR = obj
+
+INCLUDE = -I../include
+
+INCLUDES = ../include/proxmark3.h ../include/at91sam7s128.h ../include/config_gpio.h ../include/usb_cmd.h
+
+CFLAGS  = -g -c $(INCLUDE) -Wall
+
+OBJJTAG = $(OBJDIR)/bootrom.o $(OBJDIR)/ram-reset.o $(OBJDIR)/usb.o
+
+OBJFLASH = $(OBJDIR)/flash-reset.o $(OBJDIR)/fromflash.o
+
+all: bootrom.s19 bootrom-forjtag-swapped.s19
+
+bootrom-merged.s19: bootrom.s19 bootrom-forjtag.s19
+       perl ../tools/merge-srec.pl bootrom.s19 bootrom-forjtag.s19 > bootrom-merged.s19
+
+bootrom-forjtag-swapped.s19: bootrom-merged.s19
+       perl ../tools/srecswap.pl bootrom-forjtag.s19 > bootrom-forjtag-swapped.s19
+
+bootrom.s19: $(OBJFLASH)
+       @echo bootrom.s19
+       $(LD) -g -Tldscript-flash --oformat elf32-littlearm -o $(OBJDIR)/bootrom.elf $(OBJFLASH)
+       $(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)/bootrom.elf bootrom.s19
+
+bootrom-forjtag.s19: $(OBJJTAG)
+       @echo bootrom-forjtag.s19
+       $(LD) -g -Tldscript-ram-jtag --oformat elf32-littlearm -o $(OBJDIR)/bootrom-forjtag.elf $(OBJJTAG)
+       $(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)/bootrom-forjtag.elf bootrom-forjtag.s19
+
+$(OBJDIR)/bootrom.o: bootrom.c $(INCLUDES)
+       @echo $@
+       $(CC) $(CFLAGS) -mthumb -mthumb-interwork $< -o $@
+
+$(OBJDIR)/fromflash.o: fromflash.c $(INCLUDES)
+       @echo $@
+       $(CC) $(CFLAGS) -mthumb -mthumb-interwork $< -o $@
+
+$(OBJDIR)/usb.o: ../common/usb.c $(INCLUDES)
+       @echo $@
+       $(CC) $(CFLAGS) -mthumb -mthumb-interwork $< -o $@
+
+$(OBJDIR)/ram-reset.o: ram-reset.s
+       @echo $@
+       $(CC) $(CFLAGS) -mthumb-interwork -o $@ $<
+
+$(OBJDIR)/flash-reset.o: flash-reset.s
+       @echo $@
+       $(CC) $(CFLAGS) -mthumb-interwork -o $@ $<
+
+# Those do not work in this Firmware distribution!
+flash: bootrom-merged.s19
+       ../linux/flasher bootrom bootrom-merged.s19
+
+jtag-flash: bootrom-merged.s19
+       ../../OpenOCD/openocd -c "halt; flash write_image bootrom-merged.s19 0x00100000; halt; reset; resume; poll; exit"
+
+clean:
+       rm -f $(OBJDIR)/*.o $(OBJDIR)/*.elf *.s19
+
index 54141f795734ca787f8784e2312f4a185565d02a..af822c323b7d44007dcad5d5d7eddfea33759157 100644 (file)
@@ -51,7 +51,7 @@ typedef struct {
 #define CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_15693          0x0300\r
 #define CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_14443          0x0301\r
 #define CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_14443_SIM      0x0302
-#define CMD_READ_SRI512_TAG                            0x0303\r
+#define CMD_READ_SRI512_TAG                                                    0x0303\r
 #define CMD_READER_ISO_15693                                           0x0310  // ## New command to act like a 15693 reader - greg\r
 #define CMD_SIMTAG_ISO_15693                                           0x0311  // ## New command to act like a 15693 reader - greg\r
 \r
diff --git a/tools/at91sam7s256-armusbocd-flash-program.cfg b/tools/at91sam7s256-armusbocd-flash-program.cfg
new file mode 100644 (file)
index 0000000..2dce014
--- /dev/null
@@ -0,0 +1,39 @@
+#define our ports\r
+telnet_port 4444\r
+gdb_port 3333\r
+\r
+#commands specific to the Olimex ARM-USB-OCD Dongle\r
+interface ft2232\r
+ft2232_device_desc "Olimex OpenOCD JTAG"\r
+ft2232_layout "olimex-jtag"\r
+ft2232_vid_pid 0x15BA 0x0003\r
+jtag_speed 2\r
+jtag_nsrst_delay 200\r
+jtag_ntrst_delay 200\r
+\r
+#reset_config <signals> [combination] [trst_type] [srst_type]\r
+reset_config srst_only srst_pulls_trst\r
+\r
+#jtag_device <IR length> <IR capture> <IR mask> <IDCODE instruction>\r
+jtag_device 4 0x1 0xf 0xe\r
+\r
+#daemon_startup <'attach'|'reset'>\r
+daemon_startup reset\r
+\r
+#target <type> <endianess> <reset_mode> <jtag#> [variant]\r
+target arm7tdmi little run_and_init 0 arm7tdmi_r4\r
+\r
+#run_and_halt_time <target#> <time_in_ms>\r
+run_and_halt_time 0 30\r
+\r
+# commands below are specific to AT91sam7 Flash Programming\r
+# ---------------------------------------------------------\r
+\r
+#target_script specifies the flash programming script file\r
+target_script 0 reset script.ocd\r
+\r
+#working_area <target#> <address> <size> <'backup'|'nobackup'>\r
+working_area 0 0x40000000 0x4000 nobackup\r
+\r
+#flash bank at91sam7 0 0 0 0 <target#>\r
+flash bank at91sam7 0 0 0 0 0\r
diff --git a/tools/at91sam7s256-armusbocd.cfg b/tools/at91sam7s256-armusbocd.cfg
new file mode 100644 (file)
index 0000000..3d0bdd2
--- /dev/null
@@ -0,0 +1,29 @@
+#define our ports
+telnet_port 4444
+gdb_port 3333
+
+#commands specific to the Olimex arm-usb-ocd
+interface ft2232
+# Be careful to reflect the exact description here:
+ft2232_device_desc "Olimex OpenOCD JTAG"
+ft2232_layout "olimex-jtag"
+ft2232_vid_pid 0x15BA 0x0003
+jtag_speed 2
+jtag_nsrst_delay 200
+jtag_ntrst_delay 200
+
+#reset_config <signals> [combination] [trst_type] [srst_type]
+reset_config srst_only srst_pulls_trst
+
+#jtag_device <IR length> <IR capture> <IR mask> <IDCODE instruction>
+jtag_device 4 0x1 0xf 0xe
+
+#daemon_startup <'attach'|'reset'>
+daemon_startup reset
+
+#target <type> <endianess> <reset_mode> <jtag#> [variant]
+target arm7tdmi little run_and_init 0 arm7tdmi_r4
+
+#run_and_halt_time <target#> <time_in_ms>
+run_and_halt_time 0 30
+
diff --git a/tools/install-gnuarm4.sh b/tools/install-gnuarm4.sh
new file mode 100755 (executable)
index 0000000..cf8c494
--- /dev/null
@@ -0,0 +1,198 @@
+#!/bin/bash
+
+# Some things for you to configure
+
+# Where you want to install the tools
+DESTDIR=/usr/local/gnuarm-4.3.0
+
+# Where do you want to build the tools. This is where the log files
+# will be written (which you can monitor with 'tail' during compilation).
+# You can delete this directory after everything is done.
+SRCDIR="/home/lafargue/Documents/Hobbies/RFID/Toolchain/linux"
+
+# Where to get each of the toolchain components
+BINUTILS=ftp://ftp.gnu.org/gnu/binutils/binutils-2.18.tar.bz2
+GCCCORE=ftp://ftp.gnu.org/gnu/gcc/gcc-4.3.0/gcc-core-4.3.0.tar.bz2
+GPP=ftp://ftp.gnu.org/gnu/gcc/gcc-4.3.0/gcc-g++-4.3.0.tar.bz2
+NEWLIB=ftp://sources.redhat.com/pub/newlib/newlib-1.16.0.tar.gz
+#INSIGHT=ftp://sourceware.org/pub/insight/releases/insight-6.8.tar.bz2
+INSIGHT=http://mirrors.kernel.org/sources.redhat.com/insight/releases/insight-6.8.tar.bz2
+#INSIGHT=http://www.mirrorservice.org/sites/sources.redhat.com/pub/insight/releases/insight-6.8.tar.bz2
+
+# Common configuration options (i.e., things to pass to 'configure')
+COMMON_CFG="--enable-interwork --target=arm-elf --program-prefix=arm-elf- --prefix=${DESTDIR} --disable-werror --enable-languages=c,c++ --enable-multilib --disable-shared"
+
+# Extra configuration options for each toolchain component
+BINUTILS_CFG=
+GCCCORE_CFG="--disable-libssp --disable-threads --with-newlib"  # Not sure about these last 2 options...there to try to make C++ support work
+NEWLIB_CFG=
+INSIGHT_CFG=
+
+# Compiler flags for compiling Newlib (-O2 is already hard-coded)
+NEWLIB_FLAGS="-march=armv4t -mcpu=arm7tdmi -g"
+
+############################################################################
+# End of configuration section. You shouldn't have to modify anything below.
+############################################################################
+
+if [[ `whoami` != "root" ]]; then
+  echo You must be root to run this script
+  exit 1
+fi
+
+mkdir -p ${SRCDIR}
+cd ${SRCDIR}
+
+if [[ -f `basename ${BINUTILS}` ]]; then
+  echo Looks like BINUTILS has already been downloaded.
+else
+  echo Now downloading BINUTILS...
+  # -nv: non-verbose but not too quiet (still print errors/warnings)
+  # -nc: no-clobber, do not download a file that already exists
+  # -t 0: retry indefinitely
+  # -a wget.log: append errors/warnings to wget.log file
+  wget -nv -nc -t 0 -a wget.log ${BINUTILS}
+fi
+
+if [[ -f `basename ${GCCCORE}` ]]; then
+  echo Looks like GCC has already been downloaded.
+else
+  echo Now downloading GCC...
+  wget -nv -nc -t 0 -a wget.log ${GCCCORE}
+fi
+
+if [[ -f `basename ${GPP}` ]]; then
+  echo Looks like G++ has already been downloaded.
+else
+  echo Now downloading G++...
+  wget -nv -nc -t 0 -a wget.log ${GPP}
+fi
+
+if [[ -f `basename ${NEWLIB}` ]]; then
+  echo Looks like NEWLIB has already been downloaded.
+else
+  echo Now downloading NEWLIB...
+  wget -nv -nc -t 0 -a wget.log ${NEWLIB}
+fi
+
+if [[ -f `basename ${INSIGHT}` ]]; then
+  echo Looks like INSIGHT has already been downloaded.
+else
+  echo Now downloading INSIGHT...
+  wget -nv -nc -t 0 -a wget.log ${INSIGHT}
+fi
+
+if [[ -f binutils.built ]]; then
+  echo Looks like BINUTILS was already built.
+else
+  echo Building BINUTILS...
+  tar -xjf `basename ${BINUTILS}`
+  echo ___________________  > make.log
+  echo Building binutils... >> make.log
+  cd `find . -maxdepth 1 -type d -name 'binutils*'`
+  mkdir gnuarm
+  cd gnuarm
+  ../configure ${COMMON_CFG} ${BINUTILS_CFG} >> ../../make.log 2>&1
+  make MAKEINFO=`which makeinfo` >> ../../make.log 2>&1
+  make install >> ../../make.log 2>&1
+  cd ../..
+  touch binutils.built
+fi
+
+  echo ___________________  >> make.log
+  echo Adding ${DESTDIR}/bin to PATH >> make.log
+export PATH; PATH=${DESTDIR}/bin:$PATH
+  echo ___________________  >> make.log
+
+if [[ -f gcc.built ]]; then
+  echo Looks like GCC was already built.
+else
+  echo Building GCC...
+  tar -xjf `basename ${GCCCORE}`
+  tar -xjf `basename ${GPP}`
+  echo ___________________  >> make.log
+
+cat << EOF > gcc.patch
+--- gcc-4.2.2.orig/gcc/config/arm/t-arm-elf    2006-11-06 13:13:53.000000000 +0100
++++ gcc-4.2.2.mod/gcc/config/arm/t-arm-elf     2007-10-05 12:13:00.000000000 +0200
+@@ -23,8 +23,8 @@
+ # MULTILIB_DIRNAMES   += fpu soft
+ # MULTILIB_EXCEPTIONS += *mthumb/*mhard-float*
+ # 
+-# MULTILIB_OPTIONS    += mno-thumb-interwork/mthumb-interwork
+-# MULTILIB_DIRNAMES   += normal interwork
++MULTILIB_OPTIONS    += mno-thumb-interwork/mthumb-interwork
++MULTILIB_DIRNAMES   += normal interwork
+ # 
+ # MULTILIB_OPTIONS    += fno-leading-underscore/fleading-underscore
+ # MULTILIB_DIRNAMES   += elf under
+EOF
+
+  echo Patching GCC >> make.log
+  cd `find . -maxdepth 1 -type d -name 'gcc*'`
+  patch -p1 < ../gcc.patch
+  echo Building gcc... >> make.log
+  mkdir gnuarm
+  cd gnuarm
+  ../configure ${COMMON_CFG} ${GCCCORE_CFG} >> ../../make.log 2>&1
+  make >> ../../make.log 2>&1
+  make install >> ../../make.log 2>&1
+  cd ../..
+  touch gcc.built
+fi
+
+if [[ -f newlib.built ]]; then
+  echo Looks like NEWLIB was already built.
+else
+  echo Building NEWLIB...
+  tar -xzf `basename ${NEWLIB}`
+  echo ___________________  >> make.log
+  echo Building newlib... >> make.log
+  cd `find . -maxdepth 1 -type d -name 'newlib*'`
+  mkdir gnuarm
+  cd gnuarm
+  ../configure ${COMMON_CFG} ${NEWLIB_CFG}  >> ../../make.log 2>&1
+
+  # This line adds our NEWLIB_CFLAGS to the configure.host file in the
+  # newlib subdirectory. This is the only way I could find to tell Newlib to
+  # compile itself with the -mmarch=armv4t and -mcpu=arm7tdmi flags.
+  sed -i "/^newlib_cflags=/s/=.*\$/=\"${NEWLIB_FLAGS}\"/" ../newlib/configure.host
+  make >> ../../make.log 2>&1
+  make install >> ../../make.log 2>&1
+  cd ../..
+  touch newlib.built
+fi
+
+  echo ___________________  >> make.log
+  echo "Now that newlib is built, second pass for GCC..." >> make.log
+  cd `find . -maxdepth 1 -type d -name 'gcc*'`
+  cd gnuarm
+  make >> ../../make.log 2>&1
+  make install >> ../../make.log 2>&1
+  cd ../..
+
+
+if [[ -f insight.built ]]; then
+  echo Looks like INSIGHT was already built.
+else
+  echo Building INSIGHT...
+  tar -xjf `basename ${INSIGHT}`
+  echo ___________________  >> make.log
+  echo Building insight... >> make.log
+  cd `find . -maxdepth 1 -type d -name 'insight*'`
+  mkdir gnuarm
+  cd gnuarm
+  ../configure ${COMMON_CFG} ${INSIGHT_CFG} >> ../../make.log 2>&1
+  make >> ../../make.log 2>&1
+  make install >> ../../make.log 2>&1
+  cd ../..
+  touch insight.built
+fi
+
+echo ___________________  >> make.log
+echo Build complete. >> make.log
+
+cd ${DESTDIR}
+chmod -R a+rX .
+
+exit 0
Impressum, Datenschutz