Merge pull request #83 from ceres-c/iso15_merge_rrg

ISO15693 sniffing codec
This commit is contained in:
Iceman
2022-02-01 19:09:08 +01:00
committed by GitHub
18 changed files with 961 additions and 50 deletions
+1
View File
@@ -24,6 +24,7 @@
static inline
void AntennaLevelInit(void) {
ADCA.CAL = (PRODSIGNATURES_ADCACAL1 << 8) | PRODSIGNATURES_ADCACAL0; /* Load calibration data, source: https://www.avrfreaks.net/comment/2080211#comment-2080211 */
ADCA.CTRLA = ADC_ENABLE_bm;
ADCA.CTRLB = ADC_RESOLUTION_12BIT_gc;
ADCA.REFCTRL = ADC_REFSEL_INT1V_gc | ADC_BANDGAP_bm;
@@ -22,6 +22,7 @@
#include "Sniff14443A.h"
#include "EM4233.h"
#include "NTAG215.h"
#include "Sniff15693.h"
/* Function wrappers */
INLINE void ApplicationInit(void) {
@@ -11,7 +11,6 @@
extern bool checkParityBits(uint8_t *Buffer, uint16_t BitCount);
Sniff14443Command Sniff14443CurrentCommand = Sniff14443_Do_Nothing;
//bool selected = false;
static enum {
STATE_IDLE,
STATE_REQA,
@@ -68,7 +67,7 @@ uint16_t Sniff14443AAppProcess(uint8_t *Buffer, uint16_t BitCount) {
case STATE_REQA:
LED_PORT.OUTCLR = LED_RED;
// If received Reader REQA or WUPA
if (TrafficSource == TRAFFIC_READER &&
if (SniffTrafficSource == TRAFFIC_READER &&
(Buffer[0] == 0x26 || Buffer[0] == 0x52)) {
SniffState = STATE_ATQA;
} else {
@@ -77,7 +76,7 @@ uint16_t Sniff14443AAppProcess(uint8_t *Buffer, uint16_t BitCount) {
break;
case STATE_ATQA:
// ATQA: P RRRR XXXX P XXRX XXXX
if (TrafficSource == TRAFFIC_CARD &&
if (SniffTrafficSource == TRAFFIC_CARD &&
BitCount == 2 * 9 &&
(Buffer[0] & 0x20) == 0x00 && // Bit6 RFU shall be 0
(Buffer[1] & 0xE0) == 0x00 && // bit13-16 RFU shall be 0
@@ -88,7 +87,7 @@ uint16_t Sniff14443AAppProcess(uint8_t *Buffer, uint16_t BitCount) {
} else {
// If not ATQA, but REQA, then stay on this state,
// Reset to REQA, save the counter and reset the counter
if (TrafficSource == TRAFFIC_READER &&
if (SniffTrafficSource == TRAFFIC_READER &&
(Buffer[0] == 0x26 || Buffer[0] == 0x52)) {
} else {
// If not ATQA and not REQA then reset to REQA
@@ -98,7 +97,7 @@ uint16_t Sniff14443AAppProcess(uint8_t *Buffer, uint16_t BitCount) {
break;
case STATE_ANTICOLLI:
// SEL: 93/95/97
if (TrafficSource == TRAFFIC_READER &&
if (SniffTrafficSource == TRAFFIC_READER &&
BitCount == 2 * 8 &&
(Buffer[0] & 0xf0) == 0x90 &&
(Buffer[0] & 0x09) == 0x01) {
@@ -109,7 +108,7 @@ uint16_t Sniff14443AAppProcess(uint8_t *Buffer, uint16_t BitCount) {
}
break;
case STATE_UID:
if (TrafficSource == TRAFFIC_CARD &&
if (SniffTrafficSource == TRAFFIC_CARD &&
BitCount == 5 * 9 &&
checkParityBits(Buffer, BitCount)) {
SniffState = STATE_SELECT;
@@ -120,7 +119,7 @@ uint16_t Sniff14443AAppProcess(uint8_t *Buffer, uint16_t BitCount) {
case STATE_SELECT:
// SELECT: 9 bytes, SEL = 93/95/97, NVB=70
if (TrafficSource == TRAFFIC_READER &&
if (SniffTrafficSource == TRAFFIC_READER &&
BitCount == 9 * 8 &&
(Buffer[0] & 0xf0) == 0x90 &&
(Buffer[0] & 0x09) == 0x01 &&
@@ -133,7 +132,7 @@ uint16_t Sniff14443AAppProcess(uint8_t *Buffer, uint16_t BitCount) {
break;
case STATE_SAK:
// SAK: 1Byte SAK + CRC
if (TrafficSource == TRAFFIC_CARD &&
if (SniffTrafficSource == TRAFFIC_CARD &&
BitCount == 3 * 9 &&
checkParityBits(Buffer, BitCount)) {
if ((Buffer[0] & 0x04) == 0x00) {
@@ -0,0 +1,38 @@
/*
* SniffISO15693.h
*
* Created on: 05.11.2019
* Author: ceres-c
*/
#ifdef CONFIG_ISO15693_SNIFF_SUPPORT
#include "../Codec/SniffISO15693.h"
#include "Sniff15693.h"
void SniffISO15693AppInit(void)
{
}
void SniffISO15693AppReset(void)
{
}
void SniffISO15693AppTask(void)
{
}
void SniffISO15693AppTick(void)
{
}
uint16_t SniffISO15693AppProcess(uint8_t* FrameBuf, uint16_t FrameBytes)
{
return 0;
}
#endif /* CONFIG_ISO15693_SNIFF_SUPPORT */
@@ -0,0 +1,20 @@
/*
* SniffISO15693.h
*
* Created on: 05.11.2019
* Author: ceres-c
*/
#ifndef SNIFF_15693_H_
#define SNIFF_15693_H_
#include "Application.h"
#include "ISO15693-A.h"
void SniffISO15693AppInit(void);
void SniffISO15693AppReset(void);
void SniffISO15693AppTask(void);
void SniffISO15693AppTick(void);
uint16_t SniffISO15693AppProcess(uint8_t* FrameBuf, uint16_t FrameBytes);
#endif /* SNIFF_15693_H_ */
+7 -1
View File
@@ -26,9 +26,15 @@ static volatile struct {
uint8_t CodecBuffer[CODEC_BUFFER_SIZE];
uint8_t CodecBuffer2[CODEC_BUFFER_SIZE];
void (* volatile isr_func_CODEC_TIMER_LOADMOD_CCB_VECT)(void) = NULL;
enum RCTraffic SniffTrafficSource;
void (* volatile isr_func_TCD0_CCC_vect)(void) = NULL;
void (* volatile isr_func_CODEC_DEMOD_IN_INT0_VECT)(void) = NULL;
void (* volatile isr_func_ACA_AC0_vect)(void);
void (* volatile isr_func_CODEC_TIMER_LOADMOD_OVF_VECT)(void) = NULL;
void (* volatile isr_func_CODEC_TIMER_LOADMOD_CCA_VECT)(void) = NULL;
void (* volatile isr_func_CODEC_TIMER_LOADMOD_CCB_VECT)(void) = NULL;
void (* volatile isr_func_CODEC_TIMER_TIMESTAMPS_CCA_VECT)(void) = NULL;
// the following three functions prevent sending data directly after turning on the reader field
void CodecReaderFieldStart(void) { // DO NOT CALL THIS FUNCTION INSIDE APPLICATION!
+18 -3
View File
@@ -38,6 +38,7 @@
#define CODEC_SUBCARRIER_CCEN_PSK TC1_CCAEN_bm
#define CODEC_SUBCARRIER_CCEN_OOK TC1_CCBEN_bm
#define CODEC_TIMER_SAMPLING TCD0
#define CODEC_TIMER_SAMPLING_OVF_VECT TCD0_OVF_vect
#define CODEC_TIMER_SAMPLING_CCA_VECT TCD0_CCA_vect
#define CODEC_TIMER_SAMPLING_CCB_VECT TCD0_CCB_vect
#define CODEC_TIMER_SAMPLING_CCC_VECT TCD0_CCC_vect
@@ -64,6 +65,7 @@
#define CODEC_THRESHOLD_CALIBRATE_MAX 2048
#define CODEC_THRESHOLD_CALIBRATE_STEPS 16
#define CODEC_TIMER_TIMESTAMPS TCD1
#define CODEC_TIMER_TIMESTAMPS_OVF_VECT TCD1_OVF_vect
#define CODEC_TIMER_TIMESTAMPS_CCA_VECT TCD1_CCA_vect
#define CODEC_TIMER_TIMESTAMPS_CCB_VECT TCD1_CCB_vect
@@ -80,6 +82,7 @@
#include "Reader14443-2A.h"
#include "SniffISO14443-2A.h"
#include "ISO15693.h"
#include "SniffISO15693.h"
/* Timing definitions for ISO14443A */
#define ISO14443A_SUBCARRIER_DIVIDER 16
@@ -116,6 +119,8 @@ typedef enum {
extern uint8_t CodecBuffer[CODEC_BUFFER_SIZE];
extern uint8_t CodecBuffer2[CODEC_BUFFER_SIZE];
extern enum RCTraffic {TRAFFIC_READER, TRAFFIC_CARD} SniffTrafficSource;
/* Shared ISR pointers and handlers */
extern void (* volatile isr_func_TCD0_CCC_vect)(void);
void isr_Reader14443_2A_TCD0_CCC_vect(void);
@@ -123,9 +128,22 @@ void isr_ISO15693_CODEC_TIMER_SAMPLING_CCC_VECT(void);
extern void (* volatile isr_func_CODEC_DEMOD_IN_INT0_VECT)(void);
void isr_ISO14443_2A_TCD0_CCC_vect(void);
void isr_ISO15693_CODEC_DEMOD_IN_INT0_VECT(void);
extern void (* volatile isr_func_CODEC_TIMER_LOADMOD_OVF_VECT)(void);
void isr_ISO14443_2A_CODEC_TIMER_LOADMOD_OVF_VECT(void);
void isr_SNIFF_ISO15693_CODEC_TIMER_LOADMOD_OVF_VECT(void);
extern void (* volatile isr_func_CODEC_TIMER_LOADMOD_CCA_VECT)(void);
void isr_Reader14443_2A_CODEC_TIMER_LOADMOD_CCA_VECT(void);
void isr_SNIFF_ISO15693_CODEC_TIMER_LOADMOD_CCA_VECT(void);
extern void (* volatile isr_func_CODEC_TIMER_LOADMOD_CCB_VECT)(void);
void isr_ISO15693_CODEC_TIMER_LOADMOD_CCB_VECT(void);
void isr_SniffISO14443_2A_CODEC_TIMER_LOADMOD_CCB_VECT(void);
void isr_SNIFF_ISO15693_CODEC_TIMER_LOADMOD_CCA_VECT(void);
extern void (* volatile isr_func_CODEC_TIMER_TIMESTAMPS_CCA_VECT)(void);
void isr_Reader14443_2A_CODEC_TIMER_TIMESTAMPS_CCA_VECT(void);
void isr_SNIFF_ISO15693_CODEC_TIMER_TIMESTAMPS_CCA_VECT(void);
extern void (* volatile isr_func_ACA_AC0_vect)(void);
void isr_SniffISO14443_2A_ACA_AC0_VECT(void);
void isr_SNIFF_ISO15693_ACA_AC0_VECT(void);
INLINE void CodecInit(void) {
ActiveConfiguration.CodecInitFunc();
@@ -166,9 +184,6 @@ INLINE void CodecInitCommon(void) {
EVSYS.CH0MUX = CODEC_DEMOD_IN_EVMUX0;
EVSYS.CH1MUX = CODEC_DEMOD_IN_EVMUX1;
EVSYS.CH2MUX = CODEC_DEMOD_IN_EVMUX0;
/* Configure loadmod pin configuration and use a virtual port configuration
* for single instruction cycle access */
CODEC_LOADMOD_PORT.DIRSET = CODEC_LOADMOD_MASK;
+2 -1
View File
@@ -223,7 +223,7 @@ ISR(CODEC_TIMER_SAMPLING_CCA_VECT) {
}
// Enumulate as a card to send card responds
ISR(CODEC_TIMER_LOADMOD_OVF_VECT) {
ISR_SHARED isr_ISO14443_2A_CODEC_TIMER_LOADMOD_OVF_VECT(void) {
/* Bit rate timer. Output a half bit on the output. */
static void *JumpTable[] = {
@@ -386,6 +386,7 @@ void ISO14443ACodecInit(void) {
isr_func_TCD0_CCC_vect = &isr_Reader14443_2A_TCD0_CCC_vect;
isr_func_CODEC_DEMOD_IN_INT0_VECT = &isr_ISO14443_2A_TCD0_CCC_vect;
isr_func_CODEC_TIMER_LOADMOD_OVF_VECT = &isr_ISO14443_2A_CODEC_TIMER_LOADMOD_OVF_VECT;
CodecInitCommon();
StartDemod();
}
@@ -48,9 +48,10 @@ void Reader14443ACodecInit(void) {
/* Initialize common peripherals and start listening
* for incoming data. */
CodecInitCommon();
// 中断回调
/* Register shared interrupt handlers */
isr_func_TCD0_CCC_vect = &isr_Reader14443_2A_TCD0_CCC_vect;
isr_func_CODEC_TIMER_LOADMOD_CCA_VECT = &isr_Reader14443_2A_CODEC_TIMER_LOADMOD_CCA_VECT;
isr_func_CODEC_TIMER_TIMESTAMPS_CCA_VECT = &isr_Reader14443_2A_CODEC_TIMER_TIMESTAMPS_CCA_VECT;
CodecSetDemodPower(true);
CODEC_TIMER_SAMPLING.PER = SAMPLE_RATE_SYSTEM_CYCLES - 1;
@@ -215,7 +216,7 @@ void Reader14443AMillerEOC(void) {
}
// EOC of Card->Reader found
ISR(CODEC_TIMER_TIMESTAMPS_CCA_VECT) { // EOC found
ISR_SHARED isr_Reader14443_2A_CODEC_TIMER_TIMESTAMPS_CCA_VECT(void) { // EOC found
Reader14443A_EOC();
}
@@ -231,7 +232,8 @@ ISR(ACA_AC1_vect) { // this interrupt either finds the SOC or gets triggered bef
// according to the pause and modulated period
// if the half bit duration is modulated, then add 1 to buffer
// if the half bit duration is not modulated, then add 0 to buffer
ISR(CODEC_TIMER_LOADMOD_CCA_VECT) { // pause found
// ISR(CODEC_TIMER_LOADMOD_CCA_VECT) { // pause found
ISR_SHARED isr_Reader14443_2A_CODEC_TIMER_LOADMOD_CCA_VECT(void) { // pause found
uint8_t tmp = CODEC_TIMER_TIMESTAMPS.CNTL;
CODEC_TIMER_TIMESTAMPS.CNT = 0;
@@ -56,8 +56,6 @@ static volatile uint16_t ReaderBitCount;
static volatile uint16_t CardBitCount;
static volatile uint16_t rawBitCount;
enum RCTraffic TrafficSource;
INLINE void CardSniffInit(void);
INLINE void CardSniffDeinit(void);
@@ -347,8 +345,7 @@ INLINE void Insert1(void) {
}
// This interrupt find Card -> Reader SOC
ISR(ACA_AC0_vect) { // this interrupt either finds the SOC or gets triggered before
ISR_SHARED isr_SniffISO14443_2A_ACA_AC0_VECT (void) { // this interrupt either finds the SOC or gets triggered before
ACA.AC0CTRL &= ~AC_INTLVL_HI_gc; // disable this interrupt
// enable the pause-finding timer
CODEC_TIMER_LOADMOD.CTRLD = TC_EVACT_RESTART_gc | TC_EVSEL_CH2_gc;
@@ -480,6 +477,7 @@ void Sniff14443ACodecInit(void) {
#endif
// Common Codec Register settings
CodecInitCommon();
isr_func_ACA_AC0_vect = &isr_SniffISO14443_2A_ACA_AC0_VECT;
isr_func_CODEC_TIMER_LOADMOD_CCB_VECT = &isr_SniffISO14443_2A_CODEC_TIMER_LOADMOD_CCB_VECT;
// Enable demodulator power
CodecSetDemodPower(true);
@@ -510,7 +508,7 @@ void Sniff14443ACodecTask(void) {
// Let the Application layer know where this data comes from
LEDHook(LED_CODEC_RX, LED_PULSE);
TrafficSource = TRAFFIC_READER;
SniffTrafficSource = TRAFFIC_READER;
ApplicationProcess(CodecBuffer, ReaderBitCount);
}
@@ -523,7 +521,7 @@ void Sniff14443ACodecTask(void) {
LEDHook(LED_CODEC_RX, LED_PULSE);
// Let the Application layer know where this data comes from
TrafficSource = TRAFFIC_CARD;
SniffTrafficSource = TRAFFIC_CARD;
ApplicationProcess(CodecBuffer2, CardBitCount);
}
@@ -9,7 +9,6 @@
#include "Codec.h"
#include "Terminal/CommandLine.h"
extern enum RCTraffic {TRAFFIC_READER, TRAFFIC_CARD} TrafficSource;
/* Codec Interface */
void Sniff14443ACodecInit(void);
void Sniff14443ACodecDeInit(void);
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,41 @@
/*
* SniffISO15693.h
*
* Created on: 05.11.2019
* Author: ceres-c
*/
#ifndef SNIFF_ISO15693_H_
#define SNIFF_ISO15693_H_
#include "Terminal/CommandLine.h"
#define ISO15693_APP_NO_RESPONSE 0x0000
#define SUBCARRIER_1 32
#define SUBCARRIER_2 28
#define SUBCARRIER_OFF 0
#define SOF_PATTERN 0x1D
#define EOF_PATTERN 0xB8
//Used when checking the request sent from the reader
#define ISO15693_REQ_SUBCARRIER_SINGLE 0x00
#define ISO15693_REQ_SUBCARRIER_DUAL 0x01
#define ISO15693_REQ_DATARATE_LOW 0x00
#define ISO15693_REQ_DATARATE_HIGH 0x02
/* Codec Interface */
void SniffISO15693CodecInit(void);
void SniffISO15693CodecDeInit(void);
void SniffISO15693CodecTask(void);
/* Application Interface */
void SniffISO15693CodecStart(void);
void SniffISO15693CodecReset(void);
/* Internal functions */
INLINE void SNIFF_ISO15693_READER_EOC_VCD(void);
INLINE void CardSniffInit(void);
#endif /* SNIFF_ISO15693_H_ */
+8 -8
View File
@@ -411,14 +411,14 @@ static const PROGMEM ConfigurationType ConfigurationTable[] = {
#endif
#ifdef CONFIG_ISO15693_SNIFF_SUPPORT
[CONFIG_ISO15693_SNIFF] = {
.CodecInitFunc = ISO15693CodecInit,
.CodecDeInitFunc = ISO15693CodecDeInit,
.CodecTaskFunc = ISO15693CodecTask,
.ApplicationInitFunc = ApplicationInitDummy,
.ApplicationResetFunc = ApplicationResetDummy,
.ApplicationTaskFunc = ApplicationTaskDummy,
.ApplicationTickFunc = ApplicationTickDummy,
.ApplicationProcessFunc = ApplicationProcessDummy,
.CodecInitFunc = SniffISO15693CodecInit,
.CodecDeInitFunc = SniffISO15693CodecDeInit,
.CodecTaskFunc = SniffISO15693CodecTask,
.ApplicationInitFunc = SniffISO15693AppInit,
.ApplicationResetFunc = SniffISO15693AppReset,
.ApplicationTaskFunc = SniffISO15693AppTask,
.ApplicationTickFunc = SniffISO15693AppTick,
.ApplicationProcessFunc = SniffISO15693AppProcess,
.ApplicationGetUidFunc = ApplicationGetUidDummy,
.ApplicationSetUidFunc = ApplicationSetUidDummy,
.UidSize = 0,
+17 -1
View File
@@ -44,6 +44,22 @@ CODEC_DEMOD_IN_INT0_VECT:
CODEC_TIMER_SAMPLING_CCC_VECT:
call_isr isr_func_TCD0_CCC_vect
.global CODEC_TIMER_LOADMOD_OVF_VECT
CODEC_TIMER_LOADMOD_OVF_VECT:
call_isr isr_func_CODEC_TIMER_LOADMOD_OVF_VECT
.global CODEC_TIMER_LOADMOD_CCA_VECT
CODEC_TIMER_LOADMOD_CCA_VECT:
call_isr isr_func_CODEC_TIMER_LOADMOD_CCA_VECT
.global CODEC_TIMER_LOADMOD_CCB_VECT
CODEC_TIMER_LOADMOD_CCB_VECT:
call_isr isr_func_CODEC_TIMER_LOADMOD_CCB_VECT
call_isr isr_func_CODEC_TIMER_LOADMOD_CCB_VECT
.global CODEC_TIMER_TIMESTAMPS_CCA_VECT
CODEC_TIMER_TIMESTAMPS_CCA_VECT:
call_isr isr_func_CODEC_TIMER_TIMESTAMPS_CCA_VECT
.global ACA_AC0_vect
ACA_AC0_vect:
call_isr isr_func_ACA_AC0_vect
+14 -10
View File
@@ -18,11 +18,11 @@ SETTINGS += -DCONFIG_MF_ULTRALIGHT_SUPPORT
SETTINGS += -DCONFIG_ISO14443A_SNIFF_SUPPORT
SETTINGS += -DCONFIG_ISO14443A_READER_SUPPORT
SETTINGS += -DCONFIG_NTAG215_SUPPORT
SETTINGS += -DCONFIG_VICINITY_SUPPORT
SETTINGS += -DCONFIG_SL2S2002_SUPPORT
SETTINGS += -DCONFIG_TITAGITSTANDARD_SUPPORT
# SETTINGS += -DCONFIG_ISO15693_SNIFF_SUPPORT
SETTINGS += -DCONFIG_EM4233_SUPPORT
# SETTINGS += -DCONFIG_VICINITY_SUPPORT
# SETTINGS += -DCONFIG_SL2S2002_SUPPORT
# SETTINGS += -DCONFIG_TITAGITSTANDARD_SUPPORT
# SETTINGS += -DCONFIG_EM4233_SUPPORT
SETTINGS += -DCONFIG_ISO15693_SNIFF_SUPPORT
#Support magic mode on mifare classic configuration
SETTINGS += -DSUPPORT_MF_CLASSIC_MAGIC_MODE
@@ -112,9 +112,9 @@ OPTIMIZATION = s
SRC += Chameleon-Mini.c LUFADescriptors.c System.c ISRSharing.S Configuration.c Random.c Common.c Memory.c MemoryAsm.S Button.c Log.c Settings.c LED.c Map.c AntennaLevel.c Uart.c uartcmd.c
SRC += Terminal/Terminal.c Terminal/Commands.c Terminal/XModem.c Terminal/CommandLine.c
SRC += Codec/Codec.c Codec/ISO14443-2A.c Codec/Reader14443-2A.c Codec/SniffISO14443-2A.c Codec/Reader14443-ISR.S
SRC += Application/MifareUltralight.c Application/MifareClassic.c Application/ISO14443-3A.c Application/Crypto1.c Application/Reader14443A.c Application/Sniff14443A.c Application/CryptoTDEA.S
SRC += Codec/ISO15693.c
SRC += Application/Vicinity.c Application/Sl2s2002.c Application/TITagitstandard.c Application/ISO15693-A.c Application/EM4233.c Application/NTAG215.c
SRC += Application/MifareUltralight.c Application/MifareClassic.c Application/ISO14443-3A.c Application/Crypto1.c Application/Reader14443A.c Application/Sniff14443A.c Application/CryptoTDEA.S Application/NTAG215.c
SRC += Codec/ISO15693.c Codec/SniffISO15693.c
SRC += Application/Vicinity.c Application/Sl2s2002.c Application/TITagitstandard.c Application/ISO15693-A.c Application/EM4233.c Application/Sniff15693.c
SRC += $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS)
LUFA_PATH = ../LUFA
CC_FLAGS = -flto -DUSE_LUFA_CONFIG_HEADER -DFLASH_DATA_ADDR=$(FLASH_DATA_ADDR) -DFLASH_DATA_SIZE=$(FLASH_DATA_SIZE) -DSPM_HELPER_ADDR=$(SPM_HELPER_ADDR) -DBUILD_DATE=$(BUILD_DATE) -DCOMMIT_ID=\"$(COMMIT_ID)\" $(SETTINGS)
@@ -135,7 +135,7 @@ AVRDUDE_FLAGS = -p $(AVRDUDE_MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
AVRDUDE_WRITE_APP_LATEST = -U application:w:Latest/Chameleon-RevG.hex
AVRDUDE_WRITE_EEPROM_LATEST = -U eeprom:w:Latest/Chameleon-RevG.eep
.PHONY: program program-latest dfu-flip dfu-prog check_size style
.PHONY: program program-latest dfu-flip dfu-prog dfu-reset check_size style
# Default target
all:
@@ -188,13 +188,17 @@ dfu-prog: $(TARGET).hex $(TARGET).eep check_size
dfu-programmer $(MCU) flash $(TARGET).hex
dfu-programmer $(MCU) reset
# Reset the device after firmware upgrade
dfu-reset:
dfu-programmer $(MCU) reset
check_size:
@{ \
set -e; \
if [ ! -f $(TARGET).elf ]; then \
exit 0; \
fi; \
PROGMEM_SIZE=$$(avr-size --mcu=atxmega128a4u --format=avr $(TARGET).elf | grep -oP "\d+" | sed -n 3p); \
PROGMEM_SIZE=$$(avr-size --mcu=atxmega128a4u --format=avr $(TARGET).elf | grep -oP "Program:\W+(\d+)" | grep -oP "\d+"); \
MAX_PRGMEM_SIZE=$$(printf "%d\n" $(FLASH_DATA_ADDR)); \
if [ $$PROGMEM_SIZE -gt $$MAX_PRGMEM_SIZE ]; then \
echo "make: *** $(TARGET).elf Application Section size $$PROGMEM_SIZE excedes maximum allowed $$MAX_PRGMEM_SIZE. Please disable some features in Makefile"; \
+5 -3
View File
@@ -159,7 +159,7 @@ MF_DETECTION_1K|Detecting reader to obtain keys|MFKEY32V2|List results directly|
MF_DETECTION_4K|Detecting reader to obtain keys|MFKEY32V2|List results directly|
ISO14443A_READER|Reader Mode|-|Display UID|
ISO14443A_SNIFF|Sniffing|-|Not supported|
ISO15693_SNIFF|Sniffing|-|Not supported|
ISO15693_SNIFF|Sniffing|-|Supported|
**4. Button Custom Function Introduction**
@@ -296,7 +296,8 @@ Sniff Mode NTAG|ISO14443A 106 kbit/s|Support|Support| No
LEGIC prime|LEGICprime/ ISO14443A/ ISO15693|Possible but not supported|Possible but not supported|No|
HID iCLASS|125kHz/ISO15693/ISO14443B|Possible but not supported|Possible but not supported|No|
Epass|ISO14443A/B|Supported / Supported|Low rate only / not supported|No|
ISO15693|ISO15693|Support|Support|No|
TiTagIT Standard|ISO15693|Support|Support|Support|
EM4233|ISO15693|Support|Support|Support|
2Sniff Mode Support Type
@@ -305,7 +306,8 @@ ISO15693|ISO15693|Support|Support|No|
|Encoding type|Whether the hardware supports|Does the software support| Whether the application layer supports|Note|
| ------------------- |:-------------------:| -------------------:| ------------------- |-------------------:|
Non-13.56MHz|Not Supported|Not Supported|Not Supported|
ISO 14443 A 106 kbit/s|Reader -> card Direction sniffing|Maybe support the other direction|Currently only supported Reader -> card Direction sniffing |Support|
ISO 14443 A 106 kbit/s|Reader -> card Direction sniffing|Maybe support the other direction|Currently only supported Reader -> card Direction sniffing ||
ISO 15693|Support|Support|Support|Single subcarrier only|
3 Card Type Supported via Reading
+5 -4
View File
@@ -71,7 +71,8 @@ eventTypes = {
0x45: { 'name': 'CODEC RX SNI READER W/PARITY', 'decoder': binaryParityDecoder },
0x46: { 'name': 'CODEC RX SNI CARD', 'decoder': binaryDecoder },
0x47: { 'name': 'CODEC RX SNI CARD W/PARITY', 'decoder': binaryParityDecoder },
0x48: { 'name': 'CODEC RX SNI READER FIELD DETECTED', 'decoder': noDecoder },
0x80: { 'name': 'APP READ', 'decoder': binaryDecoder },
0x81: { 'name': 'APP WRITE', 'decoder': binaryDecoder },
@@ -95,7 +96,7 @@ eventTypes = {
}
TIMESTAMP_MAX = 65536
eventTypes = { i : ({'name': 'UNKNOWN', 'decoder': binaryDecoder} if i not in eventTypes.keys() else eventTypes[i]) for i in range(256) }
eventTypes = { i : ({'name': f'UNKNOWN {hex(i)}', 'decoder': binaryDecoder} if i not in eventTypes.keys() else eventTypes[i]) for i in range(256) }
def parseBinary(binaryStream, decoder=None):
log = []
@@ -130,11 +131,11 @@ def parseBinary(binaryStream, decoder=None):
logData = eventTypes[event]['decoder'](logData)
# Calculate delta timestamp respecting 16 bit overflow
deltaTimestamp = timestamp - lastTimestamp;
deltaTimestamp = timestamp - lastTimestamp
lastTimestamp = timestamp
if (deltaTimestamp < 0):
deltaTimestamp += TIMESTAMP_MAX;
deltaTimestamp += TIMESTAMP_MAX
note = ""
# If we need to decode the data and paritybit check success