mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-19 04:49:38 -07:00
Reduced the size of BigBuf to make more room for stack/vars
This commit is contained in:
parent
f81c82c342
commit
0422e2a471
5 changed files with 8 additions and 19 deletions
|
@ -37,12 +37,12 @@ all: osimage.s19
|
||||||
|
|
||||||
$(OBJDIR)/fpgaimage.s19: $(OBJDIR)/fpgaimg.o
|
$(OBJDIR)/fpgaimage.s19: $(OBJDIR)/fpgaimg.o
|
||||||
@echo obj/fpgaimage.s19
|
@echo obj/fpgaimage.s19
|
||||||
@$(LD) -g -Tldscript-fpga -o $(OBJDIR)\fpgaimage.elf $(OBJDIR)/fpgaimg.o
|
@$(LD) -g -Tldscript-fpga -o $(OBJDIR)\fpgaimage.elf -Map=obj/fpgaimage.map $(OBJDIR)/fpgaimg.o
|
||||||
@$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)\fpgaimage.elf $(OBJDIR)\fpgaimage.s19
|
@$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)\fpgaimage.elf $(OBJDIR)\fpgaimage.s19
|
||||||
|
|
||||||
$(OBJDIR)/osimage.s19: $(OBJ) $(OBJCOMMON)
|
$(OBJDIR)/osimage.s19: $(OBJ) $(OBJCOMMON)
|
||||||
@echo obj/osimage.s19
|
@echo obj/osimage.s19
|
||||||
@$(LD) -g -Tldscript -o $(OBJDIR)\osimage.elf $(OBJ) $(OBJCOMMON) $(LIB)\libgcc.a
|
@$(LD) -g -Tldscript -o $(OBJDIR)\osimage.elf $(OBJ) $(OBJCOMMON) -Map=obj/osimage.map $(LIB)\libgcc.a
|
||||||
@$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)\osimage.elf $(OBJDIR)\osimage.s19
|
@$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)\osimage.elf $(OBJDIR)\osimage.s19
|
||||||
|
|
||||||
osimage.s19: $(OBJDIR)/osimage.s19 $(OBJDIR)/fpgaimage.s19
|
osimage.s19: $(OBJDIR)/osimage.s19 $(OBJDIR)/fpgaimage.s19
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
// The large multi-purpose buffer, typically used to hold A/D samples,
|
// The large multi-purpose buffer, typically used to hold A/D samples,
|
||||||
// maybe processed in some way.
|
// maybe processed in some way.
|
||||||
DWORD BigBuf[16000];
|
DWORD BigBuf[10000];
|
||||||
|
|
||||||
/// appmain.h
|
/// appmain.h
|
||||||
void ReadMem(int addr);
|
void ReadMem(int addr);
|
||||||
|
|
|
@ -123,6 +123,7 @@ void AcquireTiType(void)
|
||||||
int n = 1250;
|
int n = 1250;
|
||||||
|
|
||||||
// clear buffer
|
// clear buffer
|
||||||
|
DbpIntegers((DWORD)BigBuf, sizeof(BigBuf), 0x12345678);
|
||||||
memset(BigBuf,0,sizeof(BigBuf));
|
memset(BigBuf,0,sizeof(BigBuf));
|
||||||
|
|
||||||
// Set up the synchronous serial port
|
// Set up the synchronous serial port
|
||||||
|
@ -218,17 +219,6 @@ void AcquireRawBitsTI(void)
|
||||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
// this is a dummy function to get around
|
|
||||||
// a possible flash bug in the bootloader
|
|
||||||
// delete once you've added more code.
|
|
||||||
void DummyDummyDummy(void)
|
|
||||||
{
|
|
||||||
FpgaSendCommand(FPGA_CMD_SET_DIVISOR, 88); //134.8Khz
|
|
||||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_LF_PASSTHRU);
|
|
||||||
AcquireTiType();
|
|
||||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
|
||||||
}
|
|
||||||
|
|
||||||
// arguments: 64bit data split into 32bit idhi:idlo and optional 16bit crc
|
// arguments: 64bit data split into 32bit idhi:idlo and optional 16bit crc
|
||||||
// if crc provided, it will be written with the data verbatim (even if bogus)
|
// if crc provided, it will be written with the data verbatim (even if bogus)
|
||||||
// if not provided a valid crc will be computed from the data and written.
|
// if not provided a valid crc will be computed from the data and written.
|
||||||
|
|
|
@ -24,12 +24,12 @@ bootrom.s19: $(OBJDIR)/bootrom.s19 $(OBJDIR)/bootrom-forjtag.s19
|
||||||
|
|
||||||
$(OBJDIR)/bootrom.s19: $(OBJFLASH)
|
$(OBJDIR)/bootrom.s19: $(OBJFLASH)
|
||||||
@echo obj/bootrom.s19
|
@echo obj/bootrom.s19
|
||||||
@$(LD) -g -Tldscript-flash --oformat elf32-littlearm -o $(OBJDIR)/bootrom.elf $(OBJFLASH)
|
@$(LD) -g -Tldscript-flash --oformat elf32-littlearm -Map=obj/bootrom.map -o $(OBJDIR)/bootrom.elf $(OBJFLASH)
|
||||||
@$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)/bootrom.elf $(OBJDIR)/bootrom.s19
|
@$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)/bootrom.elf $(OBJDIR)/bootrom.s19
|
||||||
|
|
||||||
$(OBJDIR)/bootrom-forjtag.s19: $(OBJJTAG)
|
$(OBJDIR)/bootrom-forjtag.s19: $(OBJJTAG)
|
||||||
@echo obj/bootrom-forjtag.s19
|
@echo obj/bootrom-forjtag.s19
|
||||||
@$(LD) -g -Tldscript-ram-jtag --oformat elf32-littlearm -o $(OBJDIR)/bootrom-forjtag.elf $(OBJJTAG)
|
@$(LD) -g -Tldscript-ram-jtag --oformat elf32-littlearm -Map=obj/bootrom-forjtag.map -o $(OBJDIR)/bootrom-forjtag.elf $(OBJJTAG)
|
||||||
@$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)/bootrom-forjtag.elf $(OBJDIR)/bootrom-forjtag.s19
|
@$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)/bootrom-forjtag.elf $(OBJDIR)/bootrom-forjtag.s19
|
||||||
|
|
||||||
$(OBJDIR)/bootrom.o: bootrom.c $(INCLUDES)
|
$(OBJDIR)/bootrom.o: bootrom.c $(INCLUDES)
|
||||||
|
|
|
@ -194,6 +194,7 @@ void SendCommand(UsbCommand *c, BOOL wantAck)
|
||||||
|
|
||||||
DWORD written;
|
DWORD written;
|
||||||
OVERLAPPED ov;
|
OVERLAPPED ov;
|
||||||
|
|
||||||
memset(&ov, 0, sizeof(ov));
|
memset(&ov, 0, sizeof(ov));
|
||||||
WriteFile(UsbHandle, buf, 65, &written, &ov);
|
WriteFile(UsbHandle, buf, 65, &written, &ov);
|
||||||
if(GetLastError() != ERROR_IO_PENDING) {
|
if(GetLastError() != ERROR_IO_PENDING) {
|
||||||
|
@ -229,8 +230,6 @@ static void FlushPrevious(void)
|
||||||
UsbCommand c;
|
UsbCommand c;
|
||||||
memset(&c, 0, sizeof(c));
|
memset(&c, 0, sizeof(c));
|
||||||
|
|
||||||
printf("expected = %08x flush, ", ExpectedAddr);
|
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
for(i = 0; i < 240; i += 48) {
|
for(i = 0; i < 240; i += 48) {
|
||||||
c.cmd = CMD_SETUP_WRITE;
|
c.cmd = CMD_SETUP_WRITE;
|
||||||
|
@ -241,7 +240,7 @@ static void FlushPrevious(void)
|
||||||
|
|
||||||
c.cmd = CMD_FINISH_WRITE;
|
c.cmd = CMD_FINISH_WRITE;
|
||||||
c.ext1 = (ExpectedAddr-1) & (~255);
|
c.ext1 = (ExpectedAddr-1) & (~255);
|
||||||
printf("c.ext1 = %08x\r", c.ext1);
|
printf("Flashing address: %08x\r", c.ext1);
|
||||||
memcpy(c.d.asBytes, QueuedToSend+240, 16);
|
memcpy(c.d.asBytes, QueuedToSend+240, 16);
|
||||||
SendCommand(&c, TRUE);
|
SendCommand(&c, TRUE);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue