mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-09-11 18:29:22 -07:00
Merge: hardware abstraction layer for ARM
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
# Option to build the firmware for the Proxmark3/5. This will include the armsrc and bootrom directories.
|
||||
option(BUILD_FIRMWARE "Build the firmware for the Proxmark3/5" ON)
|
||||
|
||||
# If building for pm3 device, not client, the compiler will be arm-none-eabi-gcc, so the test program will not compile.
|
||||
# This is a workaround to prevent CMake from trying to compile the test program,
|
||||
# which will fail because the compiler is not for the host system.
|
||||
if (BUILD_FIRMWARE)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/tools/FixCompileTest.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/tools/ToolchainForArm.cmake)
|
||||
endif ()
|
||||
|
||||
# Project name and languages
|
||||
project(Proxmark3 C CXX ASM)
|
||||
|
||||
# add subdirectories, which will contain their own CMakeLists.txt files
|
||||
if (BUILD_FIRMWARE)
|
||||
add_subdirectory(armsrc)
|
||||
add_subdirectory(bootrom)
|
||||
else ()
|
||||
add_subdirectory(client)
|
||||
endif ()
|
||||
@@ -0,0 +1,40 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
# Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# See LICENSE.txt for the text of the license.
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
ifeq ($(PLATFORM),PM5)
|
||||
|
||||
ARMLIB_EXPORT_DEFS = -DCHIP_AT32F435_37 -DAT32F435RGT7 -DUSE_STDPERIPH_DRIVER -DAT_START_F435_V1 -DUSBD_SUPPORT_WINUSB=1
|
||||
ARMLIB_EXPORT_DEFS += -DCRM_MODULE_ENABLED -DMISC_MODULE_ENABLED -DGPIO_MODULE_ENABLED
|
||||
ARMLIB_EXPORT_DEFS += -DUSB_MODULE_ENABLED -DQSPI_MODULE_ENABLED -DTMR_MODULE_ENABLED
|
||||
ARMLIB_EXPORT_DEFS += -DERTC_MODULE_ENABLED -DPWC_MODULE_ENABLED -DSPI_MODULE_ENABLED
|
||||
ARMLIB_EXPORT_DEFS += -DI2C_MODULE_ENABLED -DDMA_MODULE_ENABLED -DADC_MODULE_ENABLED
|
||||
ARMLIB_EXPORT_DEFS += -DUSART_MODULE_ENABLED -DEXINT_MODULE_ENABLED -DSCFG_MODULE_ENABLED
|
||||
ARMLIB_EXPORT_DEFS += -DFLASH_MODULE_ENABLED -DCRC_MODULE_ENABLED -DWDT_MODULE_ENABLED
|
||||
ARMLIB_EXPORT_DEFS += -DWWDT_MODULE_ENABLED -DCAN_MODULE_ENABLED -DDAC_MODULE_ENABLED
|
||||
ARMLIB_EXPORT_DEFS += -DDEBUG_MODULE_ENABLED -DDVP_MODULE_ENABLED -DEDMA_MODULE_ENABLED
|
||||
ARMLIB_EXPORT_DEFS += -DSDIO_MODULE_ENABLED -DACC_MODULE_ENABLED
|
||||
|
||||
ARMLIB_EXPORT_INCLUDES = -I.
|
||||
ARMLIB_EXPORT_INCLUDES += -isystem ../armlib/at32_sys -isystem ../armlib/at32_sys/cmsis/cm4/core_support
|
||||
ARMLIB_EXPORT_INCLUDES += -isystem ../armlib/at32_sys/cmsis/cm4/device_support -isystem ../armlib/at32_sys/drivers/inc
|
||||
ARMLIB_EXPORT_INCLUDES += -isystem ../armlib/at32_usb -isystem ../armlib/at32_usb/usb_drivers/inc -isystem ../armlib/at32_usb/usbd_class/cdc
|
||||
ARMLIB_EXPORT_INCLUDES += -isystem ../armlib/at32_i2c
|
||||
|
||||
ARMLIB_EXPORT_CFLAGS = $(ARMLIB_EXPORT_DEFS) $(ARMLIB_EXPORT_INCLUDES)
|
||||
|
||||
ARMLIB_EXPORT_LIBNAME = libarmlib.a
|
||||
|
||||
endif
|
||||
@@ -0,0 +1,97 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
# Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# See LICENSE.txt for the text of the license.
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
ifeq ($(PLATFORM),PM5)
|
||||
|
||||
# Flags + Inc
|
||||
include ../armlib/Exports.mk
|
||||
|
||||
# Toolchain + dirs
|
||||
include ../common_arm/Makefile.common
|
||||
|
||||
# Allow standalone invocation when parent make doesn't export toolchain vars.
|
||||
CROSS ?= arm-none-eabi-
|
||||
CROSS_CC ?= $(CROSS)gcc
|
||||
CROSS_CFLAGS ?=
|
||||
CROSS_AR ?= $(CROSS)ar
|
||||
OBJDIR ?= obj
|
||||
|
||||
ARMLIBSRC = \
|
||||
../armlib/at32_sys/cmsis/cm4/device_support/system_at32f435_437.c \
|
||||
../armlib/at32_sys/drivers/src/at32f435_437_crm.c \
|
||||
../armlib/at32_sys/drivers/src/at32f435_437_misc.c \
|
||||
../armlib/at32_sys/drivers/src/at32f435_437_gpio.c \
|
||||
../armlib/at32_sys/drivers/src/at32f435_437_usb.c \
|
||||
../armlib/at32_sys/drivers/src/at32f435_437_qspi.c \
|
||||
../armlib/at32_sys/drivers/src/at32f435_437_tmr.c \
|
||||
../armlib/at32_sys/drivers/src/at32f435_437_ertc.c \
|
||||
../armlib/at32_sys/drivers/src/at32f435_437_pwc.c \
|
||||
../armlib/at32_sys/drivers/src/at32f435_437_spi.c \
|
||||
../armlib/at32_sys/drivers/src/at32f435_437_i2c.c \
|
||||
../armlib/at32_sys/drivers/src/at32f435_437_dma.c \
|
||||
../armlib/at32_sys/drivers/src/at32f435_437_adc.c \
|
||||
../armlib/at32_sys/drivers/src/at32f435_437_usart.c \
|
||||
../armlib/at32_sys/drivers/src/at32f435_437_exint.c \
|
||||
../armlib/at32_sys/drivers/src/at32f435_437_scfg.c \
|
||||
../armlib/at32_sys/drivers/src/at32f435_437_flash.c \
|
||||
../armlib/at32_sys/drivers/src/at32f435_437_crc.c \
|
||||
../armlib/at32_sys/drivers/src/at32f435_437_wdt.c \
|
||||
../armlib/at32_sys/drivers/src/at32f435_437_wwdt.c \
|
||||
../armlib/at32_sys/drivers/src/at32f435_437_can.c \
|
||||
../armlib/at32_sys/drivers/src/at32f435_437_dac.c \
|
||||
../armlib/at32_sys/drivers/src/at32f435_437_debug.c \
|
||||
../armlib/at32_sys/drivers/src/at32f435_437_dvp.c \
|
||||
../armlib/at32_sys/drivers/src/at32f435_437_edma.c \
|
||||
../armlib/at32_sys/drivers/src/at32f435_437_sdio.c \
|
||||
../armlib/at32_sys/drivers/src/at32f435_437_acc.c \
|
||||
../armlib/at32_usb/usb_drivers/src/usb_core.c \
|
||||
../armlib/at32_usb/usb_drivers/src/usbd_core.c \
|
||||
../armlib/at32_usb/usb_drivers/src/usbd_int.c \
|
||||
../armlib/at32_usb/usb_drivers/src/usbd_sdr.c \
|
||||
../armlib/at32_usb/usbd_class/cdc/cdc_class.c \
|
||||
../armlib/at32_i2c/at32f435_437_i2c_app.c
|
||||
|
||||
ARMLIB = $(OBJDIR)/$(ARMLIB_EXPORT_LIBNAME)
|
||||
ARMLIB_OBJ_FROM_SRC = $(OBJDIR)/armlib_$(subst /,_,$(patsubst ../armlib/%.c,%,$(1))).o
|
||||
ARMLIB_OBJ = $(foreach src,$(ARMLIBSRC),$(call ARMLIB_OBJ_FROM_SRC,$(src)))
|
||||
ARMLIB_DEP = $(ARMLIB_OBJ:.o=.d)
|
||||
.DEFAULT_GOAL := $(ARMLIB)
|
||||
|
||||
# TODO Artery's library has many warnings, which we can only ignore for now, unfortunately.
|
||||
ARMLIB_PRIVATE_CFLAGS = -mcpu=cortex-m4 -Wno-missing-prototypes -Wno-missing-declarations
|
||||
ARMLIB_CFLAGS = $(ARMLIB_EXPORT_CFLAGS) $(ARMLIB_PRIVATE_CFLAGS)
|
||||
|
||||
define ARMLIB_COMPILE_RULE
|
||||
$(2): $(1) $(INCLUDES) | $(OBJDIR)
|
||||
$$(info [-] CC $$(notdir $(1)))
|
||||
$$(Q)$$(CROSS_CC) $$(CROSS_CFLAGS) $$(ARMLIB_CFLAGS) -MMD -MP -MF $(2:.o=.d) -mthumb -c -o $(2) $(1)
|
||||
endef
|
||||
|
||||
define ARMLIB_REGISTER_RULES
|
||||
$(foreach src,$(ARMLIBSRC),$(eval $(call ARMLIB_COMPILE_RULE,$(src),$(call ARMLIB_OBJ_FROM_SRC,$(src)))))
|
||||
endef
|
||||
|
||||
$(OBJDIR):
|
||||
$(Q)mkdir -p $@
|
||||
|
||||
$(ARMLIB): $(ARMLIB_OBJ) | $(OBJDIR)
|
||||
$(info [-] AR $@)
|
||||
$(Q)$(CROSS_AR) rcs $@ $^
|
||||
|
||||
$(call ARMLIB_REGISTER_RULES)
|
||||
-include $(ARMLIB_DEP)
|
||||
|
||||
endif
|
||||
@@ -23,6 +23,8 @@
|
||||
*/
|
||||
|
||||
#include "at32f435_437_conf.h"
|
||||
#include "at32f435_437_can.h"
|
||||
#include "at32f435_437_crm.h"
|
||||
|
||||
/** @addtogroup AT32F435_437_periph_driver
|
||||
* @{
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
|
||||
#include "at32f435_437_conf.h"
|
||||
#include "at32f435_437_crc.h"
|
||||
|
||||
/** @addtogroup AT32F435_437_periph_driver
|
||||
* @{
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
*/
|
||||
|
||||
#include "at32f435_437_conf.h"
|
||||
#include "at32f435_437_dac.h"
|
||||
#include "at32f435_437_crm.h"
|
||||
|
||||
/** @addtogroup AT32F435_437_periph_driver
|
||||
* @{
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
|
||||
#include "at32f435_437_conf.h"
|
||||
#include "at32f435_437_debug.h"
|
||||
|
||||
/** @addtogroup AT32F435_437_periph_driver
|
||||
* @{
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
*/
|
||||
|
||||
#include "at32f435_437_conf.h"
|
||||
#include "at32f435_437_dvp.h"
|
||||
#include "at32f435_437_crm.h"
|
||||
|
||||
/** @addtogroup AT32F435_437_periph_driver
|
||||
* @{
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
*/
|
||||
|
||||
#include "at32f435_437_conf.h"
|
||||
#include "at32f435_437_edma.h"
|
||||
#include "at32f435_437_crm.h"
|
||||
|
||||
/** @addtogroup AT32F435_437_periph_driver
|
||||
* @{
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
|
||||
#include "at32f435_437_conf.h"
|
||||
#include "at32f435_437_sdio.h"
|
||||
|
||||
/** @addtogroup AT32F435_437_periph_driver
|
||||
* @{
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
*/
|
||||
|
||||
#include "at32f435_437_conf.h"
|
||||
#include "at32f435_437_crm.h"
|
||||
#include "at32f435_437_tmr.h"
|
||||
#include "at32f435_437_crm.h"
|
||||
|
||||
/** @addtogroup AT32F435_437_periph_driver
|
||||
* @{
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
|
||||
#include "at32f435_437_conf.h"
|
||||
#include "at32f435_437_wdt.h"
|
||||
|
||||
/** @addtogroup AT32F435_437_periph_driver
|
||||
* @{
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
*/
|
||||
|
||||
#include "at32f435_437_conf.h"
|
||||
#include "at32f435_437_wwdt.h"
|
||||
#include "at32f435_437_crm.h"
|
||||
|
||||
/** @addtogroup AT32F435_437_periph_driver
|
||||
* @{
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
|
||||
#include "at32f435_437_conf.h"
|
||||
#include "at32f435_437_xmc.h"
|
||||
|
||||
/** @addtogroup AT32F435_437_periph_driver
|
||||
* @{
|
||||
|
||||
@@ -1,185 +0,0 @@
|
||||
#include "stdio.h"
|
||||
#include "usbd_core.h"
|
||||
#include "usb_cdc_desc.h"
|
||||
|
||||
|
||||
static usbd_desc_t *get_device_descriptor(void);
|
||||
|
||||
static usbd_desc_t *get_device_qualifier(void);
|
||||
|
||||
static usbd_desc_t *get_device_configuration(void);
|
||||
|
||||
static usbd_desc_t *get_device_other_speed(void);
|
||||
|
||||
static usbd_desc_t *get_device_lang_id(void);
|
||||
|
||||
static usbd_desc_t *get_device_manufacturer_string(void);
|
||||
|
||||
static usbd_desc_t *get_device_product_string(void);
|
||||
|
||||
static usbd_desc_t *get_device_serial_string(void);
|
||||
|
||||
static usbd_desc_t *get_device_interface_string(void);
|
||||
|
||||
static usbd_desc_t *get_device_config_string(void);
|
||||
|
||||
static usbd_desc_t *get_winusb_os_string(void);
|
||||
|
||||
/**
|
||||
* @brief device descriptor handler structure
|
||||
*/
|
||||
usbd_desc_handler cdc_desc_handler =
|
||||
{
|
||||
get_device_descriptor,
|
||||
get_device_qualifier,
|
||||
get_device_configuration,
|
||||
get_device_other_speed,
|
||||
get_device_lang_id,
|
||||
// ---
|
||||
get_device_manufacturer_string,
|
||||
get_device_product_string,
|
||||
get_device_serial_string,
|
||||
get_device_interface_string,
|
||||
get_device_config_string,
|
||||
// ---
|
||||
get_winusb_os_string,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
/* device descriptor */
|
||||
static usbd_desc_t device_descriptor =
|
||||
{
|
||||
sizeof(devDescriptor),
|
||||
(uint8_t *) devDescriptor
|
||||
};
|
||||
|
||||
/* config descriptor */
|
||||
static usbd_desc_t config_descriptor =
|
||||
{
|
||||
sizeof(cfgDescriptor),
|
||||
(uint8_t *) cfgDescriptor
|
||||
};
|
||||
|
||||
/* langid descriptor */
|
||||
static usbd_desc_t langid_descriptor =
|
||||
{
|
||||
sizeof(StrLanguageCodes),
|
||||
(uint8_t *) StrLanguageCodes
|
||||
};
|
||||
|
||||
/* serial descriptor */
|
||||
static usbd_desc_t serial_descriptor =
|
||||
{
|
||||
sizeof(StrSerialNumber),
|
||||
(uint8_t *) StrSerialNumber
|
||||
};
|
||||
|
||||
static usbd_desc_t vp_desc;
|
||||
|
||||
/**
|
||||
* @brief get device descriptor
|
||||
* @param none
|
||||
* @retval usbd_desc
|
||||
*/
|
||||
static usbd_desc_t *get_device_descriptor(void) {
|
||||
return &device_descriptor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief get device qualifier
|
||||
* @param none
|
||||
* @retval usbd_desc
|
||||
*/
|
||||
static usbd_desc_t *get_device_qualifier(void) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief get config descriptor
|
||||
* @param none
|
||||
* @retval usbd_desc
|
||||
*/
|
||||
static usbd_desc_t *get_device_configuration(void) {
|
||||
return &config_descriptor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief get other speed descriptor
|
||||
* @param none
|
||||
* @retval usbd_desc
|
||||
*/
|
||||
static usbd_desc_t *get_device_other_speed(void) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief get lang id descriptor
|
||||
* @param none
|
||||
* @retval usbd_desc
|
||||
*/
|
||||
static usbd_desc_t *get_device_lang_id(void) {
|
||||
return &langid_descriptor;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief get manufacturer descriptor
|
||||
* @param none
|
||||
* @retval usbd_desc
|
||||
*/
|
||||
static usbd_desc_t *get_device_manufacturer_string(void) {
|
||||
vp_desc.length = StrManufacturer[0];
|
||||
vp_desc.descriptor = (uint8_t *) StrManufacturer;
|
||||
return &vp_desc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief get product descriptor
|
||||
* @param none
|
||||
* @retval usbd_desc
|
||||
*/
|
||||
static usbd_desc_t *get_device_product_string(void) {
|
||||
vp_desc.length = StrProduct[0];
|
||||
vp_desc.descriptor = (uint8_t *) StrProduct;
|
||||
return &vp_desc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief get serial descriptor
|
||||
* @param none
|
||||
* @retval usbd_desc
|
||||
*/
|
||||
static usbd_desc_t *get_device_serial_string(void) {
|
||||
return &serial_descriptor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief get interface descriptor
|
||||
* @param none
|
||||
* @retval usbd_desc
|
||||
*/
|
||||
static usbd_desc_t *get_device_interface_string(void) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief get device config descriptor
|
||||
* @param none
|
||||
* @retval usbd_desc
|
||||
*/
|
||||
static usbd_desc_t *get_device_config_string(void) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief get device config descriptor
|
||||
* @param none
|
||||
* @retval usbd_desc
|
||||
*/
|
||||
static usbd_desc_t *get_winusb_os_string(void) {
|
||||
vp_desc.length = StrMS_OSDescriptor[0];
|
||||
vp_desc.descriptor = (uint8_t *) StrMS_OSDescriptor;
|
||||
return &vp_desc;
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
if (PM5 AND NOT TARGET pm5_at32_armlib)
|
||||
add_library(pm5_at32_armlib STATIC
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/cmsis/cm4/device_support/system_at32f435_437.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_crm.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_misc.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_gpio.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_usb.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_qspi.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_tmr.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_ertc.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_pwc.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_spi.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_i2c.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_dma.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_adc.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_usart.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_exint.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_scfg.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_flash.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_crc.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_wdt.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_wwdt.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_can.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_dac.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_debug.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_dvp.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_edma.c
|
||||
# ${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_emac.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_sdio.c
|
||||
# ${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_xmc.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/src/at32f435_437_acc.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_usb/usb_drivers/src/usb_core.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_usb/usb_drivers/src/usbd_core.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_usb/usb_drivers/src/usbd_int.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_usb/usb_drivers/src/usbd_sdr.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_usb/usbd_class/cdc/cdc_class.c
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_i2c/at32f435_437_i2c_app.c
|
||||
)
|
||||
|
||||
target_compile_options(pm5_at32_armlib
|
||||
PRIVATE ${CROSS_CFLAGS}
|
||||
PUBLIC -mcpu=cortex-m4 -Wno-missing-prototypes -Wno-missing-declarations
|
||||
)
|
||||
target_compile_definitions(pm5_at32_armlib PUBLIC
|
||||
AT32F435RGT7
|
||||
USE_STDPERIPH_DRIVER
|
||||
AT_START_F435_V1
|
||||
CRM_MODULE_ENABLED
|
||||
MISC_MODULE_ENABLED
|
||||
GPIO_MODULE_ENABLED
|
||||
USB_MODULE_ENABLED
|
||||
QSPI_MODULE_ENABLED
|
||||
TMR_MODULE_ENABLED
|
||||
ERTC_MODULE_ENABLED
|
||||
PWC_MODULE_ENABLED
|
||||
SPI_MODULE_ENABLED
|
||||
I2C_MODULE_ENABLED
|
||||
DMA_MODULE_ENABLED
|
||||
ADC_MODULE_ENABLED
|
||||
USART_MODULE_ENABLED
|
||||
EXINT_MODULE_ENABLED
|
||||
SCFG_MODULE_ENABLED
|
||||
FLASH_MODULE_ENABLED
|
||||
CRC_MODULE_ENABLED
|
||||
WDT_MODULE_ENABLED
|
||||
WWDT_MODULE_ENABLED
|
||||
CAN_MODULE_ENABLED
|
||||
DAC_MODULE_ENABLED
|
||||
DEBUG_MODULE_ENABLED
|
||||
DVP_MODULE_ENABLED
|
||||
EDMA_MODULE_ENABLED
|
||||
# EMAC_MODULE_ENABLED
|
||||
SDIO_MODULE_ENABLED
|
||||
# XMC_MODULE_ENABLED
|
||||
ACC_MODULE_ENABLED
|
||||
USBD_SUPPORT_WINUSB=1
|
||||
)
|
||||
target_include_directories(pm5_at32_armlib PUBLIC
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/cmsis/cm4/core_support
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/cmsis/cm4/device_support
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_sys/drivers/inc
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_usb
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_usb/usb_drivers/inc
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_usb/usbd_class/cdc
|
||||
${CMAKE_CURRENT_LIST_DIR}/at32_i2c
|
||||
)
|
||||
set_property(TARGET pm5_at32_armlib PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
endif ()
|
||||
File diff suppressed because it is too large
Load Diff
+65
-10
@@ -29,10 +29,43 @@ ifeq ($(PLTNAME),)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Proxmark5 requires armlib.
|
||||
include ../armlib/Exports.mk
|
||||
|
||||
#remove one of the following defines and comment out the relevant line
|
||||
#in the next section to remove that particular feature from compilation.
|
||||
# NO space,TABs after the "\" sign.
|
||||
APP_CFLAGS = $(PLATFORM_DEFS)
|
||||
APP_CFLAGS += $(ARMLIB_EXPORT_CFLAGS)
|
||||
|
||||
# HAL for platform
|
||||
ifeq ($(PLATFORM),PM5)
|
||||
SRC_STARTUP = startup_at32f435_437.s
|
||||
SRC_TICKS = ../common_arm/ticks/ticks_hw_at32.c i2c.c # TODO DXL: It always depends on I2C, so the compilation location of this source file needs to be optimized.
|
||||
SRC_GPIO = ../common_arm/gpio/gpio_hw_at32.c
|
||||
SRC_WDT = ../common_arm/wdt/wdt_hw_at32.c
|
||||
SRC_RSSI = ../common_arm/rssi/rssi_hw_at32.c
|
||||
SRC_SYS = ../common_arm/sys/sys_hw_at32.c
|
||||
SRC_FPGA = ../common_arm/fpga/fpga_hw_at32.c ../common_arm/fpga/fpga_gw_jtag.c
|
||||
SRC_USB_CDC = ../common_arm/usb/usb_cdc_at32.c
|
||||
SRC_FLASH_DATA = ../common_arm/flash_data/flashmem_hw_at32.c
|
||||
APP_CFLAGS += -mcpu=cortex-m4
|
||||
CROSS_LDFLAGS += -mcpu=cortex-m4
|
||||
LD_SCRIPT = ldscript.osimage.at32
|
||||
ARMLIB_OBJ = $(OBJDIR)/$(ARMLIB_EXPORT_LIBNAME)
|
||||
LIBS += $(ARMLIB_OBJ)
|
||||
else
|
||||
SRC_STARTUP =
|
||||
SRC_TICKS = ../common_arm/ticks/ticks_hw_at91.c
|
||||
SRC_GPIO = ../common_arm/gpio/gpio_hw_at91.c
|
||||
SRC_WDT = ../common_arm/wdt/wdt_hw_at91.c
|
||||
SRC_RSSI = ../common_arm/rssi/rssi_hw_at91.c
|
||||
SRC_SYS = ../common_arm/sys/sys_hw_at91.c
|
||||
SRC_FPGA = ../common_arm/fpga/fpga_hw_at91.c
|
||||
SRC_USB_CDC = ../common_arm/usb/usb_cdc_at91.c
|
||||
SRC_FLASH_DATA = ../common_arm/flash_data/flashmem_hw_at91.c
|
||||
LD_SCRIPT = ldscript.osimage.at91
|
||||
endif
|
||||
|
||||
SRC_LF = lfops.c lfsampling.c pcf7931.c lfdemod.c lfadc.c
|
||||
SRC_HF = hfops.c
|
||||
@@ -51,9 +84,9 @@ SRC_NFCBARCODE = thinfilm.c
|
||||
|
||||
# SRC_BEE = bee.c
|
||||
|
||||
# RDV40 related hardware support
|
||||
# RDV40 or PM5 related hardware support
|
||||
ifneq (,$(findstring WITH_FLASH,$(APP_CFLAGS)))
|
||||
SRC_FLASH = flashmem.c
|
||||
SRC_FLASH = flashmem_core.c $(SRC_FLASH_DATA)
|
||||
SRC_SPIFFS = spiffs.c spiffs_cache.c spiffs_check.c spiffs_gc.c spiffs_nucleus.c spiffs_hydrogen.c
|
||||
else
|
||||
SRC_FLASH =
|
||||
@@ -143,6 +176,11 @@ THUMBSRC = start.c \
|
||||
$(SRC_FELICA) \
|
||||
$(SRC_STANDALONE) \
|
||||
$(SRC_ZX) \
|
||||
$(SRC_RSSI) \
|
||||
$(SRC_TICKS) \
|
||||
$(SRC_GPIO) \
|
||||
$(SRC_WDT) \
|
||||
$(SRC_SYS) \
|
||||
appmain.c \
|
||||
printf.c \
|
||||
dbprint.c \
|
||||
@@ -150,8 +188,8 @@ THUMBSRC = start.c \
|
||||
util.c \
|
||||
string.c \
|
||||
BigBuf.c \
|
||||
ticks.c \
|
||||
clocks.c \
|
||||
ticks_core.c \
|
||||
rssi_core.c \
|
||||
hfsnoop.c \
|
||||
generator.c \
|
||||
cmac_calc.c \
|
||||
@@ -159,10 +197,16 @@ THUMBSRC = start.c \
|
||||
|
||||
|
||||
# These are to be compiled in ARM mode
|
||||
ARMSRC = fpgaloader.c \
|
||||
usb_cdc.c \
|
||||
ARMSRC = fpga_loader.c \
|
||||
fpga_core.c \
|
||||
$(SRC_FPGA) \
|
||||
usb_cdc_desc.c \
|
||||
usb_read_ng.c \
|
||||
$(SRC_USB_CDC) \
|
||||
cmd.c
|
||||
|
||||
ASMSRC = $(SRC_STARTUP)
|
||||
|
||||
VERSIONSRC = version_pm3.c \
|
||||
fpga_version_info.c
|
||||
|
||||
@@ -176,6 +220,11 @@ else
|
||||
INSTALLFWTAG = $(notdir $(INSTALLFW))
|
||||
endif
|
||||
|
||||
# On some platforms, the FPGA firmware does not need to be packaged into the ARM, because the FPGA has its own flash.
|
||||
ifneq ($(strip $(SKIP_FPGA_EMBED)),true)
|
||||
FPGA_ALL_O_DEP = $(OBJDIR)/fpga_all.o
|
||||
endif
|
||||
|
||||
OBJS = $(OBJDIR)/fullimage.s19
|
||||
FPGA_COMPRESSOR = ../tools/fpga_compress/fpga_compress
|
||||
|
||||
@@ -187,7 +236,7 @@ showinfo:
|
||||
.DELETE_ON_ERROR:
|
||||
|
||||
# version_pm3.c should be checked on every time fullimage.stage1.elf should be remade
|
||||
version_pm3.c: default_version_pm3.c $(OBJDIR)/fpga_version_info.o $(OBJDIR)/fpga_all.o $(THUMBOBJ) $(ARMOBJ) .FORCE
|
||||
version_pm3.c: default_version_pm3.c $(OBJDIR)/fpga_version_info.o $(FPGA_ALL_O_DEP) $(THUMBOBJ) $(ARMOBJ) $(ASMOBJ) .FORCE
|
||||
$(info [-] CHECK $@)
|
||||
$(Q)$(SH) ../tools/mkversion.sh $@ || $(CP) $< $@
|
||||
|
||||
@@ -211,10 +260,16 @@ $(FPGA_COMPRESSOR):
|
||||
$(error [!] MISSING $@ => To build it, go the root of the repo and do "make $(notdir $@)")
|
||||
$(error [!] MISSING $@)
|
||||
|
||||
$(OBJDIR)/fullimage.stage1.elf: $(VERSIONOBJ) $(OBJDIR)/fpga_all.o $(THUMBOBJ) $(ARMOBJ)
|
||||
ifeq ($(PLATFORM),PM5)
|
||||
$(ARMLIB_OBJ):
|
||||
$(info [=] MAKE $(notdir $@))
|
||||
@$(MAKE) --no-print-directory -f ../armlib/Makefile
|
||||
endif
|
||||
|
||||
$(OBJDIR)/fullimage.stage1.elf: $(VERSIONOBJ) $(FPGA_ALL_O_DEP) $(THUMBOBJ) $(ARMOBJ) $(ASMOBJ) $(ARMLIB_OBJ)
|
||||
$(info [=] LD $@)
|
||||
# Using -T instead of -Wl,-T is needed to prevent the linker from using the default ldscript when using picolibc instead of newlib
|
||||
$(Q)$(CROSS_LD) $(CROSS_LDFLAGS) -T ldscript -Wl,-Map,$(patsubst %.elf,%.map,$@) -o $@ $^ $(LIBS)
|
||||
$(Q)$(CROSS_LD) $(CROSS_LDFLAGS) -T $(LD_SCRIPT) -Wl,-Map,$(patsubst %.elf,%.map,$@) -o $@ $^ $(LIBS)
|
||||
|
||||
$(OBJDIR)/fullimage.data.bin: $(OBJDIR)/fullimage.stage1.elf
|
||||
$(info [-] GEN $@)
|
||||
@@ -243,6 +298,7 @@ tarbin: $(OBJS)
|
||||
clean:
|
||||
$(Q)$(RM) $(DEPENDENCY_FILES)
|
||||
$(Q)$(RM) $(OBJDIR)$(PATHSEP)*.o
|
||||
$(Q)$(RM) $(OBJDIR)$(PATHSEP)*.a
|
||||
$(Q)$(RM) $(OBJDIR)$(PATHSEP)*.elf
|
||||
$(Q)$(RM) $(OBJDIR)$(PATHSEP)*.s19
|
||||
$(Q)$(RM) $(OBJDIR)$(PATHSEP)*.map
|
||||
@@ -266,4 +322,3 @@ help:
|
||||
@echo Possible targets:
|
||||
@echo + all - Build the full image $(OBJDIR)/fullimage.s19
|
||||
@echo + clean - Clean $(OBJDIR)
|
||||
|
||||
|
||||
@@ -0,0 +1,185 @@
|
||||
#[[
|
||||
+==========================================================+
|
||||
| STANDALONE | DESCRIPTION |
|
||||
+==========================================================+
|
||||
| (empty) | No standalone mode |
|
||||
+----------------------------------------------------------+
|
||||
| LF_SKELETON | standalone mode skeleton |
|
||||
| | - iceman |
|
||||
+----------------------------------------------------------+
|
||||
| LF_EM4100EMUL | Simulate predefined em4100 tags only |
|
||||
| | |
|
||||
+----------------------------------------------------------+
|
||||
| LF_EM4100RSWB | Read/simulate/brute em4100 tags & |
|
||||
| | clone it to T555x tags |
|
||||
+----------------------------------------------------------+
|
||||
| LF_EM4100RSWW | Read/simulate/validate em4100 tags & |
|
||||
| | clone it to T55xx tags, wipe T55xx tags|
|
||||
+----------------------------------------------------------+
|
||||
| LF_EM4100RWC | Read/simulate em4100 tags & clone it |
|
||||
| | to T555x tags |
|
||||
+----------------------------------------------------------+
|
||||
| LF_HIDBRUTE | HID corporate 1000 bruteforce |
|
||||
| | - Federico dotta & Maurizio Agazzini |
|
||||
+----------------------------------------------------------+
|
||||
| LF_HIDFCBRUTE | HID Facility Code bruteforce |
|
||||
| (RDV4 only) | |
|
||||
+----------------------------------------------------------+
|
||||
| LF_ICEHID | LF HID collector to flashmem |
|
||||
| (RDV4 only) | |
|
||||
+----------------------------------------------------------+
|
||||
| LF_MULTIHID | LF HID 26 Bit (H1031) multi simulator |
|
||||
| | - Shain Lakin |
|
||||
+----------------------------------------------------------+
|
||||
| LF_NEDAP_SIM | LF Nedap ID simple simulator |
|
||||
| | |
|
||||
+----------------------------------------------------------+
|
||||
| LF_NEXID | LF Nexwatch collector to flashmem |
|
||||
| (RDV4 only) | |
|
||||
+----------------------------------------------------------+
|
||||
| LF_PROXBRUTE | HID ProxII bruteforce |
|
||||
| | - Brad Antoniewicz |
|
||||
+----------------------------------------------------------+
|
||||
| LF_PROX2BRUTE | HID ProxII bruteforce v2 |
|
||||
| | |
|
||||
+----------------------------------------------------------+
|
||||
| LF_SAMYRUN | HID26 read/clone/sim |
|
||||
| (default) | - Samy Kamkar |
|
||||
+----------------------------------------------------------+
|
||||
| LF_THAREXDE | Simulate/read EM4x50 tags |
|
||||
| (RDV4 only) | storing in flashmem |
|
||||
+----------------------------------------------------------+
|
||||
| HF_14ASNIFF | 14a sniff to flashmem (rdv4) or ram |
|
||||
| | |
|
||||
+----------------------------------------------------------+
|
||||
| HF_14BSNIFF | 14b sniff to flashmem (rdv4) or ram |
|
||||
| | |
|
||||
+----------------------------------------------------------+
|
||||
| HF_15SNIFF | 15693 sniff to flashmem (rdv4) or ram |
|
||||
| | |
|
||||
+----------------------------------------------------------+
|
||||
| HF_15SIM | 15693 tag simulator |
|
||||
| | |
|
||||
+----------------------------------------------------------+
|
||||
| HF_AVEFUL | Mifare ultralight read/simulation |
|
||||
| | - Ave Ozkal |
|
||||
+----------------------------------------------------------+
|
||||
| HF_BOG | 14a sniff with ULC/ULEV1/NTAG auth |
|
||||
| (RDV4 only) | storing in flashmem - Bogito |
|
||||
+----------------------------------------------------------+
|
||||
| HF_CARDHOPPER | Relay 14a protocols over long distances|
|
||||
| (RDV4 only) | (w/ IP backbone) - Sam Haskins |
|
||||
+----------------------------------------------------------+
|
||||
| HF_COLIN | Mifare ultra fast sniff/sim/clone |
|
||||
| (RDV4 only) | - Colin Brigato |
|
||||
+----------------------------------------------------------+
|
||||
| HF_CRAFTBYTE | UID stealer - Emulates scanned 14a UID |
|
||||
| | - Anze Jensterle |
|
||||
+----------------------------------------------------------+
|
||||
| HF_ICECLASS | Simulate HID iCLASS legacy ags |
|
||||
| (RDV4 only) | storing in flashmem |
|
||||
+----------------------------------------------------------+
|
||||
| HF_LEGIC | Read/simulate Legic Prime tags |
|
||||
| | storing in flashmem |
|
||||
+----------------------------------------------------------+
|
||||
| HF_LEGICSIM | Simulate Legic Prime tags |
|
||||
| (RDV4 only) | stored on flashmem |
|
||||
+----------------------------------------------------------+
|
||||
| HF_MATTYRUN | Mifare sniff/clone |
|
||||
| | - Matías A. Ré Medina |
|
||||
+----------------------------------------------------------+
|
||||
| HF_MFCSIM | Simulate Mifare Classic 1k card |
|
||||
| (RDV4 only) | storing in flashmem - Ray Lee |
|
||||
+----------------------------------------------------------+
|
||||
| HF_MSDSAL | Read and emulate MSD Visa cards |
|
||||
| | - Salvador Mendoza |
|
||||
+----------------------------------------------------------+
|
||||
| HF_REBLAY | 14A Relay over BT |
|
||||
| (RDV4 only) | - Salvador Mendoza |
|
||||
+----------------------------------------------------------+
|
||||
| HF_ST25_TEAROFF | Store/restore ST25TB tags with |
|
||||
| | tear-off for counters - SecLabz |
|
||||
+----------------------------------------------------------+
|
||||
| HF_TCPRST | IKEA Rothult read/sim/dump/emul |
|
||||
| | - Nick Draffen |
|
||||
+----------------------------------------------------------+
|
||||
| HF_TMUDFORD | Read and emulate 15 tags |
|
||||
| | - Tim Mudford |
|
||||
+----------------------------------------------------------+
|
||||
| HF_UNISNIFF | Sniff 14a/14b/15 (optionally to flash) |
|
||||
| | - hazardousvoltage |
|
||||
+----------------------------------------------------------+
|
||||
| HF_YOUNG | Mifare sniff/simulation |
|
||||
| | - Craig Young |
|
||||
+----------------------------------------------------------+
|
||||
| DANKARMULTI | Load multiple standalone modes. |
|
||||
| | - Daniel Karling |
|
||||
+----------------------------------------------------------+
|
||||
| HF_EMVPNG | Read and emulate EMV Visa cards |
|
||||
| | - Davi Mikael (Penegui) |
|
||||
+----------------------------------------------------------+
|
||||
]]
|
||||
|
||||
# Default standalone if no standalone specified
|
||||
set(DEFAULT_STANDALONE LF_SAMYRUN)
|
||||
# (you can set explicitly STANDALONE= to disable standalone modes)
|
||||
if (NOT DEFINED STANDALONE)
|
||||
set(STANDALONE ${DEFAULT_STANDALONE})
|
||||
endif ()
|
||||
set(STANDALONE_REQ_DEFS)
|
||||
|
||||
# List of all standalone modes, and which ones require bluetooth, smartcard or flash.
|
||||
# (for now, we only support one standalone mode at a time)
|
||||
set(STANDALONE_MODES
|
||||
LF_SKELETON LF_EM4100EMUL LF_EM4100RSWB LF_EM4100RSWW LF_EM4100RWC
|
||||
LF_HIDBRUTE LF_HIDFCBRUTE LF_ICEHID LF_MULTIHID LF_NEDAP_SIM LF_NEXID
|
||||
LF_PROXBRUTE LF_PROX2BRUTE LF_SAMYRUN LF_THAREXDE
|
||||
HF_14ASNIFF HF_14BSNIFF HF_15SNIFF HF_15SIM
|
||||
HF_AVEFUL HF_BOG HF_CARDHOPPER HF_COLIN HF_CRAFTBYTE HF_ICECLASS
|
||||
HF_LEGIC HF_LEGICSIM HF_MATTYRUN HF_MFCSIM HF_MSDSAL HF_REBLAY
|
||||
HF_ST25_TEAROFF HF_TCPRST HF_TMUDFORD HF_UNISNIFF HF_YOUNG HF_EMVPNG DANKARMULTI)
|
||||
# List of modes that require bluetooth
|
||||
set(STANDALONE_MODES_REQ_BT HF_CARDHOPPER HF_REBLAY)
|
||||
# List of modes that require smartcard
|
||||
set(STANDALONE_MODES_REQ_SMARTCARD)
|
||||
# List of modes that require flash
|
||||
set(STANDALONE_MODES_REQ_FLASH
|
||||
LF_HIDFCBRUTE LF_ICEHID LF_NEXID LF_THAREXDE HF_BOG HF_COLIN
|
||||
HF_ICECLASS HF_LEGICSIM HF_MFCSIM)
|
||||
|
||||
message(STATUS "STANDALONE = ${STANDALONE}")
|
||||
message(STATUS "STANDALONE_MODES = ${STANDALONE_MODES}")
|
||||
|
||||
# Check if the specified standalone mode is valid, and set the corresponding definitions.
|
||||
# 'MATCHES' is used to check if the specified standalone mode is in the list of valid modes.
|
||||
if (DEFINED STANDALONE)
|
||||
if ("${STANDALONE_MODES}" MATCHES "${STANDALONE}")
|
||||
string(TOUPPER ${STANDALONE} STANDALONE_UPPER)
|
||||
set(STANDALONE_PLATFORM_DEFS ${STANDALONE_PLATFORM_DEFS} "-DWITH_STANDALONE_${STANDALONE_UPPER}")
|
||||
# Required for SmartCard, set '-DWITH_SMARTCARD'
|
||||
if ("${STANDALONE_MODES_REQ_SMARTCARD}" MATCHES "${STANDALONE}")
|
||||
set(STANDALONE_REQ_DEFS ${STANDALONE_REQ_DEFS} -DWITH_SMARTCARD)
|
||||
endif ()
|
||||
# Required for Flash, set '-DWITH_FLASH'
|
||||
if ("${STANDALONE_MODES_REQ_FLASH}" MATCHES "${STANDALONE}")
|
||||
set(STANDALONE_REQ_DEFS ${STANDALONE_REQ_DEFS} -DWITH_FLASH)
|
||||
endif ()
|
||||
# Required for Bluetooth, set '-DWITH_FPC_USART_HOST'
|
||||
# (we use USART host for bluetooth communication in standalone modes)
|
||||
if ("${STANDALONE_MODES_REQ_BT}" MATCHES "${STANDALONE}")
|
||||
set(STANDALONE_REQ_DEFS ${STANDALONE_REQ_DEFS} -DWITH_FPC_USART_HOST)
|
||||
endif ()
|
||||
else ()
|
||||
message(FATAL_ERROR "Invalid STANDALONE: ${STANDALONE}. ${KNOWN_DEFINITIONS}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# Export the definitions for standalone mode to be used in the main CMakeLists.txt
|
||||
# --- Usually referenced externally:
|
||||
# STANDALONE_REQ_DEFS -> Definitions required by the selected standalone mode (e.g., -DWITH_FLASH)
|
||||
# STANDALONE_PLATFORM_DEFS -> Definitions for the selected standalone mode (e.g., -DWITH_STANDALONE_LF_SAMYRUN)
|
||||
# --- It is not usually used externally:
|
||||
# STANDALONE_MODES -> List of all valid standalone modes (for error checking)
|
||||
# STANDALONE_MODES_REQ_BT -> List of standalone modes that require bluetooth (for error checking)
|
||||
# STANDALONE_MODES_REQ_SMARTCARD -> List of standalone modes that require smartcard (for error checking)
|
||||
# STANDALONE_MODES_REQ_FLASH -> List of standalone modes that require flash (for error checking)
|
||||
@@ -0,0 +1,161 @@
|
||||
# --------------------- Standalone Source Files ---------------------
|
||||
|
||||
set(DIR_STANDALONE ${CMAKE_CURRENT_LIST_DIR})
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/placeholder.c")
|
||||
|
||||
# Check which standalone mode is selected, and set the corresponding source file.
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_LF_SKELETON")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/lf_skeleton.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_LF_EM4100EMUL")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/lf_em4100emul.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_LF_EM4100RSWB")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/lf_em4100rswb.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_LF_EM4100RSWW")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/lf_em4100rsww.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_LF_EM4100RWC")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/lf_em4100rwc.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_LF_HIDBRUTE")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/lf_hidbrute.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_LF_HIDFCBRUTE")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/lf_hidfcbrute.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_LF_ICEHID")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/lf_icehid.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_LF_MULTIHID")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/lf_multihid.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_LF_NEDAP_SIM")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/lf_nedap_sim.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_LF_NEXID")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/lf_nexid.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_LF_SAMYRUN")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/lf_samyrun.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_LF_PROXBRUTE")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/lf_proxbrute.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_LF_PROX2BRUTE")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/lf_prox2brute.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_LF_THAREXDE")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/lf_tharexde.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_HF_14ASNIFF")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/hf_14asniff.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_HF_14BSNIFF")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/hf_14bsniff.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_HF_15SNIFF")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/hf_15sniff.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_HF_15SIM")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/hf_15sim.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_HF_AVEFUL")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/hf_aveful.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_HF_BOG")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/hf_bog.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_HF_CARDHOPPER")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/hf_cardhopper.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_HF_COLIN")
|
||||
set(SRC_STANDALONE
|
||||
"${DIR_STANDALONE}/vtsend.c"
|
||||
"${DIR_STANDALONE}/hf_colin.c"
|
||||
"${DIR_STANDALONE}/frozen.c"
|
||||
"${DIR_STANDALONE}/nprintf.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_HF_CRAFTBYTE")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/hf_craftbyte.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_HF_ICECLASS")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/hf_iceclass.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_HF_LEGIC")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/hf_legic.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_HF_LEGICSIM")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/hf_legicsim.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_HF_MATTYRUN")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/hf_mattyrun.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_HF_MFCSIM")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/hf_mfcsim.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_HF_MSDSAL")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/hf_msdsal.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_HF_REBLAY")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/hf_reblay.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_HF_TCPRST")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/hf_tcprst.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_HF_TMUDFORD")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/hf_tmudford.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_HF_UNISNIFF")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/hf_unisniff.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_HF_YOUNG")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/hf_young.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_HF_ST25_TEAROFF")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/hf_st25_tearoff.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_HF_EMVPNG")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/hf_emvpng.c")
|
||||
endif ()
|
||||
|
||||
if ("${APP_CFLAGS}" MATCHES "WITH_STANDALONE_DANKARMULTI")
|
||||
set(SRC_STANDALONE "${DIR_STANDALONE}/dankarmulti.c")
|
||||
endif ()
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user