Skip to content

Commit

Permalink
Merge branch 'RfidResearchGroup:main' into lf_read
Browse files Browse the repository at this point in the history
  • Loading branch information
merlokk authored Jul 24, 2024
2 parents 32f6ab8 + c771ae9 commit 28107fc
Show file tree
Hide file tree
Showing 23 changed files with 2,592 additions and 413 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/build_client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,15 @@ jobs:
uses: actions/checkout@v3
with:
ref: ${{ inputs.checkout-sha == null && github.sha || inputs.checkout-sha }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install PyInstaller and client dependencies
run: |
pip3 install pyinstaller
pip3 install -r software/script/requirements.txt
python -m pip install --upgrade pip
pip install pyinstaller
pip install -r software/script/requirements.txt
- name: Run OS specific setup
run: ${{ matrix.pre_command }}
- name: Compile native code
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ This project uses the changelog in accordance with [keepchangelog](http://keepac
- Added support for timestamped comments in CLI via `rem`, `;`, `%` or `#` (@doegox)
- Fixed watchdog trigger during `hw factory_reset` (@doegox)
- Added PyInstaller support for CLI client (@augustozanellato)
- Added proper Mifare Ultralight (original, C, EV1) / NTAG (213, 215, 216) emulation (@turbocooler).

## [v2.0.0][2023-09-26]
- Added `hw slot nick delete` and DELETE_SLOT_TAG_NICK (@doegox)
Expand Down
25 changes: 25 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,31 @@ in a second terminal:
JLinkRTTClient
```
For Windows add these lines to the `tasks.json`:
```json
{
"label": "logs",
"type": "shell",
"command": "C:\\WINDOWS\\System32\\cmd.exe",
"args": ["/K", "C:\\Program Files\\SEGGER\\JLink\\JLinkRTTClient.exe"],
"options": {
"cwd": "C:\\Program Files\\SEGGER\\JLink"
},
"problemMatcher": []
},
{
"label": "logger server",
"type": "shell",
"command": "C:\\WINDOWS\\System32\\cmd.exe",
"args": ["/K", "C:\\Program Files\\SEGGER\\JLink\\JLink.Exe", "-if", "SWD", "-device", "nrf52", "-speed", "4000", "-autoconnect", "1"],
"options": {
"cwd": "C:\\Program Files\\SEGGER\\JLink"
},
"problemMatcher": []
},
```


## Using SWO pin as UART to monitor NRF_LOG

One can set `NRF_LOG_UART_ON_SWO_ENABLED := 1` in `Makefile.defs` to activate this functionality.
Expand Down
2 changes: 1 addition & 1 deletion docs/firmware.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ On a new Chameleon (or after a factory reset), 3 slots are defined, slot 1 holdi

- slot 1 LF: a EM4100 with UID `DEADBEEF88`
- slot 1 HF: a MIFARE Classic 1k with UID `DEADBEEF`
- slot 2 HF: a MIFARE Classic 1k with UID `DEADBEEF`
- slot 2 HF: a MIFARE Classic Ultralight with UID `04689571FA5C64`
- slot 3 LF: a EM4100 with UID `DEADBEEF88`

When a slot is selected, the LED shows what type of card is loaded with the following color code:
Expand Down
48 changes: 48 additions & 0 deletions docs/protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,54 @@ Notes:
* Command: no data
* Response: no data or N bytes: `uidlen|uid[uidlen]|atqa[2]|sak|atslen|ats[atslen]`. UID, ATQA, SAK and ATS as bytes.
* CLI: cf `hw slot list`/`hf mf econfig`/`hf mfu econfig`
### 4019: MF0_NTAG_GET_UID_MAGIC_MODE
* Command: no data
* Response: 1 byte where a non-zero value indicates that UID magic mode is enabled for the current slot.
* CLI: cf `hf mfu econfig`
### 4020: MF0_NTAG_SET_UID_MAGIC_MODE
* Command: 1 byte where a non-zero value indicates that UID magic mode should be enabled for the current slot, otherwise disabled.
* Response: no data
* CLI: cf `hf mfu econfig --enable-uid-magic`/`hf mfu econfig --disable-uid-magic`
### 4021: MF0_NTAG_READ_EMU_PAGE_DATA
* Command: 2 bytes: one for first page index, one for count of pages to be read.
* Response: `4 * n` bytes where `n` is the number if pages to be read
* CLI: cf `hf mfu eview`
### 4022: MF0_NTAG_WRITE_EMU_PAGE_DATA
* Command: 2 + `n * 4` bytes: one for first page index, one for count of pages to be read, `n * 4` for `n` pages data.
* Response: no data
* CLI: unused
### 4023: MF0_NTAG_GET_VERSION_DATA
* Command: no data
* Response: 8 version data bytes.
* CLI: cf `hf mfu econfig`
### 4024: MF0_NTAG_SET_VERSION_DATA
* Command: 8 version data bytes.
* Response: no data
* CLI: cf `hf mfu econfig --set-version <hex>`
### 4025: MF0_NTAG_GET_SIGNATURE_DATA
* Command: no data
* Response: 32 signature data bytes.
* CLI: cf `hf mfu econfig`
### 4026: MF0_NTAG_SET_SIGNATURE_DATA
* Command: 32 signature data bytes.
* Response: no data
* CLI: cf `hf mfu econfig --set-signature <hex>`
### 4027: MF0_NTAG_GET_COUNTER_DATA
* Command: 1 byte for the counter index
* Response: 3 bytes for the counter value (big-endian) + 1 byte for tearing where `0xBD` means tearing flag is not set.
* CLI: cf `hf mfu ercnt`
### 4028: MF0_NTAG_SET_COUNTER_DATA
* Command: 1 byte where the lower 7 bits are the counter index and the top bit indicates whether tearing event flag should be reset + 3 bytes of the counter value (big-endian).
* Response: no data
* CLI: cf `hf mfu ewcnt`
### 4029: MF0_NTAG_RESET_AUTH_CNT
* Command: no data
* Response: 1 byte for the old value of the unsuccessful auth counter.
* CLI: cf `hf mfu econfig --reset-auth-cnt`
### 4030: MF0_NTAG_GET_PAGE_COUNT
* Command: no data
* Response: 1 byte is the number of pages available in the current card slot
* CLI: unused
### 5000: EM410X_SET_EMU_ID
* Command: 5 bytes. `id[5]`. ID as 5 bytes.
* Response: no data
Expand Down
2 changes: 1 addition & 1 deletion firmware/application/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ SRC_FILES += \
$(PROJ_DIR)/rfid/nfctag/hf/crypto1_helper.c \
$(PROJ_DIR)/rfid/nfctag/hf/nfc_14a.c \
$(PROJ_DIR)/rfid/nfctag/hf/nfc_mf1.c \
$(PROJ_DIR)/rfid/nfctag/hf/nfc_ntag.c \
$(PROJ_DIR)/rfid/nfctag/hf/nfc_mf0_ntag.c \
$(PROJ_DIR)/rfid/nfctag/lf/lf_tag_em.c \
$(PROJ_DIR)/utils/dataframe.c \
$(PROJ_DIR)/utils/delayed_reset.c \
Expand Down
Loading

0 comments on commit 28107fc

Please sign in to comment.