mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
Add usart dev cmds & dynamic flash support capability
This commit is contained in:
parent
8e2d5370f9
commit
3176684f4a
18 changed files with 185 additions and 205 deletions
|
@ -1,22 +1,26 @@
|
|||
define KNOWN_PLATFORMS
|
||||
|
||||
+--------------------------------------------------------+
|
||||
| PLATFORM | DESCRIPTION |
|
||||
+--------------------------------------------------------+
|
||||
| PM3RDV4 (def) | Proxmark3 rdv4 with AT91SAM7S512 |
|
||||
+--------------------------------------------------------+
|
||||
| PM3RDV4FPC | Proxmark3 rdv4+FPC (experimental) |
|
||||
+--------------------------------------------------------+
|
||||
| PM3EVO | Proxmark3 EVO with AT91SAM7S512 |
|
||||
+--------------------------------------------------------+
|
||||
| PM3EASY | Proxmark3 rdv3 Easy with AT91SAM7S256 |
|
||||
+--------------------------------------------------------+
|
||||
| PM3RDV2 | Proxmark3 rdv2 with AT91SAM7S512 |
|
||||
+--------------------------------------------------------+
|
||||
| PM3OLD256 | Proxmark3 V1 with AT91SAM7S256 |
|
||||
+--------------------------------------------------------+
|
||||
| PM3OLD512 | Proxmark3 V1 with AT91SAM7S512 |
|
||||
+--------------------------------------------------------+
|
||||
+==========================================================+
|
||||
| PLATFORM | DESCRIPTION |
|
||||
+==========================================================+
|
||||
| PM3RDV4 (def) | Proxmark3 rdv4 with AT91SAM7S512 |
|
||||
+----------------------------------------------------------+
|
||||
| PM3EVO | Proxmark3 EVO with AT91SAM7S512 |
|
||||
+----------------------------------------------------------+
|
||||
| PM3EASY | Proxmark3 rdv3 Easy with AT91SAM7S256 |
|
||||
+----------------------------------------------------------+
|
||||
| PM3RDV2 | Proxmark3 rdv2 with AT91SAM7S512 |
|
||||
+----------------------------------------------------------+
|
||||
| PM3OLD256 | Proxmark3 V1 with AT91SAM7S256 |
|
||||
+----------------------------------------------------------+
|
||||
| PM3OLD512 | Proxmark3 V1 with AT91SAM7S512 |
|
||||
+----------------------------------------------------------+
|
||||
|
||||
+==========================================================+
|
||||
| PLATFORM_EXTRAS | DESCRIPTION |
|
||||
+==========================================================+
|
||||
| BTADDON | Proxmark3 rdv4 BT add-on |
|
||||
+----------------------------------------------------------+
|
||||
|
||||
Options to define platform:
|
||||
(1) Run make with PLATFORM specified as follows:
|
||||
|
@ -25,6 +29,12 @@ make PLATFORM=PM3EASY
|
|||
(2) Save a file called Makefile.platform with contents:
|
||||
PLATFORM=PM3EASY
|
||||
|
||||
or if you have a Proxmark 3 RDV4 with the BT add-on:
|
||||
PLATFORM=PM3RDV4
|
||||
PLATFORM_EXTRAS=BTADDON
|
||||
|
||||
!! Make sure to "make clean" when you change platform settings !!
|
||||
|
||||
endef
|
||||
|
||||
PLTNAME = Unknown Platform
|
||||
|
@ -33,10 +43,6 @@ ifeq ($(PLATFORM),PM3RDV4)
|
|||
MCU = AT91SAM7S512
|
||||
PLATFORM_DEFS = -DWITH_SMARTCARD -DWITH_FLASH
|
||||
PLTNAME = Proxmark3 rdv4
|
||||
else ifeq ($(PLATFORM),PM3RDV4FPC)
|
||||
MCU = AT91SAM7S512
|
||||
PLATFORM_DEFS = -DWITH_SMARTCARD -DWITH_FLASH -DWITH_FPC_HOST
|
||||
PLTNAME = Proxmark3 rdv4
|
||||
else ifeq ($(PLATFORM),PM3EVO)
|
||||
MCU = AT91SAM7S512
|
||||
PLTNAME = Proxmark3 EVO
|
||||
|
@ -56,6 +62,20 @@ else
|
|||
$(error Invalid or empty PLATFORM: $(PLATFORM). Known platforms: $(KNOWN_PLATFORMS))
|
||||
endif
|
||||
|
||||
# parsing additional PLATFORM_EXTRAS tokens
|
||||
PLATFORM_EXTRAS_TMP:=$(PLATFORM_EXTRAS)
|
||||
ifneq (,$(findstring BTADDON,$(PLATFORM_EXTRAS_TMP)))
|
||||
PLATFORM_DEFS += -DWITH_FPC_USART_HOST
|
||||
PLATFORM_EXTRAS_TMP := $(strip $(filter-out BTADDON,$(PLATFORM_EXTRAS_TMP)))
|
||||
endif
|
||||
ifneq (,$(findstring FPC_USART_DEV,$(PLATFORM_EXTRAS_TMP)))
|
||||
PLATFORM_DEFS += -DWITH_FPC_USART_DEV
|
||||
PLATFORM_EXTRAS_TMP := $(strip $(filter-out FPC_USART_DEV,$(PLATFORM_EXTRAS_TMP)))
|
||||
endif
|
||||
ifneq (,$(PLATFORM_EXTRAS_TMP))
|
||||
$(error Unknown PLATFORM_EXTRAS token(s): $(PLATFORM_EXTRAS_TMP))
|
||||
endif
|
||||
|
||||
# common LF support
|
||||
PLATFORM_DEFS += \
|
||||
-DWITH_LF \
|
||||
|
@ -90,9 +110,9 @@ $(info $(findstring WITH_STANDALONE_*,$(PLATFORM_DEFS)))
|
|||
|
||||
# Add flags dependencies :
|
||||
|
||||
# WITH_FPC_* needs WITH_FPC :
|
||||
ifneq (,$(findstring WITH_FPC_,$(PLATFORM_DEFS)))
|
||||
PLATFORM_DEFS += -DWITH_FPC
|
||||
# WITH_FPC_USART_* needs WITH_FPC_USART :
|
||||
ifneq (,$(findstring WITH_FPC_USART_,$(PLATFORM_DEFS)))
|
||||
PLATFORM_DEFS += -DWITH_FPC_USART
|
||||
endif
|
||||
|
||||
PLATFORM_DEFS_INFO = $(strip $(filter-out STANDALONE%, $(subst -DWITH_,,$(PLATFORM_DEFS))))
|
||||
|
@ -105,6 +125,7 @@ endif
|
|||
|
||||
|
||||
export PLATFORM
|
||||
export PLATFORM_EXTRAS
|
||||
export PLTNAME
|
||||
export MCU
|
||||
export PLATFORM_DEFS
|
||||
|
|
|
@ -38,7 +38,7 @@ bool reply_with_crc_on_fpc = true;
|
|||
// "Session" flag, to tell via which interface next msgs should be sent: USB or FPC USART
|
||||
bool reply_via_fpc = false;
|
||||
|
||||
#ifdef WITH_FPC_HOST
|
||||
#ifdef WITH_FPC_USART_HOST
|
||||
extern void Dbprintf(const char *fmt, ...);
|
||||
#define Dbprintf_usb(...) {\
|
||||
bool tmp = reply_via_fpc;\
|
||||
|
@ -71,7 +71,7 @@ int reply_old(uint64_t cmd, uint64_t arg0, uint64_t arg1, uint64_t arg2, void *d
|
|||
// Send frame and make sure all bytes are transmitted
|
||||
|
||||
if (reply_via_fpc) {
|
||||
#ifdef WITH_FPC_HOST
|
||||
#ifdef WITH_FPC_USART_HOST
|
||||
result = usart_writebuffer_sync((uint8_t *)&txcmd, sizeof(PacketResponseOLD));
|
||||
// Dbprintf_usb("Sent %i bytes over usart", len);
|
||||
#else
|
||||
|
@ -123,7 +123,7 @@ static int reply_ng_internal(uint16_t cmd, int16_t status, uint8_t *data, size_t
|
|||
// Send frame and make sure all bytes are transmitted
|
||||
|
||||
if (reply_via_fpc) {
|
||||
#ifdef WITH_FPC_HOST
|
||||
#ifdef WITH_FPC_USART_HOST
|
||||
result = usart_writebuffer_sync((uint8_t *)&txBufferNG, txBufferNGLen);
|
||||
// Dbprintf_usb("Sent %i bytes over usart", len);
|
||||
#else
|
||||
|
@ -225,7 +225,7 @@ int receive_ng(PacketCommandNG *rx) {
|
|||
if (usb_poll_validate_length())
|
||||
return receive_ng_internal(rx, usb_read_ng, false);
|
||||
|
||||
#ifdef WITH_FPC_HOST
|
||||
#ifdef WITH_FPC_USART_HOST
|
||||
// Check if there is a FPC packet available
|
||||
if (usart_rxdata_available() > 0)
|
||||
return receive_ng_internal(rx, usart_read_ng, true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue