411 Commits
Author SHA1 Message Date
Philippe Teuwen 4747d3884d Merge branch 'wip_protocol_refresh'
* wip_protocol_refresh: (38 commits)
  CI for releases
  changelog
  build_firmware.yml: fetch depth=0 to be able to build proper version strings
  Deduce APP_FW_VER from git tag
  bump app version
  style
  colors
  Increase initial button wakeup from 4 to 8 seconds
  Adding MIFARE Ultralight reading, wip
  hf14a_raw: use @expect_response and fix tests
  Fix shadow mode not being preserved. Breaking change: nfc_tag_mf1_write_mode_t has one new mode SHADOW_REQ. Client can set SHADOW or SHADOW_REQ, internally it will be transformed to SHADOW_REQ. When it's time to save data, if SHADOW_REQ, the fw will change it to SHADOW and still allow to save the data before acting as shadow. Breaking: when client reads back MF1 write mode just after settings SHADOW and before saving config, it will receive SHADOW_REQ and must be ready to handle this new enum value.
  MF1_DETECT_SUPPORT: remove redundant data
  Breaking change: DATA_CMD_GET_DEVICE_MODEL to match chameleon_device_type_t
  hw 14a raw: closer to pm3 syntax, removed bit_frame,...
  use field LED also in reader mode
  fix changelog
  new tag_specific_type_t enum, new slotConfig struct. FW will take care of existing slots. Disruptive changes: see below
  Implemented hf 14a raw
  Fixed initialization bugs and added raw command implementation functions.
  Update the table of MFC attack support levels.
  ...
2023-09-26 09:51:25 +02:00
Philippe Teuwen 099fb6b912 CI for releases 2023-09-26 09:51:15 +02:00
Philippe Teuwen b9e5c95480 changelog 2023-09-26 08:42:31 +02:00
Philippe Teuwen b03ef3ec21 build_firmware.yml: fetch depth=0 to be able to build proper version strings 2023-09-26 00:47:58 +02:00
Philippe Teuwen 963d4d62f1 Deduce APP_FW_VER from git tag 2023-09-25 23:32:01 +02:00
Philippe Teuwen 2b4e8b2940 bump app version 2023-09-25 17:30:54 +02:00
Philippe Teuwen 372cfead0c style 2023-09-25 00:51:43 +02:00
Philippe Teuwen e23ad695e6 colors 2023-09-24 23:49:49 +02:00
Thomas BurnhamandPhilippe Teuwen f5b50aa312 Increase initial button wakeup from 4 to 8 seconds
Initial button press wakeup of 4 seconds is sometimes inadequate to establish BT connection. 

This change will expand the Initial button wakeup from 4 seconds to 8 seconds. 

Device sleep behavior after will be as follows:
(Changed)
Initial Button Wakeup to Sleep : 8s 
(No Change)
Subsequent Button Action to Sleep : 4s
Leaving RF Field wake to sleep : 3s
BLE Disconnect to sleep : 4s
USB Power Disconnect to sleep : 3s

Example behavior :
User wakes device with Button B (8 Sec to sleep)
User pushes button B again (Now 4 Sec to sleep) 
User Places device in RF field (Maintain wake)
User removes device from RF field (3 sec to sleep)

If user discontinues the user journey at any point, the identified condition will invoke sleep at defined times.
2023-09-24 22:42:42 +02:00
Philippe Teuwen 7903993504 Adding MIFARE Ultralight reading, wip 2023-09-24 22:30:57 +02:00
Philippe Teuwen 313d772a99 hf14a_raw: use @expect_response and fix tests 2023-09-24 22:30:50 +02:00
Philippe Teuwen 1dc8891e1b Fix shadow mode not being preserved. Breaking change:
nfc_tag_mf1_write_mode_t has one new mode SHADOW_REQ.
Client can set SHADOW or SHADOW_REQ, internally it will be transformed to SHADOW_REQ.
When it's time to save data, if SHADOW_REQ, the fw will change it to SHADOW and still allow to save the data before acting as shadow.
Breaking: when client reads back MF1 write mode just after settings SHADOW and before saving config, it will receive SHADOW_REQ and must be ready to handle this new enum value.
2023-09-24 19:01:20 +02:00
Philippe Teuwen 941d42561a MF1_DETECT_SUPPORT: remove redundant data
cf https://github.com/RfidResearchGroup/ChameleonUltra/pull/147#issuecomment-1732338315
2023-09-24 01:49:26 +02:00
Philippe Teuwen 867ee7bf9b Breaking change: DATA_CMD_GET_DEVICE_MODEL to match chameleon_device_type_t
cf https://github.com/RfidResearchGroup/ChameleonUltra/pull/147#pullrequestreview-1637478473
2023-09-24 01:27:48 +02:00
Philippe Teuwen f7db6d0fb3 hw 14a raw: closer to pm3 syntax, removed bit_frame,...
Now data length is always in bits
Option -o => -a and only needed to turn field on without select or data
Reorganize pcd_14a_reader_raw_cmd
Some more checks
2023-09-24 01:02:30 +02:00
Philippe Teuwen 234b22c48a use field LED also in reader mode 2023-09-24 00:32:48 +02:00
Philippe Teuwen 25f7a91941 fix changelog 2023-09-23 21:38:17 +02:00
Philippe Teuwen 7da58bbce8 new tag_specific_type_t enum, new slotConfig struct. FW will take care of existing slots. Disruptive changes: see below
Disruptive changes:
- tag types are 2-byte long with new values
- GET_SLOT_INFO returns 32 bytes as tag types are now 2-byte long
- "enable" is not common to one slot anymore but bound to the HF or LF part
- GET_ENABLED_SLOTS returns 16 bytes as we get "enabled_hf" and "enabled_lf" for each slot
- SET_SLOT_ENABLE needs 3 bytes slot_number|sense_type|enable as we need to specify to enable HF or LF
- slotConfig changed a lot but this is internal to the fw and its flash and a function does the format conversion on first boot after flash
  so slot data is preserved on fw upgrade, but if one downgrades to a previous version, data will be erased.
2023-09-23 21:34:15 +02:00
dxl 879b8e3459 Implemented hf 14a raw 2023-09-21 18:30:05 +08:00
dxl 499fa35c25 Fixed initialization bugs and added raw command implementation functions. 2023-09-21 18:28:21 +08:00
dxl 86c1a71f7c Update the table of MFC attack support levels. 2023-09-20 11:14:06 +08:00
dxl d31d1af0b8 Merge remote-tracking branch 'origin/wip_protocol_refresh' into wip_protocol_refresh 2023-09-20 11:01:09 +08:00
dxl ad3241aeb9 doc 2023-09-20 11:00:43 +08:00
Philippe Teuwen 14bffafb2a style 2023-09-20 01:26:47 +02:00
Philippe Teuwen cd73ac89ee staticnested.c: translate comments, fix typo 2023-09-19 22:09:15 +02:00
Philippe Teuwen ebb77dc938 recode GB18030..UTF-8 staticnested.c 2023-09-19 22:02:49 +02:00
Philippe Teuwen 3889033815 sigh 2023-09-19 21:47:37 +02:00
Philippe Teuwen 52953de927 changelog & typos in protocol 2023-09-19 21:37:56 +02:00
Philippe Teuwen 5a9d49ddb4 Remove unused MF1_DETECT_DARKSIDE, reallocate 2003 to MF1_STATIC_NESTED_ACQUIRE
MF1_DETECT_DARKSIDE was actually runnign the full attack, as there is no quick way to detect Darkside
So if you want to check for Darkside, just run directly MF1_DARKSIDE_ACQUIRE.
2023-09-19 16:03:20 +02:00
Philippe Teuwen 624e96aee9 fix compilation 2023-09-19 13:18:02 +02:00
dxl f0ddd07108 A bug has been marked and is waiting to be fixed. 2023-09-19 18:25:01 +08:00
dxl 32b3e19279 Added support for StaticNested(FastDecrypt). 2023-09-19 18:24:30 +08:00
Philippe Teuwen 42d9f160d9 typo 2023-09-19 10:15:42 +02:00
Philippe Teuwen ff20eb9c68 simplify anticol+ATS, my fault 2023-09-19 01:35:51 +02:00
Philippe Teuwen 6ce61c1720 changelog 2023-09-19 00:38:09 +02:00
Augusto Zanellato 09eb0d19f4 Automatically send RATS to 14443-4a tags 2023-09-19 00:32:52 +02:00
Philippe Teuwen 9497ff7eab Add timeout parameter to hw raw 2023-09-18 23:20:18 +02:00
Philippe Teuwen c9261cc6eb Darkside: use LEDs for feedback 2023-09-18 22:44:15 +02:00
Philippe Teuwen 782905f202 fix Darkside 2023-09-18 22:44:15 +02:00
Philippe Teuwen 8499535aad Clarify protocol. Disruptive changes: see below
This huge commit tries to enhance several things related to the fw/cli protocol.
Generally, the idea is to be verbose, explicit and reuse conventions, in order to enhance code maintainability and understandability for the other contributors.

docs/protocol.md got heavily updated

Many commands have been renamed for consistency. you are invited to adapt your client for easier maintenance

Guidelines, also written in docs/protocol.md "New data payloads: guidelines for developers":
- Now protocol data exchanged over USB or BLE are defined in netdata.h as packed structs and values are stored in Network byte order (=Big Endian)
- Command-specific payloads are defined in their respective cmd_processor handler in app_cmd.c and chameleon_cmd.py
- Define C `struct` for cmd/resp data greater than a single byte, use and abuse of `struct.pack`/`struct.unpack` in Python. So one can understand the payload format at a simple glimpse.
- If single byte of data to return, still use a 1-byte `data`, not `status`.
- Use unambiguous types such as `uint16_t`, not `int` or `enum`. Cast explicitly `int` and `enum` to `uint_t` of proper size
- Use Network byte order for 16b and 32b integers
  - Macros `U16NTOHS`, `U32NTOHL` must be used on reception of a command payload.
  - Macros `U16HTONS`, `U32HTONL` must be used on creation of a response payload.
  - In Python, use the modifier `!` with all `struct.pack`/`struct.unpack`
- Concentrate payload parsing in the handlers, avoid further parsing in their callers. This is true for the firmware and the client.
- In cmd_processor handlers: don't reuse input `length`/`data` parameters for creating the response content
- Avoid hardcoding offsets, use `sizeof()`, `offsetof(struct, field)` in C and `struct.calcsize()` in Python
- Use the exact same command and fields names in firmware and in client, use function names matching the command names for their handlers unless there is a very good reason not to do so. This helps grepping around. Names must start with a letter, not a number, because some languages require it (e.g. `14a_scan` not possible in Python)
- Respect commands order in `m_data_cmd_map`, `data_cmd.h` and `chameleon_cmd.py` definitions
- Even if a command is not yet implemented in firmware or in client but a command number is allocated, add it to `data_cmd.h` and `chameleon_cmd.py` with some `FIXME: to be implemented` comment
- Validate data before using it, both when receiving command data in the firmware and when receiving response data in the client.
- Validate response status in client.

Disruptive changes:
- GET_DEVICE_CAPABILITIES: list of cmds in data are now really Big Endian
  Note: the initial attempt to use macros PP_HTONS were actually considering wrongly that the platform was Big Endian (BYTE_ORDER was actually undefined) while it is actually Little Endian.
- GET_APP_VERSION: response is now a tuple of bytes: major|minor (previously it was in reversed order as a single uint16_t in Little Endian)
- SET_SLOT_TAG_TYPE: tag_type now on 2 bytes, to prepare remapping of its enum
- SET_SLOT_DATA_DEFAULT: tag_type now on 2 bytes, to prepare remapping of its enum
- GET_SLOT_INFO: tag_type now on 2 bytes, to prepare remapping of its enum
- GET_DEVICE_CHIP_ID: now returns its 64b ID following Network byte order (previously, bytes were in the reverse order)
- GET_DEVICE_ADDRESS: now returns its 56b address following Network byte order (previously, bytes were in the reverse order). CLI does not reverse the response anymore so it displays the same value as before.
- MF1_GET_DETECTION_COUNT: now returns its 32b value following Network byte order (previously Little Endian)
- GET_GIT_VERSION response status is now STATUS_DEVICE_SUCCESS
- GET_DEVICE_MODEL response status is now STATUS_DEVICE_SUCCESS
- MF1_READ_EMU_BLOCK_DATA response status is now STATUS_DEVICE_SUCCESS
- GET_DEVICE_CAPABILITIES response status is now STATUS_DEVICE_SUCCESS
- HF14A_SCAN: entirely new response format, room for ATS and multiple tags
- MF1_DETECT_SUPPORT response status is now HF_TAG_OK and support is indicated as bool in 1 byte of data
- MF1_DETECT_PRNG response status is now HF_TAG_OK and prng_type is returned in 1 byte of data with a new enum mf1_prng_type_t == MifareClassicPrngType
- MF1_DETECT_DARKSIDE response status is now HF_TAG_OK and darkside_status is returned in 1 byte of data with a new enum mf1_darkside_status_t == MifareClassicDarksideStatus
- MF1_DARKSIDE_ACQUIRE response status is now HF_TAG_OK and darkside_status is returned in 1 byte of data. If OK, followed by 24 bytes as previously
- MF1_GET_ANTI_COLL_DATA: in case slot does not contain anticoll data, instead of STATUS_PAR_ERR, now it returns STATUS_DEVICE_SUCCESS with empty data
- MF1_SET_ANTI_COLL_DATA and MF1_GET_ANTI_COLL_DATA now use the same data format as HF14A_SCAN

For clients to detect Ultra/Lite with older firmwares, one can issue the GET_APP_VERSION and urge the user to flash his device if needed.
On older firmwares, it will return a status=b'\x00' and data=b'\x00\x01' while up-to-date firmwares will return status=STATUS_DEVICE_SUCCESS and data greater or equal to b'\x01\x00' (v1.0).

Other changes: cf CHANGELOG, and probably a few small changes I forgot about..

