mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-20 21:33:19 -07:00
- Added new Makefile.linux in bootrom directory
- 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
This commit is contained in:
parent
b1d0de0a08
commit
aa4d9d9b73
12 changed files with 686 additions and 40 deletions
|
@ -10,17 +10,20 @@ INCLUDE = -I../include
|
|||
INCLUDES = ../include/proxmark3.h ../include/at91sam7s128.h ../include/config_gpio.h ../include/usb_cmd.h apps.h
|
||||
LIB = "..\..\devkitARM\lib\gcc\arm-elf\4.1.0\interwork"
|
||||
|
||||
# Add the "-DWITH_LCD" flag in CLFAGS to add support for LCD
|
||||
# and add OBJLCD to OBJ too
|
||||
CFLAGS = -O6 -c $(INCLUDE) -Wall
|
||||
|
||||
OBJLCD = $(OBJDIR)/fonts.o \
|
||||
$(OBJDIR)/LCD.o
|
||||
|
||||
OBJ = $(OBJDIR)/start.o \
|
||||
$(OBJDIR)/appmain.o \
|
||||
$(OBJDIR)/fpga.o \
|
||||
$(OBJDIR)/iso14443.o \
|
||||
$(OBJDIR)/iso14443a.o \
|
||||
$(OBJDIR)/iso15693.o \
|
||||
$(OBJDIR)/util.o \
|
||||
$(OBJDIR)/fonts.o \
|
||||
$(OBJDIR)/LCD.o
|
||||
$(OBJDIR)/util.o
|
||||
|
||||
OBJFPGA = \
|
||||
$(OBJDIR)/fpgaimg.o
|
||||
|
|
|
@ -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
|
||||
|
||||
OBJFPGA = fpgaimg.o
|
||||
OBJ = $(OBJDIR)/start.o \
|
||||
$(OBJDIR)/appmain.o \
|
||||
$(OBJDIR)/fpga.o \
|
||||
$(OBJDIR)/iso15693.o \
|
||||
$(OBJDIR)/iso14443.o \
|
||||
$(OBJDIR)/util.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
|
||||
$(LD) -g -Tldscript-full -o $(OBJDIR)/fullimage.elf $^ $(LIB)/libgcc.a
|
||||
$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)/fullimage.elf fullimage.s19
|
||||
|
||||
$(OBJ): %.o : %.c
|
||||
$(CC) $(CFLAGS) $< -o $(OBJDIR)/$@
|
||||
# Directives to put the *.o in the OBJDIR directory:
|
||||
$(OBJ): $(OBJDIR)/%.o : %.c
|
||||
$(CC) $(CFLAGS) $< -o $@
|
||||
|
||||
$(OBJFPGA): %.o : %.c
|
||||
$(CC) $(CFLAGS) $< -o $(OBJDIR)/$@
|
||||
$(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
|
||||
|
|
|
@ -4,10 +4,14 @@
|
|||
// Jonathan Westhues, Mar 2006
|
||||
// Edits by Gerhard de Koning Gans, Sep 2007 (##)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
#include <proxmark3.h>
|
||||
#include "apps.h"
|
||||
#include "fonts.h"
|
||||
#ifdef WITH_LCD
|
||||
#include "LCD.h"
|
||||
#endif
|
||||
|
||||
// The large multi-purpose buffer, typically used to hold A/D samples,
|
||||
// maybe pre-processed in some way.
|
||||
|
@ -682,11 +686,11 @@ void UsbPacketReceived(BYTE *packet, int len)
|
|||
SimulateTagLowFrequency(c->ext1);
|
||||
LED_A_OFF();
|
||||
break;
|
||||
|
||||
#ifdef WITH_LCD
|
||||
case CMD_LCD_RESET:
|
||||
LCDReset();
|
||||
break;
|
||||
|
||||
#endif
|
||||
case CMD_SWEEP_LF:
|
||||
SweepLFrange();
|
||||
break;
|
||||
|
@ -694,11 +698,11 @@ void UsbPacketReceived(BYTE *packet, int len)
|
|||
case CMD_SET_LF_DIVISOR:
|
||||
FpgaSendCommand(FPGA_CMD_SET_DIVISOR, c->ext1);
|
||||
break;
|
||||
|
||||
#ifdef WITH_LCD
|
||||
case CMD_LCD:
|
||||
LCDSend(c->ext1);
|
||||
break;
|
||||
|
||||
#endif
|
||||
case CMD_SETUP_WRITE:
|
||||
case CMD_FINISH_WRITE:
|
||||
USB_D_PLUS_PULLUP_OFF();
|
||||
|
@ -745,6 +749,8 @@ void AppMain(void)
|
|||
// Load the FPGA image, which we have stored in our flash.
|
||||
FpgaDownloadAndGo();
|
||||
|
||||
#ifdef WITH_LCD
|
||||
|
||||
LCDInit();
|
||||
|
||||
// test text on different colored backgrounds
|
||||
|
@ -767,6 +773,8 @@ void AppMain(void)
|
|||
LCDFill(0, 1+8*14, 132, 8, CYAN);
|
||||
LCDFill(0, 1+8*15, 132, 8, MAGENTA);
|
||||
|
||||
#endif
|
||||
|
||||
for(;;) {
|
||||
UsbPoll(FALSE);
|
||||
WDT_HIT();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue