From e522b5cbb05634f4a9f61de5abd8deff19b62801 Mon Sep 17 00:00:00 2001 From: Benjamin DELPY Date: Wed, 4 Sep 2024 16:51:11 +0200 Subject: [PATCH 1/6] Update push.yml --- .github/workflows/push.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 11fc7a8..7f5cc27 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -45,6 +45,8 @@ jobs: name: hydrafw path: | src/build/hydrafw.dfu + src/build/hydrafw.hex + src/build/hydrafw.elf if-no-files-found: error From e3c24c6f8174f4c554ee7d2e72aaddce4647acc5 Mon Sep 17 00:00:00 2001 From: Benjamin DELPY Date: Wed, 4 Sep 2024 17:07:33 +0200 Subject: [PATCH 2/6] Update mcu.h --- src/hydranfc/trf7970a/include/mcu.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/hydranfc/trf7970a/include/mcu.h b/src/hydranfc/trf7970a/include/mcu.h index 38c8957..3815b20 100644 --- a/src/hydranfc/trf7970a/include/mcu.h +++ b/src/hydranfc/trf7970a/include/mcu.h @@ -82,12 +82,22 @@ limitations under the License. #define LED2_OFF (palClearPad(GPIOB, 0)) #define LED2_TOGGLE (palTogglePad(GPIOB, 0)) -/* USer Button K1/2/3/4 Configured as Input */ +/* User Button K1/2/3/4 Configured as Input */ #define K1_BUTTON (palReadPad(GPIOB, 7)) #define K2_BUTTON (palReadPad(GPIOB, 6)) #define K3_BUTTON (palReadPad(GPIOB, 8)) #define K4_BUTTON (palReadPad(GPIOB, 9)) +/* Only one K1 Button on Kameleon board */ +#if defined(HYDRANFC_KAMELEON_FLAVOR) +#undef K2_BUTTON +#undef K3_BUTTON +#undef K4_BUTTON +#define K2_BUTTON 0 +#define K3_BUTTON 0 +#define K4_BUTTON 0 +#endif + /* LEDs D2/D3/D4/D5 Configured as Output */ #define D2_ON (palSetPad(GPIOB, 0)) #define D2_OFF (palClearPad(GPIOB, 0)) From 7bce3119036f1871ccbc607cfe4f0713ee03ba65 Mon Sep 17 00:00:00 2001 From: Benjamin DELPY Date: Thu, 5 Sep 2024 23:16:07 +0200 Subject: [PATCH 3/6] Update mcu.h to limit Kx buttons --- src/hydranfc/trf7970a/include/mcu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hydranfc/trf7970a/include/mcu.h b/src/hydranfc/trf7970a/include/mcu.h index 3815b20..3a200fe 100644 --- a/src/hydranfc/trf7970a/include/mcu.h +++ b/src/hydranfc/trf7970a/include/mcu.h @@ -93,9 +93,9 @@ limitations under the License. #undef K2_BUTTON #undef K3_BUTTON #undef K4_BUTTON -#define K2_BUTTON 0 -#define K3_BUTTON 0 -#define K4_BUTTON 0 +#define K2_BUTTON 0 // K2 is not used (only led actions ?) +#define K3_BUTTON K1_BUTTON // K3 is used in key/sniffing actions, but not K1, so we're using it in place +#define K4_BUTTON 0 // K4 is used to stop sniffing, but the USER BUTTON can be used in place, so we don't deal with K4 [ if ( (K4_BUTTON) || (hydrabus_ubtn()) ) ] #endif /* LEDs D2/D3/D4/D5 Configured as Output */ From 857df3100171e44c78c046090532e99daf03248d Mon Sep 17 00:00:00 2001 From: Benjamin DELPY Date: Thu, 5 Sep 2024 23:17:36 +0200 Subject: [PATCH 4/6] Update Makefile to support KAMELEON board flavor --- src/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Makefile b/src/Makefile index c93d760..271800b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -13,6 +13,7 @@ export STM32F4XX ?= 1 export HYDRAFW_NFC ?= 1 export HYDRAFW_DEBUG ?= 0 export FW_REVISION := $(shell build-scripts/hydrafw-revision) +export HYDRANFC_KAMELEON_FLAVOR ?= 0 HYDRAFW_OPTS = @@ -20,6 +21,10 @@ ifeq ($(HYDRAFW_NFC),1) HYDRAFW_OPTS += -DHYDRANFC endif +ifeq ($(HYDRANFC_KAMELEON_FLAVOR),1) +HYDRAFW_OPTS += -DHYDRANFC_KAMELEON_FLAVOR +endif + # Compiler options here. ifeq ($(USE_OPT),) USE_OPT = -fomit-frame-pointer -falign-functions=16 -std=gnu89 --specs=nosys.specs From 5310004c8855545d60587888ddce92a905868b54 Mon Sep 17 00:00:00 2001 From: Benjamin DELPY Date: Thu, 5 Sep 2024 23:27:24 +0200 Subject: [PATCH 5/6] Create push-kameleon.yml --- .github/workflows/push-kameleon.yml | 51 +++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/push-kameleon.yml diff --git a/.github/workflows/push-kameleon.yml b/.github/workflows/push-kameleon.yml new file mode 100644 index 0000000..3658be6 --- /dev/null +++ b/.github/workflows/push-kameleon.yml @@ -0,0 +1,51 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + env: + HYDRANFC_KAMELEON_FLAVOR: 1 + + steps: + - uses: actions/checkout@v4 + with: + submodules: true + fetch-tags: true + fetch-depth: 0 + + - uses: actions/setup-python@v5 + with: + python-version: 3.12 + cache: 'pip' # caching pip dependencies + + - run: pip install -r src/requirements.txt + + - name: Set git meta info + run: echo "GITHUB_CI_PR_SHA=${{github.event.pull_request.head.sha}}" >> "${GITHUB_ENV}" && echo "GITHUB_CI_CD=1" >> "${GITHUB_ENV}" + + - name: Install standalone reference GCC toolchain + run: bash scripts/env.sh + + - name: Build src/build-scripts/hex2dfu + run: cd src/build-scripts && make clean all + + - name: Build hydrafw-kameleon + run: source build.env && arm-none-eabi-gcc --version && arm-none-eabi-gcc -print-search-dirs && make V=1 -j$(nproc) -C src/ + + - name: Archive hydrafw-kameleon artifacts + uses: actions/upload-artifact@v4 + with: + name: hydrafw-kameleon + path: | + src/build/hydrafw.dfu + src/build/hydrafw.hex + src/build/hydrafw.elf + if-no-files-found: error From be5eb810dfcf46ed3441b51cad2a60aa82e21856 Mon Sep 17 00:00:00 2001 From: Benjamin DELPY Date: Thu, 5 Sep 2024 23:29:54 +0200 Subject: [PATCH 6/6] Update push-kameleon.yml --- .github/workflows/push-kameleon.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-kameleon.yml b/.github/workflows/push-kameleon.yml index 3658be6..467c2f9 100644 --- a/.github/workflows/push-kameleon.yml +++ b/.github/workflows/push-kameleon.yml @@ -1,4 +1,4 @@ -name: CI +name: CI-KAMELEON on: push: