Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to HydraBus to support ST25TB Kameleon board in place of HydraNFC v1 #176

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/push-kameleon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI-KAMELEON

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
2 changes: 2 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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


5 changes: 5 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@ 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 =

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
Expand Down
12 changes: 11 additions & 1 deletion src/hydranfc/trf7970a/include/mcu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 // 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 */
#define D2_ON (palSetPad(GPIOB, 0))
#define D2_OFF (palClearPad(GPIOB, 0))
Expand Down