TODO:
- remap `tag_specific_type_t` enum to allow future tags (e.g. LF tags) without reshuffling enum and affecting users stored cards
- TEST!
2023-09-18 00:53:39 +02:00
dxl 98605be5b8 Fixed some bugs caused by closing pairing. 2023-09-14 10:52:05 +08:00
Philippe TeuwenandGitHub 4c43bca906 Merge pull request #150 from taichunmin/taichunmin
Docs: Add sdk.md
2023-09-13 01:51:02 +02:00
jimmytai 0db0d852cb sdk docs 2023-09-13 07:45:43 +08:00
Philippe TeuwenandGitHub 92599df531 Merge pull request #149 from aramova/patch-1
Update nomenclature technical_whitepaper.md
2023-09-13 01:18:36 +02:00
Thomas BurnhamandGitHub 5f36600cda Update nomenclature technical_whitepaper.md
Simulation and emulation used within same document while having no distinctive technical differentiating usage, propose changing all instances to Emulate/Emulation
2023-09-12 17:47:50 -04:00
Philippe Teuwen a43f4b96fc Fix get_slot_tag_nick_name in fw: data was deallocated before being sent 2023-09-11 10:02:23 +02:00
Philippe Teuwen 00a0019ef3 protocol note on LRC computations 2023-09-10 12:47:26 +02:00
Philippe TeuwenandGitHub 930d9f588b Merge pull request #140 from aenigma-es/main
Solved bug that makes hf mf eread command crashes
2023-09-09 23:59:23 +02:00
Eremita Solitario 6d2eb1761f Solved bug that makes hf mf eread command crashes 2023-09-09 23:32:53 +02:00
Philippe Teuwen 0dc83b4f5b troubleshooting 2023-09-08 09:57:22 +02:00
DXLandPhilippe Teuwen 9431a2c26c Reset FDT without requiring a response. 2023-09-08 09:11:30 +02:00
dxlandPhilippe Teuwen 84c31000ae No reset nfc core after field lost. 2023-09-08 09:11:30 +02:00
Philippe Teuwen edadfab729 test to rollback to 1st DXL patch... 2023-09-08 09:11:30 +02:00
Philippe TeuwenandGitHub a793810f59 Merge pull request #132 from Foxushka/simplify-code
block_count can't be more than 0xFF, simplify code
2023-09-08 09:05:55 +02:00
Foxushka e5c03f2d8b Explain limit 2023-09-07 22:26:38 +03:00
Foxushka d4925f586f Add 32 block limit 2023-09-07 22:22:50 +03:00
Philippe TeuwenandGitHub 6a5afb752d Merge pull request #131 from Foxushka/bump-settings
Update cmd_processor_get_settings
2023-09-07 20:04:44 +02:00
Philippe Teuwen e888115d3f build.sh: assoiative arrays are available only since Bash 4 and MacOS is still on some Bash 3... 2023-09-07 19:58:34 +02:00
Foxushka 1ac071e449 block_count can't be move than 0xFF, simplify code 2023-09-07 20:07:38 +03:00
Foxushka 6e4d861625 Update version in docstring 2023-09-07 19:41:57 +03:00
Foxushka dbf4599221 Update cmd_processor_get_settings 2023-09-07 19:40:50 +03:00
dxl b3e0afc555 Enable BLE pairing by setting and disable by default. 2023-09-07 20:04:24 +08:00
Philippe Teuwen 922c025bf3 Fix issue #114 2023-09-07 10:47:13 +02:00
Philippe Teuwen 9b1fc863c3 style 2023-09-07 08:46:38 +02:00
Philippe Teuwen bc874f68ef doc 2023-09-07 08:44:03 +02:00
Philippe TeuwenandGitHub 1bb6840fba Merge pull request #104 from Foxushka/software-capabilities
Get device capabilities
2023-09-07 08:42:19 +02:00
DXLandGitHub 12fa994a03 Merge pull request #130 from whywilson/main
Add MTools Lite link and quickstart documents.
2023-09-07 11:32:07 +08:00
Wilson 2e38664792 Add MTools Lite link and quickstart documents. 2023-09-07 11:20:33 +08:00
Philippe TeuwenandGitHub e3d51a4d64 Merge pull request #129 from mitmarcus/patch-7
Update README.md
2023-09-07 00:27:21 +02:00
mitmarcusandGitHub db0170903c Update README.md
add new video about gui
2023-09-06 23:52:08 +03:00
Foxushka 902deed362 Eh 2023-09-06 23:47:10 +03:00
Foxushka 0398d7e9a8 Lite doesn't have this exported 2023-09-06 23:45:32 +03:00
FoxushkaandGitHub 2867c7d56c Update CHANGELOG 2023-09-06 20:42:13 +00:00
FoxushkaandGitHub cc9a10bcc8 Update CHANGELOG 2023-09-06 20:42:03 +00:00
Foxushka 2e912285f5 Implement DATA_CMD_GET_MF1_ANTI_COLL_DATA and DATA_CMD_GET_SETTINGS 2023-09-06 23:36:43 +03:00
Foxushka 55a70fc2e5 Move to PP_HTONS 2023-09-06 22:55:26 +03:00
FoxushkaandGitHub 58d43a36c4 Merge branch 'main' into software-capabilities 2023-09-06 22:34:57 +03:00
Philippe TeuwenandGitHub 47aed37751 Merge pull request #126 from mitmarcus/patch-6
Update README.md
2023-09-05 13:27:06 +02:00
mitmarcusandGitHub ea67c5cec5 Update README.md 2023-09-05 14:21:48 +03:00
mitmarcusandGitHub 7fe61d995b Update README.md
groupped documentation to be more readable
2023-09-05 14:09:33 +03:00
Philippe TeuwenandGitHub 62946387a8 Merge pull request #125 from mitmarcus/patch-5
Update README.md
2023-09-05 10:56:03 +02:00
mitmarcusandGitHub ec8da03206 Update README.md
fix typo
2023-09-05 11:52:40 +03:00
Philippe TeuwenandGitHub e0556857f2 Merge pull request #124 from mitmarcus/patch-4
Update modding.md
2023-09-05 10:35:59 +02:00
Philippe TeuwenandGitHub cef9efc5f5 Merge pull request #123 from mitmarcus/patch-3
Update troubleshooting.md
2023-09-05 10:34:22 +02:00
mitmarcusandGitHub a3cf711cac Update modding.md
found 1 more project
2023-09-05 11:26:09 +03:00
mitmarcusandGitHub 476775a701 Update troubleshooting.md
reminding people to turn on location setting in android
2023-09-05 10:51:02 +03:00
Philippe Teuwen 5a9ca62d2a doc 2023-09-04 23:16:19 +02:00
dxl 05b2270049 Merge remote-tracking branch 'origin/main' 2023-09-04 18:32:21 +08:00
dxl 9af1c4330c Delete unused function 2023-09-04 18:29:59 +08:00
Philippe Teuwen d928ab2285 docs 2023-09-03 15:41:26 +02:00
DXLandGitHub f934f54e0d Chameleon Lite emulation bug fixed 2023-09-03 19:26:26 +08:00
paul.73andGitHub 4bdec10538 Update CHANGELOG.md 2023-09-03 13:16:01 +02:00
paul.73andGitHub c9c3ad1d7a Chameleon Lite emulation bug fixed 2023-09-03 13:15:24 +02:00
Philippe Teuwen 76168621b4 style 2023-09-02 22:24:15 +02:00
Philippe Teuwen d50e1437b7 changelog 2023-09-02 22:22:52 +02:00
DXLandGitHub cda241361c Merge pull request #121 from xianglin1998/main
Mfc 1k Full emulation (not UID only) with OEM readers bugs fixed.
2023-09-03 04:09:52 +08:00
dxl f134b4f16a Mfc 1k Full emulation (not UID only) with OEM readers bugs fixed. 2023-09-03 03:38:23 +08:00
Philippe Teuwen 7506e64bc8 Mods 2023-09-01 20:17:36 +02:00
Philippe TeuwenandGitHub f54879b364 Merge pull request #120 from mitmarcus/patch-2
Update chameleonultragui.md
2023-09-01 12:27:55 +02:00
Philippe TeuwenandGitHub 150666899b Merge pull request #119 from mitmarcus/patch-1
Update firmware.md
2023-09-01 12:24:25 +02:00
Philippe TeuwenandGitHub 65845fd7f5 Update docs/firmware.md 2023-09-01 12:24:19 +02:00
mitmarcusandGitHub 5e1a502005 Update chameleonultragui.md
based on cyber.vi.king's and gametec_live's comment on this
2023-09-01 13:01:03 +03:00
mitmarcusandGitHub 4fcc2f565e Update firmware.md 2023-09-01 12:45:42 +03:00
mitmarcusandGitHub 93141e3e6c Update firmware.md
explanation on write modes provided by GameTec_live
2023-09-01 12:28:38 +03:00
Philippe TeuwenandGitHub 578255a0bf Merge pull request #118 from Foxushka/patch-2
Fix Chameleon crashes in BLE pairing
2023-08-31 01:07:28 +02:00
FoxushkaandGitHub 51b15ea90d Fix Chameleon crashes in BLE pairing 2023-08-30 18:49:05 +00:00
Philippe TeuwenandGitHub 5f530ad551 Merge pull request #117 from taichunmin/taichunmin
Docs: protocol.md
2023-08-30 20:20:35 +02:00
jimmytai 80a7054c7c Docs: protocol 2023-08-30 23:08:16 +08:00
Philippe TeuwenandGitHub 98813ca67e Merge pull request #116 from Foxushka/patch-1
Fix links and correct OS namings
2023-08-30 16:08:03 +02:00
FoxushkaandGitHub 327e6c06e5 Fix links and correct OS namings 2023-08-30 13:40:14 +00:00
Philippe TeuwenandGitHub 209867a76c Merge pull request #115 from drego85/patch-1
Added software for macOS
2023-08-30 15:35:46 +02:00
Andrea DraghettiandGitHub d57a24073b Update quickstart.md 2023-08-30 11:48:29 +02:00
Philippe TeuwenandGitHub a41322efae Merge pull request #109 from digitalcardboard/patch-1
Update cli.md
2023-08-30 10:18:50 +02:00
Philippe Teuwen c70165fafa bugreport templates 2023-08-30 00:05:50 +02:00
Philippe Teuwen f80e7fe14e doc ble 2023-08-29 13:09:24 +02:00
Jason NavarreteandGitHub 81f6dd2473 Update cli.md
Installing ninja fails without updating keys.
2023-08-28 21:33:36 -07:00
Philippe Teuwen 58e310c0c7 autopep8: increase line size to 120, else satest style will be reverted again 2023-08-28 09:49:00 +02:00
Philippe Teuwen 4272d7661a Fix GET_DEVICE crash 2023-08-28 09:48:05 +02:00
Foxushka d22ff44342 DATA_CMD_GET_DEVICE_CAPABILITIES implementation 2023-08-28 09:12:48 +03:00
Philippe Teuwen 845cae95ab Limit max battery info to 100% 2023-08-28 01:07:29 +02:00
Philippe Teuwen 7acc7e93dd #error 2023-08-28 01:07:29 +02:00
Philippe Teuwen bd3961077c CLI now takes into account Lite refusing to enter reader mode 2023-08-28 01:07:27 +02:00
dxl ae6df052f5 Changelog Updated 2023-08-28 01:51:18 +08:00
dxl 79809e3119 Merge remote-tracking branch 'origin/main' 2023-08-28 01:48:12 +08:00
dxl 2a98245700 Security BLE implemented 2023-08-28 01:40:04 +08:00
dxl df0263edc7 Added some precautions to the comments. 2023-08-28 01:39:36 +08:00
dxl c5c5de5d3c Added setting option for BLE connection key. 2023-08-28 01:38:17 +08:00
dxl 24c3cc86d6 Added cmd for ble bonds . 2023-08-28 01:37:26 +08:00
dxl d76fbd440c Added commands related to BLE pairing binding. 2023-08-28 01:35:57 +08:00
dxl ecec3c4e59 Fix compiler 2023-08-28 01:35:07 +08:00
Philippe Teuwen c0876aa11b noconfirm 2023-08-27 13:56:23 +02:00
Philippe Teuwen c56a7cc8bf troubleshooting 2023-08-27 13:53:03 +02:00
Philippe TeuwenandGitHub 54178eaa89 Merge pull request #101 from szymex73/fix-multicommand
Fix a bug in multiline command implementation
2023-08-26 20:50:23 +02:00
Philippe TeuwenandGitHub 52d7e7b0e0 Merge pull request #100 from szymex73/fix-argcomplete
Fix argument autocompleter bug (#97)
2023-08-26 20:47:38 +02:00
Szymon Borecki 9ee5d3a73e Fix a bug where a KeyboardInterrupt would trigger an error and crash the app 2023-08-26 19:31:35 +02:00
Szymon BoreckiandGitHub ea25fd14c1 Merge branch 'main' into fix-argcomplete 2023-08-26 19:26:20 +02:00
Szymon Borecki 5122246072 Fix argument autocompleter bug (#97) 2023-08-26 19:24:41 +02:00
Philippe TeuwenandGitHub daa32d0840 Merge pull request #99 from taichunmin/device-address
Fix device address is not the same with APP
2023-08-26 16:19:45 +02:00
jimmytai 5c3089ac3d Fix device address is not the same with APP 2023-08-26 22:15:23 +08:00
Philippe TeuwenandGitHub f2792c86d9 Merge pull request #98 from uhei/doc-mtools
docs: add links for MTools
2023-08-26 15:54:05 +02:00
Uli Heilmeier c2f29de9b0 docs: add links for MTools 2023-08-26 15:13:31 +02:00
Philippe Teuwen 94164093b0 cli doc fix by @GameTec-live 2023-08-26 12:29:05 +02:00
Philippe Teuwen 04741bdc2a autopep8 2023-08-26 12:06:15 +02:00
Philippe Teuwen f008e8bebc Add autopep8 to make_style script 2023-08-26 12:05:18 +02:00
Philippe Teuwen 86fcaa3d56 typos & style 2023-08-26 04:42:40 +02:00
Philippe Teuwen d5d955d2e9 pylance 2023-08-26 02:55:46 +02:00
Philippe Teuwen a596e98bf7 python style 2023-08-26 02:24:08 +02:00
Philippe Teuwen 65368dffff deadbeef 2023-08-26 01:52:40 +02:00
Philippe Teuwen d08c8c4605 Close properly after factory reset, fix typo 2023-08-26 01:48:30 +02:00
Philippe TeuwenandGitHub 1a1cb5b10e Merge pull request #95 from gentilkiwi/patch-1
Fix multiple Chameleon connected on WSL1
2023-08-26 00:34:58 +02:00
Benjamin DELPYandGitHub 3bf25f1766 Fix multiple Chameleon connected on WSL1
Avoid

```
Chameleon Connect fail: [Errno 2] could not open port /dev/ttyS15
/dev/ttyS39: [Errno 2] No such file or directory: '/dev/ttyS15\r\n/dev/ttyS39'
```

By only returning the first COM port with `VID_6868&PID_8686`
2023-08-26 00:31:44 +02:00
Philippe Teuwen 5c36004e9c doc 2023-08-26 00:16:43 +02:00
Philippe Teuwen 590a45eddc style 2023-08-25 23:55:12 +02:00
Philippe TeuwenandGitHub c8a2b52982 Merge pull request #94 from gentilkiwi/patch-1
Fix compilation problem error: a label can only be part of a stateme…
2023-08-25 23:53:51 +02:00
Philippe Teuwen 86067576d8 doc 2023-08-25 23:51:51 +02:00
Philippe Teuwen 249cadc736 reorg doc 2023-08-25 23:41:25 +02:00
Benjamin DELPYandGitHub 0ebbc56f7c Fix compilation problem error: a label can only be part of a statement and a declaration is not a statement
Please avoid creating variable in middle of functions, and in this particular case double `uint8_t status;`.

Can be valid for some compiler, but does not help to read the code.
2023-08-25 23:33:40 +02:00
Philippe Teuwen 6d096df88b readme 2023-08-25 22:55:05 +02:00
Philippe TeuwenandGitHub 033369e7c0 Merge pull request #89 from GameTec-live/users-guide
Adding a (not so) basic users guide
2023-08-25 22:41:23 +02:00
Philippe Teuwen 591b03e1b3 emojis 2023-08-25 22:37:44 +02:00
Philippe Teuwen c6030c8fdf Remove command ID, there is no 1-1 mapping between cli commands and fw commands and it's more a concern for devs than uers 2023-08-25 22:25:57 +02:00
Philippe TeuwenandGitHub b4b48fe793 Merge branch 'main' into users-guide 2023-08-25 22:22:13 +02:00
Philippe Teuwen 1a4fcdda01 doc 2023-08-25 22:16:07 +02:00
GameTec_live 6d4dee4247 Merge branch 'users-guide' of https://github.com/GameTec-live/ChameleonUltra into users-guide 2023-08-25 21:17:38 +02:00
GameTec_live 0d9ad25765 cli 2023-08-25 21:17:21 +02:00
1adbc915ce Update docs/firmware.md
Co-authored-by: Philippe Teuwen <phil-github@teuwen.org>
2023-08-25 20:07:59 +02:00
Philippe Teuwen 05f25e830c More Chinese (auto) translation 2023-08-25 19:51:27 +02:00
Philippe Teuwen 2ba2ca92fd More Chinese (auto) translation 2023-08-25 19:40:46 +02:00
GameTec_live 62392a671c moved dev, added ideas for fw section 2023-08-25 19:21:31 +02:00
GameTec_live bf3b93622d fix z height 2023-08-25 18:55:35 +02:00
GameTec_live 7c5eb55fdf remove floating Β΄ 2023-08-25 18:51:50 +02:00
ef300fbbfe Update docs/hardware.md
Co-authored-by: Philippe Teuwen <phil-github@teuwen.org>
2023-08-25 18:51:04 +02:00
4731d04c3f Update docs/home.md
Co-authored-by: Philippe Teuwen <phil-github@teuwen.org>
2023-08-25 18:50:40 +02:00
e063c99b71 Update docs/hardware.md
Co-authored-by: Philippe Teuwen <phil-github@teuwen.org>
2023-08-25 18:50:17 +02:00
f783f3a35b Update docs/hardware.md
Co-authored-by: Philippe Teuwen <phil-github@teuwen.org>
2023-08-25 18:49:38 +02:00
1e6a153c7e Update docs/hardware.md
Co-authored-by: Philippe Teuwen <phil-github@teuwen.org>
2023-08-25 18:48:09 +02:00
34d6d79306 Update docs/hardware.md
Co-authored-by: Philippe Teuwen <phil-github@teuwen.org>
2023-08-25 18:47:34 +02:00
03665b778d Update docs/hardware.md
Co-authored-by: Philippe Teuwen <phil-github@teuwen.org>
2023-08-25 18:46:07 +02:00
34974bafcd Update docs/hardware.md
Co-authored-by: Philippe Teuwen <phil-github@teuwen.org>
2023-08-25 18:45:55 +02:00
f35e288cad Update docs/hardware.md
Co-authored-by: Philippe Teuwen <phil-github@teuwen.org>
2023-08-25 18:45:37 +02:00
GameTec_live b58bf57d28 fix links 2023-08-25 18:06:48 +02:00
Philippe Teuwen 7ff6a0b3a2 Allow pasting multiple commands at once, as it was with readline 2023-08-25 17:57:12 +02:00
GameTec_live 6ba03eee2e hw done 2023-08-25 17:52:18 +02:00
Philippe Teuwen c24e69b44c Allow to interrupt sleep sequence during final animation with a simple button press.
Because otherwise one must wait for sleep animation to finish, then press button then wait for boot animation to finish...

Also, fix saved config CRC after config has been saved
2023-08-25 13:41:23 +02:00
Philippe Teuwen ef46b22d69 Fixed logs corruption and app reset on FDS write, added logs flush on sleep
Bug when NRF_LOG_DEFERRED=0
due to a userland NRF_LOG_INFO after FDS record update was initiated, interrupted by FDS record IRQ handler and its own NRF_LOG_INFO
resulting in
<error> app: Fatal error
<warning> app: System reset

Added a few more NRF_LOG in FDS module as well.
Added NRF_LOG_FLUSH in system_off_enter to not miss last messages.
2023-08-25 13:18:06 +02:00
GameTec_live f5b32c76dd commiting changes is useful... 2023-08-24 20:08:52 +02:00
GameTec_live 3efdc3d251 lite 2023-08-24 18:46:04 +02:00
Philippe Teuwen 727cd5e6fa CRLF and typo 2023-08-24 18:42:27 +02:00
GameTec_live 598bc300d9 change to seperate files 2023-08-24 18:11:37 +02:00
Philippe Teuwen 938f2b312c offline copy IC/ID: don't skip HF if LK ok 2023-08-24 17:41:18 +02:00
Philippe Teuwen 7f569113a0 CLI check python version 2023-08-24 17:00:05 +02:00
Philippe Teuwen 8d75ae45c4 clearer(?) comments on settings migration 2023-08-24 16:49:40 +02:00
dxl 585748e302 Fix the space allocation bug and initialization bug in the settings. 2023-08-24 21:20:01 +08:00
GameTec_live cd94f07604 ultra HW 2023-08-24 11:48:55 +02:00
Philippe TeuwenandGitHub 8570afc440 Merge pull request #88 from nemanjan00/long-press
Add long press
2023-08-24 11:05:04 +02:00
Philippe Teuwen 3baa0e6633 button press logs 2023-08-24 10:54:22 +02:00
Philippe Teuwen 1ebeb9b461 fix btnpress info dump 2023-08-24 10:44:19 +02:00
GameTec_live 2ca0135e62 add gude md file 2023-08-24 10:27:49 +02:00
Philippe Teuwen 728472e672 comment accepted too fast before I fixed it :) 2023-08-24 09:55:01 +02:00
a856936203 Update firmware/application/src/app_main.c
Thanks @doegox

Co-authored-by: Philippe Teuwen <phil-github@teuwen.org>
2023-08-24 09:51:35 +02:00
Nemanja Nedeljkovic a01158f323 Remove parameter from --long 2023-08-24 08:50:55 +02:00
Nemanja Nedeljkovic f45cf5b406 Move log and add github username 2023-08-24 08:46:42 +02:00
Nemanja Nedeljkovic b2851251d1 Forgot about this 2023-08-23 19:39:20 +02:00
Nemanja Nedeljkovic 9db1dd37c0 Changelog 2023-08-23 19:34:31 +02:00
Nemanja Nedeljkovic 6e9582f4f2 Fix bug 2023-08-23 19:32:49 +02:00
Nemanja Nedeljkovic 60cc62d3c9 Add long press command 2023-08-23 19:29:25 +02:00
Nemanja Nedeljkovic 1ff0be6ed8 Add long press command 2023-08-23 19:29:03 +02:00
Nemanja Nedeljkovic 06023d4121 Add long press command 2023-08-23 19:18:47 +02:00
Nemanja Nedeljkovic 6f21856e5d Add long press 2023-08-23 19:08:55 +02:00
Philippe TeuwenandGitHub 5c6273905a Merge pull request #85 from augustozanellato/fix_successive_builds
Fix stuff I broke yesterday
2023-08-23 18:10:01 +02:00
Augusto Zanellato 9d5cf21182 Fix non-clean builds failure
Fix flash-dfu-* scripts being now broken
2023-08-23 13:58:27 +02:00
Philippe Teuwen e7e4be04d0 translate fw app comments 2023-08-23 03:56:42 +02:00
Philippe TeuwenandGitHub dbda8b92fb Merge pull request #73 from m-kozlowski/wsl-autodetect
Add port auto detection on WSL1
2023-08-23 01:03:03 +02:00
Philippe Teuwen ece04d7384 style helpers 2023-08-23 00:51:42 +02:00
Philippe Teuwen e3ff2d0d95 C files: same style as for pm3 repo 2023-08-23 00:22:22 +02:00
Philippe Teuwen 37c99cece0 tabs to 4 spaces 2023-08-23 00:20:01 +02:00
Philippe Teuwen e43e668594 Remove tabs & spaces at end of lines 2023-08-23 00:18:31 +02:00
Philippe TeuwenandGitHub 18c6307673 Merge pull request #83 from nemanjan00/editorconfig
Editorconfig for py, c, h
2023-08-22 23:52:58 +02:00
Philippe TeuwenandGitHub 40b90aca74 Merge pull request #84 from augustozanellato/rework_st_delete
Remove restrictions from slot delete
2023-08-22 23:50:27 +02:00
Philippe TeuwenandGitHub fdc269a46a Merge branch 'main' into rework_st_delete 2023-08-22 23:50:21 +02:00
Philippe TeuwenandGitHub 989c7239f8 Merge pull request #80 from augustozanellato/refactor_ci
CI refactor
2023-08-22 23:46:02 +02:00
Philippe TeuwenandGitHub 27f2a4033c Merge pull request #82 from nemanjan00/offline-confirmation
Offline read status notification with LEDs
2023-08-22 23:42:45 +02:00
Philippe Teuwen 074168365f Rewrote offline uid copy to avoid 2 mode swaps
We also skip HF if we managed to clone a LF tag.
2023-08-22 23:40:22 +02:00
Philippe Teuwen ab9e9bad14 Fix offline_status_blink_color which was breaking following HF reader
this one took me so long to debug...
2023-08-22 23:38:09 +02:00
Augusto Zanellato 5f27cef975 Remove restrictions from slot delete 2023-08-22 23:30:33 +02:00
Philippe Teuwen 7ed8005a26 Fix tag_mode_enter short LF field trigger when leaving reader mode 2023-08-22 22:47:44 +02:00
Nemanja Nedeljkovic bbd0a730c7 Fix indentation 2023-08-22 21:03:37 +02:00
Augusto Zanellato 4bdbb8d450 Rework CI pipeline
Changes made:
 - CI properly supports being ran on PRs and shouldn't fail anymore on
   the RRG repo;
 - The nonsense of unzipping archives during release creation isn't
   needed anymore because now there's an artifact that holds all the
   files (both zip and others) that should be included in a release;
 - Softdevice and Application verification were re-enabled (as per
   @doegox suggestion);
 - Softdevice is now bundled in `-firmware` artifact;
 - `dev` release tag is now updated ad every push to main;
 - On PRs a comment linking to artifact is now added by CI after
   success, artifact links are done with nightly.link so that they also
   fork for unauthenticated users;

There are some quirks:
 - on_pr runs on pull_request_target because it needs write access to
   packages, but pull_request_target implies that GITHUB_SHA is set to
   the base repo HEAD commit, so the whole `checkout-sha` thing is
   needed. This also implies that if one of the workflow files are
   changed in a PR the changed versions won't be ran against that same
   PR.
 - Client building per OS isn't yet implemented but all the necessary
   scaffolding is there. At the moment the per-OS clients are just a zip
   file containing all the client source.

Examples:
  - PR comment: https://github.com/augustozanellato/ChameleonUltra/pull/14#issuecomment-1688737709
  - `dev` release: https://github.com/augustozanellato/ChameleonUltra/releases/tag/dev
2023-08-22 20:58:01 +02:00
Nemanja Nedeljkovic 012cc8c2a9 Add status for LF 2023-08-22 20:46:03 +02:00
Nemanja Nedeljkovic 2cd1f66ae3 Merge branch 'main' into offline-confirmation 2023-08-22 20:44:51 +02:00
Nemanja Nedeljkovic 3a462981c0 Editorconfig for py, c, h 2023-08-22 20:42:00 +02:00
Philippe Teuwen 95aded8267 changelog 2023-08-22 20:38:13 +02:00
Philippe TeuwenandGitHub 10a07419bf Merge pull request #79 from nemanjan00/offline-lf
Offline clone of LF UID
2023-08-22 20:36:31 +02:00
Nemanja Nedeljkovic 41a368a99d Fix structure 2023-08-22 20:31:41 +02:00
Philippe Teuwen 2ce2e25827 fix USB LED animation color on slot change 2023-08-22 19:44:20 +02:00
Nemanja Nedeljkovic 20d56517b1 Success color green 2023-08-22 18:52:05 +02:00
Nemanja Nedeljkovic b72294a4b7 Offline Confirmation by LED 2023-08-22 18:51:02 +02:00
Nemanja Nedeljkovic 30f3ddde88 Offline HF and LF 2023-08-22 17:32:50 +02:00
Nemanja Nedeljkovic 32934802fd Leave reader mode before exiting 2023-08-22 17:14:59 +02:00
Nemanja Nedeljkovic 6d77fc87a7 First become reader 2023-08-22 17:11:31 +02:00
Nemanja Nedeljkovic d5485f33a4 Draft code 2023-08-22 15:16:56 +02:00
dxl 120971c466 Fixed chameleon lite compile failed. 2023-08-22 20:15:05 +08:00
dxl ed4a84ccc6 Merge branch 'main' of https://github.com/RfidResearchGroup/ChameleonUltra 2023-08-22 20:01:32 +08:00
dxl 7355d512dd Offline ic tag uid copied implemented. 2023-08-22 20:01:03 +08:00
dxl 76643183ea Impl change the button function when click. 2023-08-22 19:58:33 +08:00
Philippe TeuwenandGitHub 352704d5fa Merge pull request #77 from sgnusov/main
Fix setting slot nick
2023-08-22 11:44:05 +02:00
mkozlowski 961b8a58f3 Faster COM port detection 2023-08-22 11:37:12 +02:00
Sgnusov d17c63f298 Fix setting slot nick 2023-08-22 09:34:24 +00:00
mkozlowski aa3d3e40b4 Fallback to default path when powershell.exe is not found in PATH 2023-08-22 11:23:50 +02:00
mkozlowski 9922dc5b50 Fallback to default path when powershell.exe is not found in PATH 2023-08-22 11:22:59 +02:00
dxl 68a3e463f1 Add command to get battery information #38 2023-08-22 12:05:48 +08:00
mkozlowski 6e411dc50c WSL2 doesn't need special handling 2023-08-21 21:33:17 +02:00
mkozlowski 2f0d4edb04 Add com port auto detection on WSL1 2023-08-21 19:57:03 +02:00
Philippe Teuwen 448188af7a changelog 2023-08-21 18:01:38 +02:00
Philippe TeuwenandGitHub 6073b5cbf3 Merge pull request #72 from augustozanellato/delete_slot_st
Add ability to delete sense type per slot
2023-08-21 17:59:05 +02:00
Augusto Zanellato d33ae755c1 Add ability to delete sense type per slot 2023-08-21 16:38:11 +02:00
Philippe Teuwen 4aea618650 changelog 2023-08-21 02:48:13 +02:00
Philippe TeuwenandGitHub da43f37838 Merge pull request #69 from szymex73/cli-history
Store CLI history in ~/.chameleon_history
2023-08-21 02:46:58 +02:00
Philippe Teuwen ce5c8a3b9d oops authors confusion in changelog 2023-08-21 02:45:08 +02:00
Philippe Teuwen d5f15b5f54 fix yml 2023-08-21 02:35:46 +02:00
Philippe Teuwen 8470c51d4a run CI on PR as well, skip if commit does not touch firmware code 2023-08-21 02:31:02 +02:00
Philippe Teuwen 423d212cf7 add authors and changelog files and reminder in CI 2023-08-21 02:17:00 +02:00
Philippe Teuwen 8d5643d1e9 Add option to enable sdk_validation.h 2023-08-21 01:02:52 +02:00
Szymon Borecki 4e0494b286 Store CLI history in ~/.chameleon_history 2023-08-21 00:54:36 +02:00
Philippe Teuwen 505ddc8c51 Remove old compilation artefacts 2023-08-21 00:37:10 +02:00
Philippe TeuwenandGitHub 136a7531f4 Merge pull request #66 from szymex73/cli-overhaul
CLI Overhaul
2023-08-21 00:09:02 +02:00
Philippe Teuwen e474e519df Revert workaround for WDT during emulation and fix SDK NFC IRQ handler 2023-08-20 11:43:23 +02:00
Philippe Teuwen 5e52180aec Mifare Classic emulator: fix asked by @Foxushka 2023-08-20 10:21:08 +02:00
Szymon Borecki 895b0ced12 Merge remote-tracking branch 'origin/main' into cli-overhaul 2023-08-20 01:25:24 +02:00
Philippe TeuwenandGitHub 494f92dfa6 Merge pull request #65 from Foxushka/hw-slot-info
Implement new Mifare Classic emulator configuration commands
2023-08-20 00:14:33 +02:00
Philippe TeuwenandGitHub 8879460e10 Merge branch 'main' into hw-slot-info 2023-08-20 00:11:42 +02:00
Philippe TeuwenandGitHub 12de4c0e0e Merge pull request #56 from domints/implement-get-slot-data
Implement get slot data
2023-08-20 00:07:46 +02:00
Philippe Teuwen 94a0206635 Workaround to prevent watchdog trigger during emulation. But there seems to be a deeper issue:
Once an external HF field is detected, when a first byte is received, then NFC IRQ is called non-stop.
But none of the conditions in nrfx_nfct_irq_handler() is met so the handler does nothing and there is no chance to get called from a registered callback.
Side effect is that main loop cannot run, button IRQs are called but button processing in main loop is not called, etc.
So one of the side effects is that bsp_wdt_feed() is not called.
Current workaround is to call bsp_wdt_feed() at the end of nRF SDK nrfx_nfct.c nrfx_nfct_irq_handler()
I suspect the hack of the NFC state machine done in nfc_14a.c nfc_tag_14a_event_callback() case NRFX_NFCT_EVT_FIELD_DETECTED
to get access to the anticollision phase is breaking sth in the SDK state machine, NFC IRQ should be called only on real change (field drop, cmd received,...)
2023-08-20 00:00:25 +02:00
Foxushka 151f412490 Implement new Mifare Classic emulator configuration commands, improve CLI
Slot

Won't work like this

More randomness on nested auth (for hardnested recovery) and change default GCC location

Nobody will have GCC in this default location, /usr/bin/ will target way more users

Get enabled slots command

hw slot list show disabled slots

Improve python code quality

Show Mifare Classic emulator settings in hw slot list

Implement hf mf settings to change Mifare Classic emulator settings

Update
2023-08-19 20:59:39 +03:00
Szymon Borecki dddc6f1a10 Merge remote-tracking branch 'origin/main' into cli-overhaul 2023-08-19 14:19:40 +02:00
Szymon Borecki a64be123db Remove the unnecessary readline import and add a shebang 2023-08-19 13:46:32 +02:00
Szymon Borecki f6e22328bb Add working argument completion 2023-08-19 13:44:15 +02:00
Philippe TeuwenandGitHub a34928888d Merge pull request #64 from augustozanellato/fix_releases
Use single release for dev builds
2023-08-19 02:12:34 +02:00
Augusto Zanellato ae48829a15 Use single release for dev builds
Fix workflow using deprecated stuff
2023-08-19 02:09:43 +02:00
Philippe TeuwenandGitHub de5aa050fd Merge pull request #52 from F9Alejandro/bugfix/cli-offset
[Bugfix] Attempted fix of Offset issues and utilizing enums
2023-08-19 01:24:03 +02:00
Philippe TeuwenandGitHub 22747138e7 Merge branch 'main' into bugfix/cli-offset 2023-08-19 01:18:42 +02:00
Philippe TeuwenandGitHub 9db1671be5 Merge pull request #63 from augustozanellato/factory_reset
Add factory reset command
2023-08-19 00:46:39 +02:00
Philippe Teuwen 28572958a7 thinner logo to fit 80col terms 2023-08-19 00:24:29 +02:00
Philippe Teuwen 3bfc52432a change slot nicknames encoding: gbk -> utf8 2023-08-19 00:14:19 +02:00
Philippe Teuwen 8e093d00b6 Enable watchdog 2023-08-18 23:11:03 +02:00
Augusto Zanellato 7b76aefd5e ACK command and use delayed reset 2023-08-18 22:35:39 +02:00
Philippe Teuwen bbf5f3027b NRF_LOG: add option to activate UART backend on SWO pin, see How_to_use_Firmware.md 2023-08-18 22:31:07 +02:00
Augusto Zanellato 4ab131d10a Implement wipe fds command used to factory reset 2023-08-18 22:13:06 +02:00
Dominik SzymaΕ„ski 813b12bd37 Implement Mifare Classic emulator slot read 2023-08-18 19:39:05 +02:00
Philippe Teuwen 828d88c273 Several changes on TagSenseType, TagSpecificType and SlotNumber:
* SlotNumber values range from 1 to 8 rather than from 0 to 7
  this allows more straightforward usage as ppl can use equivalently SLOT_1 or 1.
* SlotNumber.fix -> .to_fw, and add .from_fw
* removed unnecessary SLOT_NO
* More straightforward use of enums, no need for .value, .__members__, name.replace() etc
* Unify usage between TagSenseType and TagSpecificType
* Add str representations for TagSenseType
* Fixed TagSpecificType related help (e.g. in hw slot type -h)
* Removed some redundant error raise
* Note: iterations can be done with `for slot in chameleon_cmd.SlotNumber:`
2023-08-18 18:03:02 +02:00
Dominik SzymaΕ„ski 278deda0c6 Merge branch 'main' into implement-get-slot-data 2023-08-18 16:50:38 +02:00
Philippe TeuwenandGitHub 698c9b8ea5 Merge branch 'main' into bugfix/cli-offset 2023-08-18 16:02:55 +02:00
Philippe TeuwenandGitHub 8de6a31196 Merge pull request #61 from Foxushka/hw-slot-info
Implement "hw slot info" to show which tag type loaded into all slots
2023-08-18 15:57:40 +02:00
Foxushka 913c1540e3 Implement "hw slot info" to show which tag type loaded into all slots
As suggested by @augustozanellato

Fix input text disapperance in some cases

Show selected slot

Space
2023-08-17 22:40:04 +03:00
Dominik SzymaΕ„ski 85e63d90d9 Merge branch 'main' into implement-get-slot-data 2023-08-17 18:20:58 +02:00
Philippe TeuwenandGitHub fc0e016c04 Merge pull request #54 from nemanjan00/git-commit
Add git version command
2023-08-17 15:03:29 +02:00
Philippe TeuwenandGitHub 15a6c663b2 Merge pull request #59 from sgnusov/main
Fix data sanity check
2023-08-17 14:58:37 +02:00
Sgnusov 7e7abc50ea Fix data sanity check 2023-08-17 11:13:28 +00:00
Nemanja Nedeljkovic 0b5290706b Merge 2023-08-17 12:24:52 +02:00
Philippe Teuwen 997f58d0d0 Fix FDS records conflicts (dumps/nicks/settings overwriting each other) 2023-08-17 04:00:47 +02:00
Philippe Teuwen c6d95f34f7 Revert "Force tag_specific_type_t enum to be 32b and allocate banks so size and mapping won't change when we add new types"
This reverts commit e3e6b63117.
2023-08-17 00:14:11 +02:00
Philippe TeuwenandGitHub 32e0cdf16b Merge pull request #50 from domints/add-animation-modes-support
Add animation modes support
2023-08-16 23:48:07 +02:00
Philippe Teuwen 92a3f0966f suppress GCC warnings in nRF SDK and restore -Warray-bounds and -Wsizeof-array-div 2023-08-16 23:26:30 +02:00
Philippe Teuwen 5afd3332bd Suppress GCC 12 linker warnings about missing stubs 2023-08-16 23:26:30 +02:00
Philippe Teuwen e3e6b63117 Force tag_specific_type_t enum to be 32b and allocate banks so size and mapping won't change when we add new types 2023-08-16 23:26:30 +02:00
Philippe Teuwen b0233538b0 little fix for mode 2 to light up the slot LED on button press 2023-08-16 20:14:57 +02:00
Augusto ZanellatoandPhilippe Teuwen 707136a241 Add settings init, reset and migration logic
Align settings size to uint32_t
Add 78 reserved bits to settings
Use an enum for animation mode
2023-08-16 19:46:41 +02:00
Dominik SzymaΕ„ski 2ed37d9c2a Fix log messages 2023-08-16 01:17:45 +02:00
Dominik SzymaΕ„ski 75e319fdd6 Add EM410x slot reading ability 2023-08-16 00:25:02 +02:00
Dominik SzymaΕ„ski 564f7eaf4c Cleanup command ids, add slot get command ids 2023-08-15 23:56:56 +02:00
Dominik SzymaΕ„ski b23b13d4ea Merge remote-tracking branch 'src/main' into add-animation-modes-support 2023-08-15 22:57:57 +02:00
Dominik SzymaΕ„ski 6e81b5917e Add version field, make it bitfield struct 2023-08-15 22:56:53 +02:00
Augusto ZanellatoandNemanja Nedeljkovic ee8990aacd fw git version fixes, client support
Fix git version string length handling

Add git to docker fw-builder image

Add git version command to client

Add  client support
2023-08-11 19:46:17 +02:00
Nemanja Nedeljkovic 83811861cc Add git version command 2023-08-11 18:01:02 +02:00
DXLandGitHub e916e10c66 Update README.md 2023-08-11 22:24:57 +08:00
Alexander Featherston d77ca3cd7d Attempted fix of Offset issues and utilizing enums in place of hardcoded numbers.
Changes to be committed:
	modified:   software/script/chameleon_cli_unit.py
	modified:   software/script/chameleon_cmd.py
2023-08-11 01:16:25 -04:00
Dominik SzymaΕ„ski 166faaeee7 Fix wrong storage space 2023-08-10 23:04:39 +02:00
Dominik SzymaΕ„ski 85b2fb3d8a Upgrade command parser 2023-08-10 22:59:00 +02:00
Dominik SzymaΕ„ski f30ff7054c Add animation modes support 2023-08-10 22:26:22 +02:00
dxl c197a0ff05 Fixed issue with multiple spaces in readme file names 2023-08-10 12:53:20 +08:00
dxl 93c4965e2c Reformatting readme files 2023-08-10 12:28:18 +08:00
Szymon Borecki 0cfdff809f Add command autocompletion 2023-08-10 01:20:22 +02:00
Szymon Borecki cdf4669d34 Fix KeyboardInterrupt 2023-08-10 01:18:27 +02:00
Szymon Borecki 3789269c37 Add prompt-toolkit to requirements 2023-08-10 00:54:26 +02:00
Szymon Borecki e2b5b9b960 Use prompt-toolkit and switch to a different command registration system 2023-08-10 00:45:37 +02:00
Szymon Borecki e9fec48ede Fix docstring for expect_response and rename the associated exception 2023-08-09 23:51:12 +02:00
Szymon Borecki 3259de2f25 Replace the PositiveChameleonCMD class with an exception decorator 2023-08-09 23:37:52 +02:00
Szymon Borecki b8d2853f39 Use consistent naming for command units 2023-08-09 20:00:54 +02:00
dxl 8e51e081a9 Merge remote-tracking branch 'origin/main' 2023-08-09 11:42:02 +08:00
dxl 0e601366f2 Can't emulate 7B UID Mifare Classic cards bug fixed. 2023-08-09 11:41:39 +08:00
DXLandGitHub 8f2d999363 Update README.md 2023-08-08 19:57:10 +08:00
DXLandGitHub 1380c74515 Update README.md 2023-08-08 19:55:24 +08:00
dxl 611d01ac37 High performance of mf1 simulation implemented 2023-07-31 14:44:38 +08:00
iceman1001 f614276c00 udev rules file. Once installed you see your device as /dev/ultra-0 2023-07-30 10:55:52 +02:00
iceman1001 6292ef58e3 fix compiler warning 2023-07-29 13:27:59 +02:00
iceman1001 338fb13027 fix compiler warning. moved input param checking to earlier. 2023-07-29 12:29:16 +02:00
iceman1001 93c17d5727 remove warning for string formatter 2023-07-29 10:42:18 +02:00
iceman1001 2c0e0454de remove warning when compiling 2023-07-29 10:41:52 +02:00
iceman1001 6ee34622e8 allow exit/quit with shortcut too 2023-07-29 10:41:17 +02:00
IcemanandGitHub 69463ce4d5 Merge pull request #45 from shallax/main
Add readline import for Posix operating systems to handle arrow keys.
2023-07-29 10:33:50 +02:00
Thomas Pedley cb3376cc24 Add readline import for Posix operating systems to handle arrow keys. 2023-07-28 22:56:08 +01:00
Philippe Teuwen fb05a4422e add link & cosmetic stuff 2023-07-27 11:00:33 +02:00
Philippe Teuwen 5d244af38b forgot flash script mentioned in How_to_use_Firmware.md 2023-07-27 09:05:47 +02:00
Philippe Teuwen f5111ee068 Update How_to_use_Firmware.md 2023-07-27 01:13:02 +02:00
Philippe TeuwenandGitHub bbb35576a4 Merge pull request #43 from gentilkiwi/patch-1
Fix $hw_version in build.sh
2023-07-24 16:43:03 +02:00
Benjamin DELPYandGitHub 9fb71143d4 Fix $hw_version in build.sh 2023-07-24 16:31:59 +02:00
Philippe TeuwenandGitHub 6ffb43e226 Merge pull request #42 from Foxushka/dfu
Upload DFU zip files to releases
2023-07-24 02:54:19 +02:00
FoxushkaandGitHub 8a786b36a4 Not required 2023-07-23 20:02:34 +00:00
FoxushkaandGitHub edbafc6c53 Upload DFU zip files to releases 2023-07-23 20:02:03 +00:00
Philippe TeuwenandGitHub f0d180bb31 Merge pull request #40 from gentilkiwi/main
Clean nrf* part of build.sh + get device address & chip id
2023-07-23 10:19:43 +02:00
Benjamin DELPY 8a58d0011b Clean nrf* part of build.sh + get device address & chip id 2023-07-23 00:58:03 +02:00
Philippe Teuwen 0c15ccd7af enter_dfu_over_ble.py: support ChameleonLite as well 2023-07-22 22:45:49 +02:00
DXLandGitHub a48f6fc105 Merge pull request #36 from doegox/phil_fix_serialble
Catch exception when using virtual serial over BLE
2023-07-22 14:00:46 +08:00
DXLandGitHub fc392ab645 Merge pull request #35 from doegox/phil_tools_dfu
Add helper scripts to enter DFU from USB or from BLE
2023-07-22 14:00:36 +08:00
DXLandGitHub 0f1de197b7 Merge pull request #34 from doegox/phil_fix_dfu_exit
client: don't let recv thread crashing after hw dfu
2023-07-22 14:00:21 +08:00
DXLandGitHub 930d9edeb5 Merge pull request #33 from doegox/phil_fix_utf8
Fix Chinese encodings of some files GB18030=> UTF-8
2023-07-22 14:00:00 +08:00
DXLandGitHub ef8a44c08d Merge pull request #32 from doegox/phil_fix_sleepble
fix sleep timer when BLE gets disconnected
2023-07-22 13:59:49 +08:00
Philippe Teuwen 0a47c98d39 Catch exception when using virtual serial over BLE 2023-07-22 02:30:21 +02:00
Philippe Teuwen 868b6aadcd Add helper scripts to enter DFU from USB or from BLE 2023-07-22 01:58:40 +02:00
Philippe Teuwen f094a65061 client: don't let recv thread crashing after hw dfu 2023-07-22 00:45:01 +02:00
Philippe Teuwen b97c4a0b53 Fix GB18030 => UTF-8 encodings 2023-07-21 23:21:23 +02:00
Philippe Teuwen a5670bbcba add some comments to avoid future similar bugs when shuffling around code 2023-07-21 21:53:12 +02:00
Philippe Teuwen cfd512c5b1 fix sleep timer when BLE gets disconnected 2023-07-21 21:24:37 +02:00
dxl d858f9abb4 Added a photo of the final mass-produced DEV tool. 2023-07-21 18:52:38 +08:00
dxl 37ba8e6514 Delete unnecessary Chinese annotations uniformly. 2023-07-21 18:46:58 +08:00
dxl 5b302613b7 Fixed an issue with incorrect model of electronic components(Found before batch manufacture). 2023-07-21 18:46:16 +08:00
dxl adb878241d ChameleonUltra antenna board opensource 2023-07-21 18:42:49 +08:00
dxl 53a7f97904 ChameleonLite hardware opensource now. 2023-07-21 18:39:16 +08:00
dxl 73fffe224a Delete dummy file(ChameleonLite Open Source) 2023-07-21 18:37:02 +08:00
DXLandGitHub fc5538b7ec Merge pull request #31 from doegox/phil_fix_compil
fix compilation
2023-07-21 10:12:03 +08:00
Philippe Teuwen 6b4af603a6 fix compilation 2023-07-19 18:49:09 +02:00
DXLandGitHub e7264bddaa Merge pull request #17 from ca1e/ntag
Add Ntag21x Support
2023-07-19 10:37:22 +08:00
DXLandGitHub bcc1ae6fbb Merge pull request #28 from doegox/phil_lfem_fix
LF EM: sample field only when mod is off
2023-07-19 10:34:41 +08:00
Philippe Teuwen aac1315087 LF EM: make sure to sample the field only during the last no-mod half bit of a series of ID broadcasts 2023-07-18 17:52:56 +02:00
DXLandGitHub 6ea244745b Merge pull request #27 from doegox/phil_lfemul_fix
fix LF EM emulation
2023-07-18 17:19:06 +08:00
Philippe Teuwen d2cc8ba01e fix LF EM emulation? 2023-07-18 09:28:07 +02:00
DXLandGitHub f01a1dc898 Merge pull request #24 from augustozanellato/dfu_pkgs
Generate DFU packages in CI
2023-07-18 11:40:37 +08:00
DXLandGitHub 339a104d77 Merge pull request #26 from GameTec-live/main
fix autoconnect
2023-07-18 11:38:37 +08:00
GameTec_live ef2d438562 Make eload -t optional 2023-07-17 16:59:36 +02:00
GameTec_live 02ef90a901 fix autoconnect
switch autoconnect over to vid due to MS description and name implement
2023-07-17 16:43:48 +02:00
Augusto Zanellato 92b3553c53 Generate DFU packages in CI 2023-07-16 12:35:53 +02:00
DXLandGitHub bcdfc121bc Merge pull request #22 from doegox/phil_cflags
Fix cflags for gcc < 12
2023-07-15 14:04:21 +08:00
DXLandGitHub fcf94e2799 Merge pull request #23 from doegox/phil_exit
Graceful exit, also on ctrl-d
2023-07-15 14:04:05 +08:00
Philippe Teuwen db0bf483ce Fix cflags for gcc < 12 2023-07-14 10:31:32 +02:00
Philippe Teuwen 51bb2a9252 Graceful exit, also on ctrl-d 2023-07-14 10:30:27 +02:00
DXLandGitHub f629f73515 Update README.md 2023-07-13 18:56:46 +08:00
DXLandGitHub 74b5357472 Update README.md 2023-07-13 18:53:53 +08:00
DXLandGitHub 30e0dea5f7 Update README.md 2023-07-13 18:52:08 +08:00
DXLandGitHub c8ed0b9cd0 Update README.md 2023-07-13 18:51:15 +08:00
DXLandGitHub 6e68287e09 Update README.md 2023-07-13 18:50:37 +08:00
DXLandGitHub ffbf24574d Update README.md 2023-07-13 18:49:31 +08:00
DXLandGitHub 4522e73041 Update README.md 2023-07-13 18:48:34 +08:00
DXLandGitHub afda55e1f6 Update README.md 2023-07-13 18:47:25 +08:00
IcemanandGitHub 13da9416dc Merge pull request #21 from USBNinjaRRG/patch-1
Update README.md
2023-07-12 07:49:47 +02:00
USBNinjaandGitHub 7d85163a61 Update README.md 2023-07-12 13:20:33 +08:00
Augusto ZanellatoandGitHub 40f9778120 Add docker toolchain, add CI pipeline (#19) 2023-07-12 10:36:36 +08:00
dxl 939df3f0aa Correcting the description of certain devices in readme may reduce unnecessary controversies in the community. 2023-07-10 19:21:21 +08:00
GameTec_liveanddxl c738839d0b 1. Automatically try to search for ports when ignoring the - p parameter.
2. fixed .gitignore ignoring valid scripts
2023-07-10 14:36:46 +08:00
dxl 029c1c84b2 After passing the test compilation, merge the commit to the main branch. 2023-07-03 15:07:35 +08:00
Foxushkaanddxl 84c9380f83 Expose nfc_tag_mf1_is_detection_enable and fix typo 2023-07-03 15:00:15 +08:00
Foxushkaanddxl 4a7cf188a1 Fix compilation on latest compilator version (12)
CFLAGS -Wno-error
2023-07-03 15:00:15 +08:00
dxl ad3e0ac7cd Jlink work. 2023-07-03 13:22:23 +08:00
ca1e 05b4158aba fix ntag21x implement 2023-06-14 09:16:27 +08:00
derGraph ab4f366e49 Added debugging instruction
Please someone test JLink
2023-06-10 22:54:28 +02:00
derGraph bcc61b8b33 Instructions tested/fixed; Uploading added 2023-06-10 20:38:00 +02:00
derGraph c2f78e2a36 Adding STLink Support
Adding STLink Support: make flash_stlink uploads program over openocd.
2023-06-10 20:37:13 +02:00
derGraphandGitHub ccb08bb4eb Merge branch 'RfidResearchGroup:main' into main 2023-06-09 20:54:34 +02:00
ca1e 2a7604d8cc ntag21x implement 2023-06-09 18:55:15 +08:00
derGraph 0633da153a Update to gcc version 10.3.1 2023-05-22 09:14:08 +02:00
derGraphandGitHub 7772f4bfa3 Merge branch 'RfidResearchGroup:main' into main 2023-05-22 08:35:39 +02:00
derGraph 1cae95654a Updated Makefile defs to 10.3.1 2023-05-22 08:34:19 +02:00
217 changed files with 21636 additions and 16773 deletions
+3
View File
@@ -0,0 +1,3 @@
[*.{c,h,py}]
indent_style = space
indent_size = 4
+50
View File
@@ -0,0 +1,50 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
***Things to try before submitting a bug report***
* read the [troubleshooting guide](https://github.com/RfidResearchGroup/ChameleonUltra/blob/main/docs/troubleshooting.md)
* check existing [issues](https://github.com/RfidResearchGroup/ChameleonUltra/issues)
* use the latest firmware and CLI
* for issues specific to another client than the Python CLI, use the corresponding issue tracker. E.g. [here](https://github.com/GameTec-live/ChameleonUltraGUI/issues) for the ChameleonUltraGUI
***Compilation problems***
Try compiling with verbose. Use `make VERBOSE=1` for the firmware and the software/src tools.
Include the verbose compilation logs.
***flashing problems***
Have you followed the instructions properly?
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior.
Explain it as you would do to someone not familiar with the problematic feature.
What is the abnormal behavior you observed?
E.g.
1. Connect '....'
2. Execute '....'
3. Press button '....'
4. See error '....'
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem. For console text and logs, better to dump them as text than image. Attach files if too long.
**Host (please complete the following information):**
- OS and version
- for compilation issues, the toolchain version
- inside CLI run `hw version` and paste the output here
**Additional context**
Add any other context about the problem here.
+5
View File
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Official channels Chameleon Ultra Community
url: https://github.com/RfidResearchGroup/ChameleonUltra#official-channels
about: Got questions? Ask in *official channels*, not in an issue
+25
View File
@@ -0,0 +1,25 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[idea]"
labels: Request, enhancement
assignees: ''
---
Please keep in mind we are still at the infancy of the project and a lot has still to be done.
Have first a look at the [Whitepaper](https://github.com/RfidResearchGroup/ChameleonUltra/blob/main/docs/technical_whitepaper.md), the Wiki [Roadmap](https://github.com/RfidResearchGroup/ChameleonUltra/wiki/Public-Roadmap) and [Wishlist](https://github.com/RfidResearchGroup/ChameleonUltra/wiki/Wishlist).
No need for creating issues for well known missing supports, we are already aware :)
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
+54
View File
@@ -0,0 +1,54 @@
# This is just a placeholder while the whole PyInstaller thing gets figured out
name: Client build
on:
workflow_call:
inputs:
checkout-sha:
required: false
type: string
jobs:
build_client:
name: Build client
strategy:
matrix:
include:
- name: windows
os: windows-latest
pre_command: |
? .
bundle_command: |
Compress-Archive -Path software\* -DestinationPath client-windows.zip
- name: linux
os: ubuntu-latest
pre_command: |
true
bundle_command: |
(cd software && zip -r "$OLDPWD/client-linux.zip" .)
- name: macos
os: macos-latest
pre_command: |
true
bundle_command: |
(cd software && zip -r "$OLDPWD/client-macos.zip" .)
runs-on: ${{ matrix.os }}
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
ref: ${{ inputs.checkout-sha == null && github.sha || inputs.checkout-sha }}
- name: Run OS specific setup
run: ${{ matrix.pre_command }}
- name: Upload built client
uses: actions/upload-artifact@v3
with:
name: client-${{ matrix.name }}
path: software/*
- name: Zip up client for release
run: ${{ matrix.bundle_command }}
- name: Upload release artifacts
uses: actions/upload-artifact@v3
with:
name: release-artifacts
path: client-${{ matrix.name }}.zip
+92
View File
@@ -0,0 +1,92 @@
name: Firmware build
on:
workflow_call:
inputs:
checkout-sha:
required: false
type: string
jobs:
build_fw_builder:
name: Build and push fw-builder Docker image
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
outputs:
image_hash: ${{ steps.push.outputs.digest }}
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Check out the repo
uses: actions/checkout@v3
with:
ref: ${{ inputs.checkout-sha == null && github.sha || inputs.checkout-sha }}
fetch-depth: 0
- name: ghcr.io login
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}-fw-builder
- name: Build and push Docker images
id: push
uses: docker/build-push-action@v4
with:
context: firmware
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build_fw:
name: Build firmware
runs-on: ubuntu-latest
needs: build_fw_builder
strategy:
matrix:
device_type: [ultra, lite]
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
ref: ${{ inputs.checkout-sha == null && github.sha || inputs.checkout-sha }}
fetch-depth: 0
- name: Build firmware
env:
repo: ${{ github.repository }}
run: |
docker run --rm -v ${PWD}:/workdir -e CURRENT_DEVICE_TYPE=${{ matrix.device_type }} ghcr.io/${repo,,}-fw-builder@${{ needs.build_fw_builder.outputs.image_hash }} firmware/build.sh
- name: Upload built binaries
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.device_type }}-firmware
path: firmware/objects/*.hex
- name: Unzip dfu images
run: |
sudo chown -R $USER:$USER firmware/objects
mkdir firmware/objects/${{ matrix.device_type }}-dfu-app
mkdir firmware/objects/${{ matrix.device_type }}-dfu-full
unzip firmware/objects/${{ matrix.device_type }}-dfu-app.zip -d firmware/objects/${{ matrix.device_type }}-dfu-app
unzip firmware/objects/${{ matrix.device_type }}-dfu-full.zip -d firmware/objects/${{ matrix.device_type }}-dfu-full
- name: Upload dfu app image
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.device_type }}-dfu-app
path: firmware/objects/${{ matrix.device_type }}-dfu-app/*
- name: Upload dfu full image
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.device_type }}-dfu-full
path: firmware/objects/${{ matrix.device_type }}-dfu-full/*
- name: Upload release artifacts
uses: actions/upload-artifact@v3
with:
name: release-artifacts
path: firmware/objects/*.zip
+15
View File
@@ -0,0 +1,15 @@
on: pull_request_target
name: Changelog Reminder
jobs:
remind:
name: Changelog Reminder
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Changelog Reminder
uses: peterjgrainger/action-changelog-reminder@v1.2.0
with:
changelog_regex: 'CHANGELOG.md'
customPrMessage: 'You are welcome to add an entry to the CHANGELOG.md as well'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+44
View File
@@ -0,0 +1,44 @@
name: PR handler
on:
pull_request_target:
jobs:
firmware_pipeline:
name: Build Firmware
permissions:
packages: write
contents: read
uses: ./.github/workflows/build_firmware.yml
with:
checkout-sha: "${{ github.event.pull_request.merge_commit_sha }}"
client_pipeline:
name: Build Firmware
uses: ./.github/workflows/build_client.yml
with:
checkout-sha: "${{ github.event.pull_request.merge_commit_sha }}"
comment:
runs-on: ubuntu-latest
name: Comment on PR
needs:
- firmware_pipeline
- client_pipeline
permissions:
pull-requests: write
steps:
- uses: marocchino/sticky-pull-request-comment@v2
with:
message: |
# Built artifacts for commit ${{ github.event.pull_request.head.sha }}
## Firmware
- [Ultra APP DFU Package](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/ultra-dfu-app.zip)
- [Ultra binaries](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/ultra-firmware.zip)
- [Lite APP DFU Package](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/lite-dfu-app.zip)
- [Lite binaries](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/lite-firmware.zip)
## Client
- [Linux](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/client-linux.zip)
- [macOS](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/client-macos.zip)
- [Windows](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/client-windows.zip)
+80
View File
@@ -0,0 +1,80 @@
name: Push handler
on:
push:
jobs:
firmware_pipeline:
name: Build Firmware
permissions:
packages: write
contents: read
uses: ./.github/workflows/build_firmware.yml
client_pipeline:
name: Build Firmware
uses: ./.github/workflows/build_client.yml
create_dev_release:
permissions:
contents: write
name: Create dev pre-release with artifacts
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs:
- firmware_pipeline
- client_pipeline
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Download release artifacts
uses: actions/download-artifact@v3
with:
name: release-artifacts
path: release-artifacts
- name: Upload to dev release
uses: softprops/action-gh-release@v1
with:
body: |
Auto-Generated DFU packages from latest `main` commit.
For development purposes only.
These are not tested, here be dragons.
Built from commit ${{ github.sha }}
tag_name: dev
name: Development release
draft: false
prerelease: true
target_commitish: ${{ github.sha }}
generate_release_notes: true
files: release-artifacts/*
- name: Fix up release tag
run: |
git tag -f dev
git push --tags -f
create_release:
permissions:
contents: write
name: Create tagged release with artifacts
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs:
- firmware_pipeline
- client_pipeline
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Download release artifacts
uses: actions/download-artifact@v3
with:
name: release-artifacts
path: release-artifacts
- name: Upload to tagged release
uses: softprops/action-gh-release@v1
with:
body: |
Auto-Generated DFU packages for Release ${{ github.ref_name }}
Built from commit ${{ github.sha }}
name: Release ${{ github.ref_name }}
draft: false
target_commitish: ${{ github.sha }}
generate_release_notes: true
append_body: true
files: release-artifacts/*
+3 -1
View File
@@ -1,3 +1,5 @@
.idea/
.vscode/
.vs/
.vs/
.DS_Store
+3
View File
@@ -0,0 +1,3 @@
Copyright of each contribution is tracked by the Git history.
See the output of `git shortlog -nse` for a full list or `git log --pretty=short --follow <path/to/sourcefile> |git shortlog -ne` to track a specific file.
See also [the Contributors page on Github](https://github.com/RfidResearchGroup/ChameleonUltra/graphs/contributors).
+100
View File
@@ -0,0 +1,100 @@
# Change Log
All notable changes to this project will be documented in this file.
This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log...
## [unreleased][unreleased]
## [v2.0.0][2023-09-26]
- Changed APP_FW_VER now deduced from git tag vx.y.z (@doegox)
- Changed initial button wakeup from 4 to 8 seconds (@aramova)
- Added MIFARE Ultralight reading features (@FlUxIuS & @doegox)
- Fixed MF1 write mode SHADOW was not preserved properly (@doegox)
- Changed field LED now active also in reader mode to indicate that reader is powering the field (@doegox)
- Changed slot enabled logic: now we have separate enabled_hf and enabled_lf, changed GET_ENABLED_SLOTS and SET_SLOT_ENABLE (@doegox)
- Changed tag type enum to be ready for new types, changed stored slotConfig and GET_SLOT_INFO (@doegox)
- Added HF14A_RAW and its support in `hf 14a raw` (@xianglin1998)
- Removed MF1_DETECT_DARKSIDE (@doegox)
- Added MF1_STATIC_NESTED_ACQUIRE and its support in `hf mf nested` (@xianglin1998)
- Changed `hf 14a scan`: Automatically send RATS to 14443-4a tags (@augustozanellato)
- Changed Darkside: use LEDs for visual feedback of attack progression (@doegox)
- Changed Darkside: longer RF field off for reset and longer CLI timeout (@doegox)
- Fixed Darkside: parity byte-to-array bug made it low probability to succeed (@doegox)
- Changed `hw detection decrypt` show progression and remove duplicate keys (@doegox)
- Changed dynamic cmd_map_init() by static cmd_map initialization (@doegox)
- Changed `hf slot list` to add clarity and colors (@doegox)
- Changed `hf mf sim` and `hf mf info` to support ATS (still to be used in actual emulation) (@doegox)
- Changed `hf mf eload` and `hf mf eread`: uploads/downloads are now 30x faster (@doegox)
- Changed CLI HF14AInfo logic merged inside HF14AScan for more consistent display of the results (@doegox)
- Added guessed type information for NXP tags, and reorganization of HF information part. (@FlUxIuS)
- Changed `hw raw` to detail status message (@doegox)
- Changed CLI to query capabilities on connect, not on every single command if device does not support get_device_capabilities (@doegox)
- Changed CLI to not instanciate ChameleonCMD on every single command (@doegox)
- Changed massively the protocol and its handlers for more consistency and easier maintenance and future dev (@doegox)
- Added `hf settings blepair` command to get and set ble pairing enable state, and default disable ble pair (@xianglin1998)
- Added `hf mf info` command to get UID/SAK/ATQA from slot (@Foxushka)
- Added `hw raw` to send raw command to Chameleon (@Foxushka)
- Added command to fetch all available commands from Chameleon and test if Chameleon supports it (@Foxushka)
- Fixed ChameleonLite emulation bug (@spp2000)
- Fixed MFC emulation issues with OEM readers, also temporarily disabling NFC_MF1_FAST_SIM (@xianglin1998)
- Fixed Chameleon crash during BLE pairing (@Foxushka)
- Fixed CLI takes into account Lite refusing to enter Reader mode (@doegox)
- Added BLE Security support (@xianglin1998)
- Added `hw settings blekey` to get and set ble connect key (@xianglin1998)
- Added `hw ble bonds clear` to delete all ble bonds (@xianglin1998)
- Fixed argument completion bug inserting additional hyphens (@szymex73)
- Fixed device address not the same within app (@taichunmin)
- Added initial version of the user guides (@GameTec-live)
- Added support for pasting several command lines at once with prompt_toolkit (@doegox)
- Added support for interrupting sleep sequence with a button press during animation (@doegox)
- Fixed logs corruption and app reset on FDS write, added logs flush on sleep (@doegox)
- Added support for long-press of buttons (@nemanjan00)
- Changed `hw slot delete`, now it can always delete from slot (@augustozanellato)
- Changed CI pipeline (@augustozanellato)
- Added offline copy EM card uid for btnpress (@nemanjan00)
- Added offline copy ic card uid for btnpress (@xianglin1998)
- Added `hw settings btnpress` to get and set button press function (@xianglin1998)
- Added `hw battery` to get battery information (@xianglin1998)
- Added `hw slot delete` to delete HF or LF out of a HF+LF slot (@augustozanellato)
- Changed CLI prompt autocompletion, saved history and internal cmd registration (@szymex73)
- Fixed SDK NFC IRQ handler busy loop (@doegox)
- Added `hf mf eread` to download slot dump to file (@domints)
- Added `lf em sim get` and old `lf em sim` is now `lf em sim set` (@domints)
- Changed MF1 command ids (@domints)
- Changed nonce randomness on nested auth for hardnested attack (@Foxushka)
- Added commands to configure MF1 emulation magic modes and more (@Foxushka)
- Added `hw factory_reset` to wipe user data (@augustozanellato)
- Changed slot nickname encoding gbk -> utf8 (@doegox)
- Added 5-second watchdog (@doegox)
- Added option to enable NRF_LOG UART on SWO pin (@doegox)
- Added `hw slot list` (@Foxushka)
- Added `hw version` (@nemanjan00 and @augustozanellato)
- Fixed data sanity check in MF1 emulation (@sgnusov)
- Fixed settings/dumps/nicks data corruption in flash (@doegox)
- Fixed slot LED on button wake-up (@doegox)
- Added support for init, reset and migrate settings (@augustozanellato)
- Added support to save settings in flash (@domints)
- Added `hw settings animation` to configure startup animation (@domints)
- Fixed compilation warnings from SDK (@doegox)
- Changed TagSenseType, TagSpecificType and SlotNumber enums (@F9Alejandro and @doegox)
- Added support for 7-byte UID MF1 emulation (@xianglin1998)
- Added high perf MF1 emulation (@xianglin1998)
- Added udev rules file (@iceman1001)
- Added documentation to use BlackMagicProbe out of ST-Link and show RTT NRF_LOG (@doegox)
- Added `hw chipid` and `hw address` (@gentilkiwi)
- Added helper scripts to enter DFU from USB or BLE and flash over DFU (@doegox)
- Fixed recv thread exception after `hw dfu` (@doegox)
- Fixed entering sleep after BLE disconnection (@doegox)
- Added ChameleonLite and ChameleonUltra hardware resources (@xianglin1998)
- Added NTAG21x emulation support (@ca1e)
- Fixed LF EM410x emulation (@doegox)
- Added automatic file format detection in `hf mf eload` (@GameTec-live)
- Fixed CLI exit exception (@doegox)
- Added CI pipeline, producing DFU packages (@augustozanellato)
- Added docker toolchain (@augustozanellato)
- Added automatic port detection (@GameTec-live)
- Added GET_MF1_DETECTION_STATUS (@Foxushka)
- Fixed compilation errors with GCC 12 (@Foxushka)
- Added documentation for JLink (@xianglin1998)
- Added support for ST-Link and debugging documentation (@derGraph)
## [v1.0][2023-06-06]
-40
View File
@@ -1,40 +0,0 @@
# How to use the Firmware
In this file you can look up how to [edit](#Editing-the-code), [compile](#Compiling-the-code) and [debug](#Debugging-the-code) the code!
## Editing the code
We are using [Visual Studio Code](https://code.visualstudio.com/download) to edit this project! Simply download and install it!
- Install the [ARM-GCC](https://mynewt.apache.org/latest/get_started/native_install/cross_tools.html) version [9.3.1 Compiler](https://developer.arm.com/downloads/-/gnu-rm) and remember the path where you installed it.
- Install the [C++ Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) in VS-Code.
- Create a new IntelliSense Configuration:
- press F1 in VS-Code and enter `C/C++: Edit Configurations (UI)`
- Add a new Configuration and name it
- Specify your Compiler path (path of previously installed Compiler `bin` folder)
- Change IntelliSense mode to `gcc-arm (legacy)`
- Add include path `${workspaceFolder}/**`
## Compiling the code
- Install the compiler (for instructions have a look at [Editing the code](#Editing-the-code))
- Edit Makefile.defs:
- Change `GNU_INSTALL_ROOT`(path of previously installed Compiler `bin` folder)
- Change `GNU_VERSION` (Version of the installed Compiler)
- Don't forget to remove the `#` in front of the changed lines
- Install make
- **Ubuntu:**
- Open a terminal.
- Run the following command to install Make: `sudo apt-get install build-essential`
- **Windows using Chocolatey:**
- Install Chocolatey:
- Open a PowerShell terminal with administrator privileges.
- Run the following command to install Chocolatey:
``` Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) ```
- Install Make:
- In the same PowerShell terminal, run the following command to install Make using Chocolatey: `choco install make`
- **macOS:**
- Open a terminal.
- Install Homebrew package manager by running the following command: `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`
- Once Homebrew is installed, run the following command to install Make: `brew install make`
- go into folder and run `make`
## Debugging the code
- Install [openocd](https://mynewt.apache.org/latest/get_started/native_install/cross_tools.html)
- Install [Cortex-Debug](https://marketplace.visualstudio.com/items?itemName=marus25.cortex-debug) VS-Code Extension
- MORE INFO ADDED LATER
+20 -204
View File
@@ -1,219 +1,35 @@
[nrf52_nfc_module_doc]: https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fnfc.html
![logo](docs/images/ultra-logo.png)
[nxp_rc522_datasheet]: https://www.nxp.com/docs/en/data-sheet/MFRC522.pdf
![ultra picture](docs/images/ultra-overview.png)
![alt text](https://github.com/RfidResearchGroup/ChameleonUltra/blob/main/resource/picture/Header.png)
# ChameleonUltra Authorized Distributors
# ChameleonUltra
Europe: [Lab401](https://lab401.com/)
Why not keep using ATxmega128?
First of all, it is difficult to buy chips because the lead time for the main chip is too long, and because the price
has skyrocketed. Secondly, because the interaction speed of the ATxmega simulation is slow, the decryption performance
of the READER mode cannot meet the needs, and the low-frequency function cannot be added, so we have been trying to
upgrade it, such as using the latest ARM to replace the AVR framework, and the performance will definitely be greatly
improved.
United States: [Hackerwarehouse](https://hackerwarehouse.com/)
# Why NRF52840?
Anywhere else: [Sneaktechnology](https://sneaktechnology.com) / [Aliexpress by RRG](https://proxgrind.aliexpress.com/store/1101312023)
NRF52840 has a built-in NFC Tag-A module, but no one seems to care about it. After playing with HydraNFC's TRF7970A and
FlipperZero's ST25R3916, the developers found that they can only simulate MIFARE UID. I accidentally tested the NFC of
52840, and found that it is not only surprisingly easy to simulate a complete MIFARE card, but also has very good
simulation performance, friendly data flow interaction, and very fast response, unlike the former which is limited by
the SPI bus clock rate. We also found that it has ultra-low power consumption, ultra-small size, 256kb/1M large RAM and
FLASH, also has BLE5.0 and USB2.0 FS, super CotexM4F, most importantly, he is very cheap! This is undoubtedly a treasure
discovery for us!
# What is it and how to use ?
Below we will explain in detail how we exploited the performance of the NRF52840, and what seemingly impossible
functions have been realized with it!
Read the [available documentation](docs/README.md).
# Supported functions
# Compatible applications
## High Frequency Attack
* [ChameleonUltraGUI](https://github.com/GameTec-live/ChameleonUltraGUI)
| Attack Type | Tag Type | Whether the hardware supports | Does the software support | Whether the application layer supports | Note |
|--------------|:-------------:|------------------------------:|---------------------------|:--------------------------------------:|------------------------:|
| Sniffing | No | No | No | No | |
| MFKEY32 V2 | MifareClassic | Support | Support | Support | MifareClassic Detection |
| Darkside | MifareClassic | Support | Support | Support | Encrypted 4 bit NAck |
| Nested | MifareClassic | Support | Support | Support | PRNG(Distance guess) |
| StaticNested | MifareClassic | Support | Support | Not yet implemented | PRNG(2NT Fast Decrypt) |
| HardNested | MifareClassic | Support | Support | Not yet implemented | No |
| Relay attack | ISO14443A | Support | Support | Not yet implemented | No |
# Videos
## High Frequency Simulation
*Beware some of the instructions might have changed since recording, check the current documentation when in doubt!*
| Card Type | Encoding Type | Whether the hardware supports | Does the software support | Whether the application layer supports | Note |
|-------------------------------|:--------------------:|------------------------------:|---------------------------|:--------------------------------------:|-----------------------------------------:|
| Non <13.56MHz or ISO14443A> | No | No | No | No | [NRF52 NFC Module][nrf52_nfc_module_doc] |
| NTAG 21x (210-218) | ISO14443A/106 kbit/s | Support | Support | Not yet implemented | |
| Mifare Ultralight | ISO14443A/106 kbit/s | Support | Support | Not yet implemented | |
| Mifare Ultralight Ev1 | ISO14443A/106 kbit/s | Support | Support | Not yet implemented | |
| Mifare Ultralight C | ISO14443A/106 kbit/s | Support | Support | Not yet implemented | |
| MifareClassic1K/2K/4K (4B/7B) | ISO14443A/106 kbit/s | Support | Support | Support | |
| Mifare DESFire | ISO14443A High Rate | Only supported Low rate | Only supported Low rate | Not yet implemented | |
| Mifare DESFire EV1 | ISO14443A High rate | Only supported Low rate | Only supported Low rate | Not yet implemented | Backward compatible |
| Mifare DESFire EV2 | ISO14443A High rate | Only supported Low rate | Only supported Low rate | Not yet implemented | |
| Mifare PLUS | ISO14443A High rate | Only supported Low rate | Only supported Low rate | Not yet implemented | |
* [Downloading and compiling the official CLI](https://www.youtube.com/watch?v=VGpAeitNXH0)
* [Downloading ChameleonUltraGUI](https://www.youtube.com/watch?v=rHH7iqbX3nY)
* [ChameleonGUI features overview](https://www.youtube.com/watch?v=YqE8wyVSse4)
## High Frequency Reader
# Official channels
| Card Type | Encoding Type | Whether the hardware supports | Does the software support | Whether the application layer supports | Note |
|-------------------------------|:--------------------:|---------------------------------------------:|----------------------------------------------|:--------------------------------------:|-------------------------------------------:|
| Non <13.56MHz or ISO14443A> | No | No | No | No | [NXP RC522 Datasheet][nxp_rc522_datasheet] |
| NTAG 21x (210-218) | ISO14443A/106 kbit/s | Support | Support | Not yet implemented | |
| Mifare Ultralight | ISO14443A/106 kbit/s | Support | Support | Not yet implemented | |
| Mifare Ultralight Ev1 | ISO14443A/106 kbit/s | Support | Support | Not yet implemented | |
| Mifare Ultralight C | ISO14443A/106 kbit/s | Support | Support | Not yet implemented | |
| MifareClassic1K/2K/4K (4B/7B) | ISO14443A/106 kbit/s | Support | Support | Support | |
| Mifare DESFire | ISO14443A High Rate | Supports low rates, or possibly higher rates | Supports low rates, or possibly higher rates | Not yet implemented | |
| Mifare DESFire EV1 | ISO14443A High rate | Supports low rates, or possibly higher rates | Supports low rates, or possibly higher rates | Not yet implemented | Backward compatible |
| Mifare DESFire EV2 | ISO14443A High rate | Supports low rates, or possibly higher rates | Supports low rates, or possibly higher rates | Not yet implemented | |
| Mifare PLUS | ISO14443A High rate | Supports low rates, or possibly higher rates | Supports low rates, or possibly higher rates | Not yet implemented | |
## Low Frequency Attack
| Vulnerability Type | Tag Type | Whether the hardware supports | Does the software support | Whether the application layer supports | Note |
|--------------------|:---------:|------------------------------:|---------------------------|:--------------------------------------:|-----:|
| Sniffing | 125KHz | Support | Support | Not yet implemented | |
| Brute Force | EM410x ID | Support | Support | Not yet implemented | |
## Low Frequency Simulation
| Card Type | Encoding Type | Whether the hardware supports | Does the software support | Whether the application layer supports | Note |
|--------------------------|:-------------:|------------------------------:|---------------------------|:--------------------------------------:|----------------------------------------------:|
| Non <125KHz/ASK/PSK/FSK> | No | No | No | No | Only 125 khz RF, Modulation ASK, FSK and PSK. |
| EM410x | ASK | Support | Support | Support | EM4100 is support(AD 64bit) |
| T5577 | ASK | Support | Support | Not yet implemented | |
| HID Prox | FSK | Support | Support | Not yet implemented | |
| Indala | PSK | Support | Support | Not yet implemented | |
| FDX-B | ASK | Support | Support | Not yet implemented | |
| Paradox | FSK | Support | Support | Not yet implemented | |
| Keri | PSK | Support | Support | Not yet implemented | |
| AWD | FSK | Support | Support | Not yet implemented | |
| ioProx | FSK | Support | Support | Not yet implemented | |
| securakey | ASK | Support | Support | Not yet implemented | |
| gallagher | ASK | Support | Support | Not yet implemented | |
| PAC/Stanley | ASK | Support | Support | Not yet implemented | |
| Presco | ASK | Support | Support | Not yet implemented | |
| Visa2000 | ASK | Support | Support | Not yet implemented | |
| Viking | ASK | Support | Support | Not yet implemented | |
| Noralsy | ASK | Support | Support | Not yet implemented | |
| NexWatch | PSK | Support | Support | Not yet implemented | |
| Jablotron | ASK | Support | Support | Not yet implemented | |
## Low Frequency Reader
| Card Type | Encoding Type | Whether the hardware supports | Does the software support | Whether the application layer supports | Note |
|--------------------------|:-------------:|------------------------------:|---------------------------|:--------------------------------------:|----------------------------------------------:|
| Non <125KHz/ASK/PSK/FSK> | No | No | No | No | Only 125 khz RF, Modulation ASK, FSK and PSK. |
| EM410x | ASK | Support | Support | Support | |
| T5577 | ASK | Support | Support | Support(Write) | |
| HID Prox | FSK | Support | Support | Not yet implemented | |
| Indala | PSK | Support | Support | Not yet implemented | |
| FDX-B | ASK | Support | Support | Not yet implemented | |
| Paradox | FSK | Support | Support | Not yet implemented | |
| Keri | PSK | Support | Support | Not yet implemented | |
| AWD | FSK | Support | Support | Not yet implemented | |
| ioProx | FSK | Support | Support | Not yet implemented | |
| securakey | ASK | Support | Support | Not yet implemented | |
| gallagher | ASK | Support | Support | Not yet implemented | |
| PAC/Stanley | ASK | Support | Support | Not yet implemented | |
| Presco | ASK | Support | Support | Not yet implemented | |
| Visa2000 | ASK | Support | Support | Not yet implemented | |
| Viking | ASK | Support | Support | Not yet implemented | |
| Noralsy | ASK | Support | Support | Not yet implemented | |
| NexWatch | PSK | Support | Support | Not yet implemented | |
| Jablotron | ASK | Support | Support | Not yet implemented | |
## Low Frequency Modulation
[modulation_psk]: https://github.com/RfidResearchGroup/ChameleonUltra/blob/main/resource/picture/PSK.png
[modulation_fsk]: https://github.com/RfidResearchGroup/ChameleonUltra/blob/main/resource/picture/FSK.png
[modulation_ask]: https://github.com/RfidResearchGroup/ChameleonUltra/blob/main/resource/picture/ASK.png
| Modulation Type | wav |
|-----------------|----------------------------:|
| PSK | ![alt text][modulation_psk] |
| FSK | ![alt text][modulation_fsk] |
| ASK | ![alt text][modulation_ask] |
# 1. Ultra-low power consumption
It integrates a high-performance and low-power NFC module inside. When the NFC unit is turned on, the total current of
the chip is only 5mA@3.3V.
The underlying interaction is done independently by the NFC unit and does not occupy the CPU.
In addition, the 52840 itself is a high-performance low-power Bluetooth chip, and the encryption and calculation process
is only 7mA@3.3V. It can greatly reduce the battery volume and prolong the working time. That is to say, the 35mAh 10mm*
40mm button lithium battery can guarantee to be charged once every half a year under the working condition of swiping
the card 8 times a day for 3 seconds each time. Full potential for everyday use.
# 2. Not just UID, but a real and complete MIFARE encrypted data simulation
We can easily and completely simulate all data and password verification of all sectors, and can customize SAK, ATQA,
ATS, etc. Similar to an open CPU card development platform, 14A interaction of various architectures can be easily
realized.
# 3. Super compatibility with low-power locks using batteries
The structure of the old Chameleon AVR is slow to start during simulation. Faced with a battery-powered low-power lock
and an integrated lock on the door, it will be frequently interrupted, and the verification interaction cannot be
completed completely, resulting in no response when swiping the card.
In order to reduce power consumption, the battery lock will send out a field signal as short as possible when searching
for a card, which is no problem for the original card, but it is fatal for the MCU simulated card. Cards or mobile smart
bracelets simulated by the MCU cannot wake up and respond in such a short time, so many battery locks cannot open the
door, which greatly reduces the user experience.
This project specially optimizes the start-up and interaction logic and antenna for low-power reading heads. After
testing a variety of common low-power reading heads, they can open the door perfectly by swiping the card.
# 4. Ultra-fast response speed and low interaction delay(MifareClassic)
[fdt_standard_s50]: https://github.com/RfidResearchGroup/ChameleonUltra/blob/main/resource/picture/Standard_m1_s50.png
[fdt_redmi_k30]: https://github.com/RfidResearchGroup/ChameleonUltra/blob/main/resource/picture/Xiaomi_k30u_smartkey.png
[fdt_pm3_rdv401]: https://github.com/RfidResearchGroup/ChameleonUltra/blob/main/resource/picture/Proxmark3_Rdv4_RRG_(Firmware%20build%20at%2020201026).png
[fdt_chameleon_ultra]: https://github.com/RfidResearchGroup/ChameleonUltra/blob/main/resource/picture/ChameleonUltra.png
[fdt_chameleon_tiny]: https://github.com/RfidResearchGroup/ChameleonUltra/blob/main/resource/picture/ChameleonTiny.png
[fdt_flipper_zero]: https://github.com/RfidResearchGroup/ChameleonUltra/blob/main/resource/picture/FlipperZero%20Simulation.png
| Simulation | FDT | "**_FDT_**" Rating |
|----------------------|:---------------------------:|:--------------------------------------------------------------------------------:|
| Standard MIFARE Card | ![alt][fdt_standard_s50] | &#x2B50;&#x2B50;&#x2B50;&#x2B50;&#x2B50;&#x2B50;&#x2B50;&#x2B50;&#x2B50;&#x2B50; |
| ChameleonUltra | ![alt][fdt_chameleon_ultra] | &#x2B50;&#x2B50;&#x2B50;&#x2B50;&#x2B50;&#x2B50;&#x2B50;&#x2B50; |
| Proxmark3 Rdv4.01 | ![alt][fdt_pm3_rdv401] | &#x2B50;&#x2B50;&#x2B50;&#x2B50; |
| RedMi K30 | ![alt][fdt_redmi_k30] | &#x2B50;&#x2B50;&#x2B50;&#x2B50;&#x2B50;&#x2B50; |
| ChameleonTiny | ![alt][fdt_chameleon_tiny] | &#x2B50;&#x2B50;&#x2B50;&#x2B50;&#x2B50; |
| FlipperZero | ![alt][fdt_flipper_zero] | &#x2B50;&#x2B50; |
# 5. 256kB super large RAM cooperates with RC522 to replace Proxmark3 magically to complete the decoding
[attack_mifare_darkside]: https://github.com/RfidResearchGroup/ChameleonUltra/blob/main/resource/picture/Darkside.png
[attack_mifare_nested]: https://github.com/RfidResearchGroup/ChameleonUltra/blob/main/resource/picture/Nested.png
[attack_mifare_mfkey32]: https://github.com/RfidResearchGroup/ChameleonUltra/blob/main/resource/picture/MFKEY32V2.png
| Attack Type | CLI |
|--------------|:------------------------------:|
| MFKEY32 V2 | ![alt][attack_mifare_mfkey32] |
| Darkside | ![alt][attack_mifare_darkside] |
| Nested | ![alt][attack_mifare_nested] |
| StaticNested | Coming Soon |
| HardNested | Coming Soon |
| Relay attack | Coming Soon |
# Hardware frame diagram:
![alt text](https://github.com/RfidResearchGroup/ChameleonUltra/blob/main/resource/picture/Hardware%20%20Frame%20Diagram.png)
# Hardware Pictures
![alt text](https://github.com/RfidResearchGroup/ChameleonUltra/blob/main/resource/picture/Hardware%20Photos.png)
Where do you find the community?
* [RFID Hacking community discord server](https://t.ly/d4_C)
* Software/chameleon-dev for firmware and clients development discussions
* Devices/chameleon-ultra for usage discussions
+37
View File
@@ -0,0 +1,37 @@
# Chameleon Ultra Guide
This guide goal is to guide you through setting up and using your Chameleon Ultra and Lite.
This Guide is split up into multiple "subguides":
### About the device
- [Whitepaper](./technical_whitepaper.md): Discover what the Chameleon Ultra is capable of.
- [Hardware](./hardware.md): Learn to know the hardware of your Chameleon.
- [Firmware](./firmware.md): Your Chameleon runs a firmware, learn what it can do and how to use it.
### Interacting with the device
- [Quickstart](./quickstart.md): For the impatient people to just get you up and running with anything.
- [CLI](./cli.md): The official way to control your Chameleon is via the **C**ommand **L**ine **I**nterface (CLI). Learn how to install and master the CLI.
- [GUIs](./gui.md): Some people also develop **G**raphical **U**ser **I**nterfaces (GUIs), these may be a good start for people that do not want to deal with a CLI.
- [Troubleshooting](./troubleshooting.md): For when things go wrong, here are some common tips to maybe fix whatever issue you might have.
### For developers
- [Development](./development.md): For all developers. This covers how to build firmware from source and set up a development environment.
- [SDKs](./sdk.md): SDKs for Chameleon, useful if you want to develop your own application to control Chameleon.
- [Protocol](./protocol.md): The gory details of the communication protocol, useful if you want to develop your own client.
### Miscellaneous
- [Modding](./modding.md): Third party moddings worth mentioning.
- [FAQ](./faq.md): **F**requently **A**sked **Q**uestions, if you have a question, it might already be answered here.
+15
View File
@@ -0,0 +1,15 @@
## Get ChameleonUltraGUI
- [on Google Play](https://play.google.com/store/apps/details?id=io.chameleon.ultra) / [APK](https://nightly.link/GameTec-live/ChameleonUltraGUI/workflows/buildapp/main/apk.zip)
- [on iOS](https://apps.apple.com/dk/app/chameleon-ultra-gui/id6462919364)
- [on Windows](https://nightly.link/GameTec-live/ChameleonUltraGUI/workflows/buildapp/main/windows-installer.zip) ([or without installer](https://nightly.link/GameTec-live/ChameleonUltraGUI/workflows/buildapp/main/windows.zip))
- [on Linux](https://nightly.link/GameTec-live/ChameleonUltraGUI/workflows/buildapp/main/linux.zip)
- [on macOS](https://apps.apple.com/app/chameleon-ultra-gui/id6462919364)
## How to use MFKEY32
- set slot to mifare classic (by uploading an empty dump)
- enable mfkey32 for that slot (toggle in slot settings)
- select slot and present ultra repeatedly to the reader in order to collect nonces
- after collecting some nonces, go back into slot settings and click recover keys
+160
View File
@@ -0,0 +1,160 @@
# CLI
The CLI (**C**ommand **L**ine **I**nterface) is the official way to control your Chameleon.
It requires at least **Python 3.9** version.
## Installing
There are multiple ways to install the CLI, depending on your OS.
### Windows
Windows users have the choice of 4 options:
#### ProxSpace
Using ProxSpace to build the CLI is the easiest and most comfortable way to get started.
1. Download ProxSpace from the [official GitHub](https://github.com/Gator96100/ProxSpace/releases/latest)
2. [Download 7zip](https://www.7-zip.org/) to extract the archive
3. Install 7zip by double clicking the Installer and clicking `Install`
4. Right-click on the downloaded archive and select `7zip -> Unpack to "ProxSpace"`
5. Open a terminal in the proxspace folder. If you are on a new Windows install, you should be able to just right-click and select `Open in Terminal`. If that option is not visible and the ProxSpace folder is still in your downloads folder, press `win+r` and type `powershell` followed by enter. In Powershell now type `cd ~/Downloads/ProxSpace`
6. Run the command `.\runme64.bat`. After successful completion, you should be dropped to the `pm3 ~ $` shell.
7. Clone the Repository by typing `git clone https://github.com/RfidResearchGroup/ChameleonUltra.git`
8. Now go into the newly created folder with `cd ChameleonUltra/software/src`
9. Prepare for package installation with `pacman-key --init; pacman-key --populate; pacman -S msys2-keyring --noconfirm; pacman-key --refresh`
10. Proceed by installing Ninja with `pacman -S ninja --noconfirm`
11. Build the required config by running `cmake .`
12. And the binaries with `cmake --build .`
13. Copy the binaries by running `cp -r ~/ChameleonUltra/software/bin/* ~/ChameleonUltra/software/script/`
14. Go into the script folder with `cd ~/ChameleonUltra/software/script/`
15. Install python requirements with `pip install -r requirements.txt`
16. Finally run the CLI with `python chameleon_cli_main.py`
To use after installing, just do the following:
1. Run `runme64.bat`
2. Go into the script folder with `cd ~/ChameleonUltra/software/script/`
3. Run the CLI with `python chameleon_cli_main.py`
#### WSL2
Coming Soon
#### WSL1
Coming Soon
#### Build Natively
Building natively is a bit more advanced and not recommended for beginners
1. Download and install [Visual Studio Community](https://visualstudio.microsoft.com/de/downloads/)
2. On the workload selection screen, choose the `Desktop development with C++` workload. Click `Download and Install`
3. Download and install [git](https://git-scm.com/download). When asked, add to your path
4. Download and install [cmake](https://cmake.org/download/). Again, when asked, add to your path
5. Download and install [python](https://www.python.org/downloads/). When asked, add to your path (small checkbox in the bottom left)
6. Choose a suitable location and open a terminal. Clone the repository with `git clone https://github.com/RfidResearchGroup/ChameleonUltra.git`
7. Change into the binaries folder with `cd ChameleonUltra/software/src`
8. Build the required config by running `cmake .`
9. And the binaries with `cmake --build .`
10. Copy the binaries by running `cp -r ../bin/Debug/* ../script/`
11. Go into the script folder with `cd ../script/`
12. Create a python virtual environment with `python -m venv venv`
13. Activate it by running `.\venv\Scripts\Activate.ps1`
14. Install python requirements with `pip install -r requirements.txt`
15. Finally run the CLI with `python chameleon_cli_main.py`
To run again after installing, just do the following:
1. Activate venv by running `.\venv\Scripts\Activate.ps1`
2. Run the CLI with `python chameleon_cli_main.py`
### Linux
*Coming Soon*
### MacOS
*Coming Soon*
## Usage
When in the CLI, plug in your Chameleon and connect with `hw connect`. If autodetection fails, get the Serial Port used by your Chameleon and run `hw connect -p COM11` (Replace `COM11` with your serial port, on Linux it may be `/dev/ttyACM0`)
### Common activities
- Connect to the CLI: `hw connect`
- Change slot: `hw slot change -s [1-8]`
*More examples coming soon*
### MFKEY32v2 walk-through
Make sure to be in the `software/` directory and run the Python CLI from there.
- Connect to the CLI: `hw connect`
- Check which slot can be used: `hw slot list`
- Change the slot type, here using slot 8 for a MFC 1k emulation: `hw slot type -s8 -t3`
- Init the slot content: `hw slot init -s8 -t3`
- or load an existing dump and set UID and anticollision data, cf `hf mf eload -h` and `hf mf sim -h`
- Enable the slot: `hw slot enable -s8 -e1`
- Change to the new slot: `hw slot change -s8`
- Activate the detection: `hf detection enable -e1`
Now disconnect, go to a reader and swipe it a few times
- Come back and connect to the CLI: `hw connect`
- See if nonces were collected: `hf detection count`
- We need 2 nonces per key to recover
- Recover the key(s) based on the collected nonces: `hf detection decrypt`. Output example:
```
- MF1 detection log count = 6, start download.
- Download done (144bytes), start parse and decrypt
- Detection log for uid [DEADBEEF]
> Block 0 detect log decrypting...
> Block 1 detect log decrypting...
> Result ---------------------------
> Block 0, A key result: ['a0a1a2a3a4a5', 'aabbccddeeff']
> Block 1, A key result: ['010203040506']
```
- To clean the logged detection nonces: `hf detection enable -e0` then `hf detection enable -e1`
*More examples coming soon*
+351
View File
@@ -0,0 +1,351 @@
# Development
In this file you can look up how to [install requirements](#Prerequisites-for-compiling), [edit](#Editing-the-code), [compile](#Compiling-the-code) and [debug](#Debugging-the-code) the firmware!
## Prerequisites for compiling
### install a cross-compiler
So far, the following compilers have been reported to work fine.
Download one of them and decompress it.
Remember the path where you installed it.
- [gcc-arm-none-eabi-10.3-2021.10](https://developer.arm.com/downloads/-/gnu-rm)
- [arm-gnu-toolchain-12.2.rel1-XXX-arm-none-eabi](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads), e.g. [arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz](https://developer.arm.com/-/media/Files/downloads/gnu/12.2.rel1/binrel/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz) for a x86_64 Linux host
Always use the official versions from ARM, *DO NOT* install `gcc-arm-none-eabi` from Debian/Ubuntu.
For some unknown reasons, same gcc version from Debian creates a bootloader too large to fit in the allocated flash space.
Moreover it does not contain the `gdb` debugger.
### install make
* **Debian/Ubuntu alike**
* Open a terminal.
* Run the following command to install Make: `sudo apt-get install build-essential`
* **Windows using Chocolatey:**
* Open a PowerShell terminal with administrator privileges.
* If not yet installed, run the following command to install Chocolatey:
``` Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) ```
* In the same PowerShell terminal, run the following command to install Make using Chocolatey: `choco install make`
* **macOS:**
* Open a terminal.
* If not yet installed, install Homebrew package manager by running the following command: `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`
* Once Homebrew is installed, run the following command to install Make: `brew install make`
### install nRF tools
- Install nRF Util tool [nrfutil](https://www.nordicsemi.com/Products/Development-tools/nrf-util)
- Move it to a known path like `C:\nrfutil\` or `/usr/local/bin/`
- Add this path to the `PATH` Environment Variable if not yet there.
- Install nRF Util packages:
- `nrfutil install completion device nrf5sdk-tools trace`
- Install [nRF Command Line Tools](https://www.nordicsemi.com/Products/Development-tools/nrf-command-line-tools/download) to get `nrfjprog`, `mergehex` etc.
### install programmer tools
Depending on the hardware programmer you want to use, additional tools are needed.
- If you are using a J-Link:
- Install [Segger J-Link Software](https://www.segger.com/downloads/jlink)
- alternatively, you can use openocd as described below
- Note: a JLink OB (or a STLink reflashed as a JLink OB) will not work on a nRF.
- If you are using a ST-Link V2:
- Install [openocd](https://openocd.org/pages/getting-openocd.html)
- If under Windows, install [ST-Link drivers](https://www.st.com/en/development-tools/stsw-link009.html), extract the zip and run `dpinst_amd64.exe`
### configure the project
- Edit `Makefile.defs`:
- Change `GNU_INSTALL_ROOT` (path of previously installed Compiler `bin` folder)
- Change `GNU_VERSION` (Version of the installed Compiler) (FIXME: is it really used?)
- Change the other paths to match your system if needed
- Don't forget to remove the `#` in front of the changed lines
- Alternatively, if you are committing often code, it may be easier to leave `Makefile.defs` intact and to invoke `make` with the desired variables from a script, e.g. `make GNU_INSTALL_ROOT=../../../arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/bin/`
## Editing the code
You can use [Visual Studio Code](https://code.visualstudio.com/download) to edit this project! Simply download and
install it!
- Install the [C++ Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) in VS-Code.
- Install
the [C++ Extension Pack](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools-extension-pack) in
VS-Code.
- Create a new IntelliSense Configuration:
- press F1 in VS-Code and enter `C/C++: Edit Configurations (UI)`
- Add a new Configuration and name it
- Specify your Compiler path (path of previously installed Compiler `bin` folder)
- Change IntelliSense mode to `gcc-arm (legacy)`
- Add include path `${workspaceFolder}/**`
## Compiling the code
- Install prerequisites (for instructions have a look at [Prerequisites for compiling](#Prerequisites-for-compiling))
- Run `build.sh` or try to execute its steps manually if your platform is not yet properly supported. Feedback is always welcome.
The script produces several images in `objects`.
* `fullimage.hex` to be used with a programmer over the SWD pins
* `dfu-app.zip` and `dfu-full.zip` to be used with DFU mode
## Uploading the code in DFU mode
If the bootloader and the SoftDevice are already properly installed on the Chameleon, you can reflash it directly over DFU.
To set the device in DFU mode:
* you can use the Python client and issue the command `hw dfu`
* you can use the script `resource/tools/enter_dfu.py` that does exactly the same but may be easier to call from your scripts
* you can unplug the device, wait for it to sleep, then press the button B and plug it. If the application is bogus, this is the only way.
The LEDs 4 & 5 should blink green when in DFU mode.
To flash only the application (safer):
`nrfutil device program --firmware objects/dfu-app.zip --traits nordicDfu`
To flash everything (be sure to also have a JLink or ST-Link V2 programmer if something goes wrong):
`nrfutil device program --firmware objects/dfu-full.zip --traits nordicDfu`
Under Linux you can use the scripts `flash-dfu-app.sh` and `flash-dfu-full.sh`, they will put the device in DFU mode and flash it.
## Uploading the code with a programmer
Connect pins GND, SWC (swclk) and SWD (swdio) to your programmer.
With a JLink and `nrfjprog`
```
# application only:
nrfjprog -f nrf52 --program objects/application.hex --sectorerase --verify --reset
# full:
nrfjprog -f nrf52 --program objects/fullimage.hex --sectorerase --verify --reset
```
With a JLink and `openocd`
```
# application only:
openocd -f interface/jlink.cfg -f target/nrf52.cfg -c "program objects/application.hex verify reset ; shutdown"
# full:
openocd -f interface/jlink.cfg -f target/nrf52.cfg -c "program objects/fullimage.hex verify reset ; shutdown"
```
With a ST-Link V2 and `openocd`
```
# application only:
openocd -f interface/stlink.cfg -f target/nrf52.cfg -c "program objects/application.hex verify reset ; shutdown"
# full:
openocd -f interface/stlink.cfg -f target/nrf52.cfg -c "program objects/fullimage.hex verify reset ; shutdown"
```
## Uploading the code over BLE
If you are adventurous it is possible to flash the device over BLE (DFU mode).
To put the device in DFU mode
* you can use the Python client and issue the command `hw dfu` **TODO:** this will be possible only when the client will be able to work over BLE...
* you can use the script `resource/tools/enter_dfu_over_ble.py`
Once in DFU mode, the device will announce itself over BLE as `CU-xxxx` where xxxx are the last 2 bytes of the Device Serial Number.
Then use the official [nRF Device Firmware Update](https://www.nordicsemi.com/Products/Development-tools/nRF-Device-Firmware-Update) mobile application to flash one of the DFU images.
## Debugging the code from VSCode
- Install [Cortex-Debug](https://marketplace.visualstudio.com/items?itemName=marus25.cortex-debug) VS-Code Extension
- Open `app_main.c`
- Open the extension with `CTRL-SHIFT-D`
- Klick on `create a launch.json file`
- Select `Cortex-Debug`
- Add this in the configuration bracket:
```
{
"cwd": "${workspaceFolder}",
"executable": "${workspaceRoot}/firmware/objects/bootloader.out",
"name": "Debug with JLink",
"request": "launch",
"type": "cortex-debug",
"runToEntryPoint": "main",
"showDevDebugOutput": "none",
"servertype": "jlink",
"device": "nrf52",
"interface": "swd",
"svdFile": "${workspaceRoot}/firmware/nrf52_sdk/modules/nrfx/mdk/nrf52.svd",
},
{
"cwd": "${workspaceFolder}",
"executable": "${workspaceRoot}/firmware/objects/bootloader.out",
"name": "Debug with STLink",
"request": "launch",
"type": "cortex-debug",
"runToEntryPoint": "main",
"showDevDebugOutput": "none",
"servertype": "openocd",
"device": "nrf52",
"svdFile": "${workspaceRoot}/firmware/nrf52_sdk/modules/nrfx/mdk/nrf52.svd",
"gdbPath": "C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/bin/arm-none-eabi-gdb.exe",
"configFiles": [
"interface/stlink.cfg",
"target/nrf52.cfg"
]
}
```
- If you are jlink probe, create `settings.json` in {projectRoot}/.vscode directory.
```
{
"cortex-debug.armToolchainPath": "C:\\UserProgram\\arm_gcc\\none\\bin",
"cortex-debug.JLinkGDBServerPath": "C:\\Program Files\\SEGGER\\JLink\\JLinkGDBServerCL.exe",
}
```
- To change `executable` target in `launch.json` to `application` or `bootloader`
- In the debug menu you can select `Debug with JLink` or `Debug with STLink`
## Debugging the code with gdb and openocd
See first if you can execute `arm-none-eabi-gdb` from the installed tools.
* gcc-arm-none-eabi-10.3-2021.10 gdb requires `libncurses5`
* arm-gnu-toolchain-12.2.rel1 gdb requires Python 3.8
In case Python 3.8 is not available anymore on your distro, to install a local copy you can do
```
wget https://www.python.org/ftp/python/3.8.17/Python-3.8.17.tgz
tar zxvf Python-3.8.17.tgz
cd Python-3.8.17
./configure --prefix=$HOME/opt/python-3.8.17 --enable-shared
make
rm -rf ~/opt/python-3.8.17
make install
```
Connect openocd to the device with a JLink or a ST-Link V2
```
openocd -f interface/jlink.cfg -f target/nrf52.cfg
```
```
openocd -f interface/stlink.cfg -f target/nrf52.cfg
```
Then run gdb as follows
```
PYTHONHOME=~/opt/python-3.8.17/ arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-gdb
```
and tell gdb to connect to openocd
```
target extended-remote localhost:3333
```
## BlackMagicProbe with RTT support, out of a ST-Link V2
You can reflash a ST-Link V2 to use it as a BlackMagicProbe, to get support for RTT and see NRF_LOG messages.
Some clones have only 64kb, this is too short.
Even 128kb is too small when enabling RTT, but we can comment parts of the BMP source code.
```
git clone --recursive git@github.com:blackmagic-debug/stlink-tool.git
( cd stlink-tool && make )
```
Then put the `stlink-tool` binary in your path.
Get [BMP full sources](https://github.com/blackmagic-debug/blackmagic/releases)
Comment out all probes except Nordic nrf51 in `src/target/cortexm.c` big switch for probes. It should remain
```c
switch (t->designer_code) {
case JEP106_MANUFACTURER_NORDIC:
PROBE(nrf51_probe);
break;
}
```
```
make -j PROBE_HOST=stlink ST_BOOTLOADER=1 ENABLE_RTT=1
```
Then flash the ST_Link V2
```
stlink-tool src/blackmagic.bin
```
See [src/platforms/stlink/README.md](https://github.com/blackmagic-debug/blackmagic/blob/main/src/platforms/stlink/README.md) for more details.
Unplug/plug.
Every time you plug the ST-Link, you have to run `stlink-tool` to enable BMP.
Under linux, it is convenient to install [udev rules](https://github.com/blackmagic-debug/blackmagic/blob/main/driver/README.md#99-blackmagic-plugdevrules) to get aliases `/dev/ttyBmpGdb` and `/dev/ttyBmpTarg`.
Note that using a native ST-Link V2 with BlackMagicProbe "hosted" will not allow to see NRF_LOG messages.
## Debugging the code with gdb and BMP with RTT to monitor NRF_LOG
Assuming you have a BlackMagicProbe with RTT support made out of a ST-Link V2.
RTT usage: https://black-magic.org/usage/rtt.html
```
stlink-tool
sleep 1
screen /dev/ttyBmpTarg
```
In another terminal
```
$ arm-none-eabi-gdb
(gdb) target extended-remote /dev/ttyBmpGdb
(gdb) monitor swdp_scan
1 Nordic nRF52 M4
2 Nordic nRF52 Access Port.
(gdb) attach 1
(gdb) monitor rtt
```
We are now able to use gdb and see the NRF_LOG messages on the other terminal.
## Using JLink with RTT to monitor NRF_LOG
cf https://embeddedexplorer.com/nrf52-nrf-log-tutorial/
```
JLinkExe -if SWD -device nrf52 -speed 4000 -autoconnect 1
```
in a second terminal:
```
JLinkRTTClient
```
## 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.
When activated, NRF_LOG will be available if one connects a UART bridge to the SWO pin which will work as a UART TX pin.
UART works at 115200 bauds. E.g. one can use a FTDI dongle and `screen /dev/ttyUSB0 115200`.
Contrary to RTT that needs to be activated by a JTAG probe, UART logs are immediately available.
Limitations:
* SWO pin is shared with... SWO so when e.g. reflashing the device, garbage may appear on the monitoring terminal.
* SWO pin is also shared with the blue channel of the RGB slot LEDs, so faint blue may appear briefly when logs are sent and LED might not work properly when supposed to be blue.
# Resources
* [nRF52840 Objective Product Specification v0.5.1](https://infocenter.nordicsemi.com/pdf/nRF52840_OPS_v0.5.1.pdf)
+120
View File
@@ -0,0 +1,120 @@
# Firmware
The Chameleon flash contains several parts: the bootloader and its settings, the application, the user data and the SoftDevice.
NOTE: If you are a developer searching for the building instructions, look into [development](./development.md)
## The Bootloader
The bootloader is the lowest-level program running on your Chameleon. It is read-only and provides the DFU (**D**evice **F**irmware **U**pgrade) mode. The bootloader being read-only, it makes it really hard to brick your Chameleon. The flash also contains a special section to store bootloader settings required by the nRF to deal with upgrades. This is only a concern for developers.
You enter DFU mode by of the following methods:
1. Physical button
- Disconnect the Chameleon and wait for it to enter sleep mode
- Hold down the πŸ…‘ button. If you are using Windows you have to wait about ~5s before next step.
- Plug USB into a PC while still holding the button. If you are using Windows you have to wait about ~10s before next step.
- Then release the πŸ…‘ button
2. From CLI
- Execute the command `hw dfu`
3. From GUI
- Click on `Enter DFU mode`
4. From Shell
- Execute the script `resource/tools/enter_dfu.py`
The device stays in DFU mode for ~30s.
While in DFU mode waiting for the update, the LEDs 4 and 5 blink alternatively green 🟒🟒.
You can then perform firmware upgrades either via a GUI or the command line:
1. Download nRF Util from the [nRF website](https://www.nordicsemi.com/Products/Development-tools/nrf-util)
2. Open a Command Line / Terminal on your PC
3. Install the "device" toolkit by running `nrfutil install device`
4. Download the Chameleon firmware from [GitHub](https://github.com/RfidResearchGroup/ChameleonUltra/releases). At the moment it is better to take the *Development release* but beware bugs can occur. Choose `ultra-dfu-app.zip` for the Ultra or the Devkit, and `lite-dfu-app.zip` for the Lite.
5. Put your Chameleon into DFU mode and install the firmware with the following command: `nrfutil device program --firmware ultra-dfu-app.zip --traits nordicDfu` (keep in mind to change the filename if you are using a Lite).
Step 5: Alternatively you can connect the Chameleon over USB and use the script `firmware/flash-dfu-app.sh` which will take care of flipping it into DFU mode and flashing it with the adequate firmware.
While flashing firmware is in progress, the LEDs 4 and 5 should blink fast blue πŸ”΅πŸ”΅ and the firmware update should be finished in a matter of seconds. Using DFU and performing a firmware update also helps recovering from most device-related issues.
If LEDs 4 and 5 are flashing slow red πŸ”΄πŸ”΄, it indicates an issue with DFU. Try to unplug and plug again or unplug and wait for it to timeout and try again the whole procedure.
## The Application
The application is the piece of software being loaded by the bootloader. It communicates with the client, emulates, reads and writes cards, drives the LEDs, handles buttons and much more. The application is also writable, it is the piece of software being updated via DFU.
The communication with the application is either done via the CLI or a GUI. Communication can be done over USB or BLE (**B**luetooth **L**ow **E**nergy), although, at time of writing, only GUIs support BLE.
On boot, the application starts in emulation mode, so it can emulate up to 8 HF tags and up to 8 LF tags (one slot can handle both a HF and a LF).
The Chameleon can be awaken:
- by pressing a button
- when it comes close to a HF or LF field, *only if* a card corresponding to that field (HF/LF) is loaded into the active slot.
The white LED labeled RF lights up when it detects a field, again only if the active slot supports it.
In some situations, it can be cumbersome to wait for the boot-up animation. This is configurable, cf e.g. the CLI command `hw settings animation set -h`.
On a new Chameleon (or after a factory reset), 3 slots are defined, slot 1 holding both a HF and a LF:
- 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 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:
- 🟒 HF card loaded
- πŸ”΅ LF card loaded
- πŸ”΄ Both HF and LF loaded
When a dual HF/LF slot is activated by an external field, it will turn green or blue according to the frequency.
The application controls the buttons. The behavior of the buttons is customizable via the CLI or a GUI. The default behavior is the following:
- πŸ… short press: Select previous slot
- πŸ…‘ short press: Select next slot
- πŸ… long press: Copy LF or HF tag UID (only Ultra, not Lite)
- πŸ…‘ long press: Copy LF or HF tag UID (only Ultra, not Lite)
*About UID copy*: the action depends on the current slot support. So to be able to copy an EM4100 LF tag, the slot must be configured firstly to emulate an EM4100 tag. And to be able to copy a HF 14a tag, the slot must be configured for the right type of HF tag. Only the UID will be copied, not the data.
The Chameleon also shows the following LED effects:
- Charging: 4 pulsing green lights
- CLI / GUI connected over USB: Chasing LEDs in the color of the selected slot (left to right for slots 1-4 and right to left for slots 5-8).
The device enters sleep mode after about 5s unless it is plugged in USB or if a client is connected over BLE. You can use the buttons to wake it up again. You can also press quickly a button during the sleep animation to keep the device awake.
## Write Modes
- **Normal**: Behaves like any normal card
- **Denied**: Read-only card, send NACK to write attempts
- **Deceive**: Accepts write commands but don't change any data (reader thinks write was successful but when reading back, nothing changed)
- **Shadow**: Accepts writes but reverts changes when device goes to sleep (reader can read and write like a normal card but changes are kept in RAM and are lost when the chameleon goes to sleep)
## The SoftDevice
A [SoftDevice](https://infocenter.nordicsemi.com/index.jsp?topic=%2Fstruct_nrf52%2Fstruct%2Fnrf52_softdevices.html) is a precompiled and linked binary software implementing a wireless protocol developed by Nordic Semiconductor.
We are using the [SoftDevice S140](https://infocenter.nordicsemi.com/index.jsp?topic=%2Fstruct_nrf52%2Fstruct%2Fnrf52_softdevices.html) which implements a BLE Central and Peripheral protocol stack solution.
## The User Data
The Chameleon has a reserved space of memory and flash where it stores application settings, active slot and slots configurations and data. This will not be overwritten by DFU updates and the data will only be reset by either issuing `hw factory_reset --i-know-what-im-doing` in the CLI or clicking `Factory reset` in a GUI.
*Warning:* Settings and/or data might be reset to defaults if you downgrade the firmware version up to a version not supporting the newer format.

Some files were not shown because too many files have changed in this diff Show More