Merge branch 'master' into sim_half_duplex
update 210117
This commit is contained in:
@@ -217,8 +217,12 @@ $(OBJDIR)/fullimage.data.o: $(OBJDIR)/fullimage.data.bin.z
|
||||
$(Q)$(OBJCOPY) -O elf32-littlearm -I binary -B arm --rename-section .data=compressed_data $^ $@
|
||||
|
||||
$(OBJDIR)/fullimage.elf: $(OBJDIR)/fullimage.nodata.o $(OBJDIR)/fullimage.data.o
|
||||
ifeq (,$(findstring WITH_NO_COMPRESSION,$(APP_CFLAGS)))
|
||||
$(info [=] LD $@)
|
||||
$(Q)$(CC) $(CROSS_LDFLAGS) -Wl,-T,ldscript,-e,_osimage_entry,-Map,$(patsubst %.elf,%.map,$@) -o $@ $^
|
||||
else
|
||||
$(Q)$(CP) $(OBJDIR)/fullimage.stage1.elf $@
|
||||
endif
|
||||
|
||||
tarbin: $(OBJS)
|
||||
$(info TAR $@)
|
||||
|
||||
@@ -257,6 +257,9 @@ void ReadMem(int addr) {
|
||||
/* osimage version information is linked in, cf commonutil.h */
|
||||
/* bootrom version information is pointed to from _bootphase1_version_pointer */
|
||||
extern char *_bootphase1_version_pointer, _flash_start, _flash_end, __data_src_start__;
|
||||
#ifdef WITH_NO_COMPRESSION
|
||||
extern char *_bootrom_end, _bootrom_start, __os_size__;
|
||||
#endif
|
||||
static void SendVersion(void) {
|
||||
char temp[PM3_CMD_DATA_SIZE - 12]; /* Limited data payload in USB packets */
|
||||
char VersionString[PM3_CMD_DATA_SIZE - 12] = { '\0' };
|
||||
@@ -295,9 +298,11 @@ static void SendVersion(void) {
|
||||
strncat(VersionString, "\n ", sizeof(VersionString) - strlen(VersionString) - 1);
|
||||
}
|
||||
}
|
||||
#ifndef WITH_NO_COMPRESSION
|
||||
// Send Chip ID and used flash memory
|
||||
uint32_t text_and_rodata_section_size = (uint32_t)&__data_src_start__ - (uint32_t)&_flash_start;
|
||||
uint32_t compressed_data_section_size = common_area.arg1;
|
||||
#endif
|
||||
|
||||
struct p {
|
||||
uint32_t id;
|
||||
@@ -308,7 +313,11 @@ static void SendVersion(void) {
|
||||
|
||||
struct p payload;
|
||||
payload.id = *(AT91C_DBGU_CIDR);
|
||||
#ifdef WITH_NO_COMPRESSION
|
||||
payload.section_size = (uint32_t)&_bootrom_end - (uint32_t)&_bootrom_start + (uint32_t)&__os_size__;
|
||||
#else
|
||||
payload.section_size = text_and_rodata_section_size + compressed_data_section_size;
|
||||
#endif
|
||||
payload.versionstr_len = strlen(VersionString) + 1;
|
||||
memcpy(payload.versionstr, VersionString, payload.versionstr_len);
|
||||
|
||||
|
||||
@@ -133,35 +133,30 @@ static hf14a_config hf14aconfig = { 0, 0, 0, 0, 0 } ;
|
||||
|
||||
void printHf14aConfig(void) {
|
||||
DbpString(_CYAN_("HF 14a config"));
|
||||
Dbprintf(" [a] Anticol override....%i %s%s%s",
|
||||
hf14aconfig.forceanticol,
|
||||
(hf14aconfig.forceanticol == 0) ? "( " _GREEN_("No") " ) follow standard " : "",
|
||||
(hf14aconfig.forceanticol == 1) ? "( " _RED_("Yes") " ) always do anticol" : "",
|
||||
(hf14aconfig.forceanticol == 2) ? "( " _RED_("Yes") " ) always skip anticol" : ""
|
||||
Dbprintf(" [a] Anticol override....%s%s%s",
|
||||
(hf14aconfig.forceanticol == 0) ? _GREEN_("std") " : follow standard " : "",
|
||||
(hf14aconfig.forceanticol == 1) ? _RED_("force") " : always do anticol" : "",
|
||||
(hf14aconfig.forceanticol == 2) ? _RED_("skip") " : always skip anticol" : ""
|
||||
);
|
||||
Dbprintf(" [b] BCC override........%i %s%s%s",
|
||||
hf14aconfig.forcebcc,
|
||||
(hf14aconfig.forcebcc == 0) ? "( " _GREEN_("No") " ) follow standard" : "",
|
||||
(hf14aconfig.forcebcc == 1) ? "( " _RED_("Yes") " ) always do CL2" : "",
|
||||
(hf14aconfig.forcebcc == 2) ? "( " _RED_("Yes") " ) always use card BCC" : ""
|
||||
Dbprintf(" [b] BCC override........%s%s%s",
|
||||
(hf14aconfig.forcebcc == 0) ? _GREEN_("std") " : follow standard" : "",
|
||||
(hf14aconfig.forcebcc == 1) ? _RED_("fix") " : fix bad BCC" : "",
|
||||
(hf14aconfig.forcebcc == 2) ? _RED_("ignore") " : ignore bad BCC, always use card BCC" : ""
|
||||
);
|
||||
Dbprintf(" [2] CL2 override........%i %s%s%s",
|
||||
hf14aconfig.forcecl2,
|
||||
(hf14aconfig.forcecl2 == 0) ? "( " _GREEN_("No") " ) follow standard" : "",
|
||||
(hf14aconfig.forcecl2 == 1) ? "( " _RED_("Yes") " ) always do CL2" : "",
|
||||
(hf14aconfig.forcecl2 == 2) ? "( " _RED_("Yes") " ) always skip CL2" : ""
|
||||
Dbprintf(" [2] CL2 override........%s%s%s",
|
||||
(hf14aconfig.forcecl2 == 0) ? _GREEN_("std") " : follow standard" : "",
|
||||
(hf14aconfig.forcecl2 == 1) ? _RED_("force") " : always do CL2" : "",
|
||||
(hf14aconfig.forcecl2 == 2) ? _RED_("skip") " : always skip CL2" : ""
|
||||
);
|
||||
Dbprintf(" [3] CL3 override........%i %s%s%s",
|
||||
hf14aconfig.forcecl3,
|
||||
(hf14aconfig.forcecl3 == 0) ? "( " _GREEN_("No") " ) follow standard" : "",
|
||||
(hf14aconfig.forcecl3 == 1) ? "( " _RED_("Yes") " ) always do CL3" : "",
|
||||
(hf14aconfig.forcecl3 == 2) ? "( " _RED_("Yes") " ) always skip CL3" : ""
|
||||
Dbprintf(" [3] CL3 override........%s%s%s",
|
||||
(hf14aconfig.forcecl3 == 0) ? _GREEN_("std") " : follow standard" : "",
|
||||
(hf14aconfig.forcecl3 == 1) ? _RED_("force") " : always do CL3" : "",
|
||||
(hf14aconfig.forcecl3 == 2) ? _RED_("skip") " : always skip CL3" : ""
|
||||
);
|
||||
Dbprintf(" [r] RATS override.......%i %s%s%s",
|
||||
hf14aconfig.forcerats,
|
||||
(hf14aconfig.forcerats == 0) ? "( " _GREEN_("No") " ) follow standard " : "",
|
||||
(hf14aconfig.forcerats == 1) ? "( " _RED_("Yes") " ) always do RATS" : "",
|
||||
(hf14aconfig.forcerats == 2) ? "( " _RED_("Yes") " ) always skip RATS" : ""
|
||||
Dbprintf(" [r] RATS override.......%s%s%s",
|
||||
(hf14aconfig.forcerats == 0) ? _GREEN_("std") " : follow standard " : "",
|
||||
(hf14aconfig.forcerats == 1) ? _RED_("force") " : always do RATS" : "",
|
||||
(hf14aconfig.forcerats == 2) ? _RED_("skip") " : always skip RATS" : ""
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ t55xx_configurations_t T55xx_Timing = {
|
||||
{ 29 * 8, 17 * 8, 15 * 8, 40 * 8, 15 * 8, 0, 0 }, // Leading 0
|
||||
{ 29 * 8, 17 * 8, 15 * 8, 31 * 8, 15 * 8, 47 * 8, 63 * 8 } // 1 of 4
|
||||
#else
|
||||
// PM3OTHER or like offical repo
|
||||
// PM3GENERIC or like official repo
|
||||
{ 31 * 8, 20 * 8, 18 * 8, 50 * 8, 15 * 8, 0, 0 }, // Default Fixed
|
||||
{ 31 * 8, 20 * 8, 18 * 8, 50 * 8, 15 * 8, 0, 0 }, // Long Leading Ref.
|
||||
{ 31 * 8, 20 * 8, 18 * 8, 40 * 8, 15 * 8, 0, 0 }, // Leading 0
|
||||
|
||||
@@ -14,14 +14,16 @@
|
||||
|
||||
#include "proxmark3_arm.h"
|
||||
#include "appmain.h"
|
||||
#ifndef WITH_NO_COMPRESSION
|
||||
#include "lz4.h"
|
||||
#endif
|
||||
#include "BigBuf.h"
|
||||
#include "string.h"
|
||||
|
||||
extern struct common_area common_area;
|
||||
extern char __data_src_start__, __data_start__, __data_end__, __bss_start__, __bss_end__;
|
||||
|
||||
|
||||
#ifndef WITH_NO_COMPRESSION
|
||||
static void uncompress_data_section(void) {
|
||||
int avail_in;
|
||||
memcpy(&avail_in, &__data_src_start__, sizeof(int));
|
||||
@@ -35,6 +37,7 @@ static void uncompress_data_section(void) {
|
||||
// save the size of the compressed data section
|
||||
common_area.arg1 = avail_in;
|
||||
}
|
||||
#endif
|
||||
|
||||
void __attribute__((section(".startos"))) Vector(void);
|
||||
void Vector(void) {
|
||||
@@ -48,12 +51,20 @@ void Vector(void) {
|
||||
}
|
||||
common_area.flags.osimage_present = 1;
|
||||
|
||||
/* Set up data segment: Copy from flash to ram */
|
||||
#ifdef WITH_NO_COMPRESSION
|
||||
char *data_src = &__data_src_start__;
|
||||
char *data_dst = &__data_start__;
|
||||
char *data_end = &__data_end__;
|
||||
while (data_dst < data_end) *data_dst++ = *data_src++;
|
||||
#else
|
||||
uncompress_data_section();
|
||||
#endif
|
||||
|
||||
/* Set up (that is: clear) BSS. */
|
||||
char *dst = &__bss_start__;
|
||||
char *end = &__bss_end__;
|
||||
while (dst < end) *dst++ = 0;
|
||||
char *bss_dst = &__bss_start__;
|
||||
char *bss_end = &__bss_end__;
|
||||
while (bss_dst < bss_end) *bss_dst++ = 0;
|
||||
|
||||
AppMain();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user