### Install nRF Util Packages Source: https://github.com/rfidresearchgroup/chameleonultra/wiki/development Installs necessary nRF Util packages for device management and tracing. ```bash nrfutil install completion device nrf5sdk-tools trace ``` -------------------------------- ### Install Make on macOS Source: https://github.com/rfidresearchgroup/chameleonultra/wiki/development Installs Homebrew package manager and then Make on macOS systems. ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` ```bash brew install make ``` -------------------------------- ### Install Make on Debian/Ubuntu Source: https://github.com/rfidresearchgroup/chameleonultra/wiki/development Installs the Make build tool and essential build utilities on Debian-based systems. ```bash sudo apt-get install build-essential ``` -------------------------------- ### Configure Makefile.defs with GNU Install Root Source: https://github.com/rfidresearchgroup/chameleonultra/wiki/development Example of invoking make with a specific GNU_INSTALL_ROOT path, useful for custom compiler installations. ```makefile make GNU_INSTALL_ROOT=../../../arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/bin/ ``` -------------------------------- ### Full Installation Script (Linux/macOS) Source: https://github.com/rfidresearchgroup/chameleonultra/wiki/cli A bash script to clone the repository, compile tools, set up a Python virtual environment, and install dependencies. ```bash #!/bin/bash git clone https://github.com/RfidResearchGroup/ChameleonUltra.git ( cd ChameleonUltra/software/src mkdir -p out ( cd out cmake .. cmake --build . --config Release ) ) ( cd ChameleonUltra/software/script python3 -m venv venv source venv/bin/activate pip3 install -r requirements.txt deactivate ) ``` -------------------------------- ### MFKEY32v2 Key Recovery Output Example Source: https://github.com/rfidresearchgroup/chameleonultra/wiki/cli Example output showing the process of downloading, parsing, and decrypting detection logs to reveal recovered keys. ```text - 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'] ``` -------------------------------- ### Install Chocolatey and Make on Windows Source: https://github.com/rfidresearchgroup/chameleonultra/wiki/development Installs Chocolatey package manager and then Make on Windows systems using PowerShell. ```powershell 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')) ``` ```powershell choco install make ``` -------------------------------- ### DFU Upgrade Failure Example 2 Source: https://github.com/rfidresearchgroup/chameleonultra/wiki/troubleshooting This is an example of a DFU upgrade failure log indicating a general failure. ```log [00:00:00] ------ 0% [2/2 ...] Failed, [sdfu] ``` -------------------------------- ### Install Python 3.8 Locally Source: https://github.com/rfidresearchgroup/chameleonultra/wiki/development Installs a local copy of Python 3.8 if it's not available on your system, required by certain GDB versions. ```bash 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 ``` -------------------------------- ### Install Dependencies (Linux/macOS) Source: https://github.com/rfidresearchgroup/chameleonultra/wiki/cli Installs necessary dependencies like git, cmake, and python3-venv using package managers for Ubuntu/Debian, Arch, or Homebrew for macOS. ```bash sudo apt install git cmake build-essential python3-venv ``` ```bash sudo pacman -S git cmake base-devel python3 ``` ```bash brew install git cmake python3 ``` -------------------------------- ### Start JLink RTT Client Source: https://github.com/rfidresearchgroup/chameleonultra/wiki/development Launches the JLinkRTTClient to view RTT log messages. ```bash JLinkRTTClient ``` -------------------------------- ### Legacy nRF24Lxx ESB Example Adjustments Source: https://github.com/rfidresearchgroup/chameleonultra/blob/main/firmware/nrf52_sdk/documentation/release_notes.txt These code snippets are required to make legacy nRF24Lxx ESB examples compatible with nRF51 ESB examples. They address payload handling, RF channel, and dynamic payload length configurations. ```c hal_nrf_setup_dynamic_payload(0xFF); hal_nrf_enable_dynamic_payload(true); hal_nrf_enable_ack_payload(true); hal_nrf_set_rf_channel(10); ``` -------------------------------- ### Run Chameleon CLI (Linux/macOS) Source: https://github.com/rfidresearchgroup/chameleonultra/wiki/cli After installation, navigate to the script directory, activate the virtual environment, and run the CLI. ```bash cd ChameleonUltra/software/script source venv/bin/activate python3 chameleon_cli_main.py deactivate ``` -------------------------------- ### Legacy nRF24Lxx ESB Example Adjustments Source: https://github.com/rfidresearchgroup/chameleonultra/blob/main/firmware/nrf52_sdk/documentation/release_notes.txt These code snippets are required to make legacy nRF24Lxx ESB examples compatible with nRF51 ESB examples. They involve setting up dynamic payload, enabling ACK payloads, and configuring the RF channel. ```c hal_nrf_setup_dynamic_payload(0xFF); hal_nrf_enable_dynamic_payload(true); hal_nrf_enable_ack_payload(true); hal_nrf_set_rf_channel(10); ``` -------------------------------- ### Start JLink with SWD and Autoconnect Source: https://github.com/rfidresearchgroup/chameleonultra/wiki/development Launches JLinkExe to connect to an nrf52 device via SWD at 4000kHz speed, automatically connecting. ```bash JLinkExe -if SWD -device nrf52 -speed 4000 -autoconnect 1 ``` -------------------------------- ### GitHub Commit Hash Example Source: https://github.com/rfidresearchgroup/chameleonultra/wiki/protocol Example of a commit hash returned by the GitHub API when a release tag is used. ```text "4747d3884d21e0df8549e3029a920ea390e0b00a" ``` -------------------------------- ### Enter DFU Mode via CLI Source: https://github.com/rfidresearchgroup/chameleonultra/wiki/firmware Use this command to initiate the Device Firmware Upgrade mode from the command line interface. ```bash hw dfu ``` -------------------------------- ### DFU Upgrade Failure Example 1 Source: https://github.com/rfidresearchgroup/chameleonultra/wiki/troubleshooting This is an example of a DFU upgrade failure log indicating a type error. ```log [00:00:00] ------ 0% [id:9] Failed, [sdfu] [json.exception.type_error.302] type must be string, but is null ``` -------------------------------- ### Run Chameleon CLI in ProxSpace (Windows) Source: https://github.com/rfidresearchgroup/chameleonultra/wiki/cli After setting up ProxSpace and cloning the repository, navigate to the script directory and run the CLI using Python. ```bash python chameleon_cli_main.py ``` -------------------------------- ### Upload Full Firmware via DFU Source: https://github.com/rfidresearchgroup/chameleonultra/wiki/development Use this command to flash the entire firmware package using DFU mode. Ensure you have a programmer available as a backup. ```bash nrfutil device program --firmware objects/dfu-full.zip --traits nordicDfu ``` -------------------------------- ### Flashing Algorithm Settings in Keil Source: https://github.com/rfidresearchgroup/chameleonultra/blob/main/firmware/nrf52_sdk/documentation/release_notes.txt Update flash algorithm settings in Keil to resolve 'Cannot Load Flash Device Description !' pop-up. Ensure 'nRF51xxx' is in the list of flashing algorithms. ```text - Write new flash algorithm settings to the uvopt file. Press ALT+F7 to open "Options for Target" dialog. Select "Options for Target" -> "Utilities". Press "Settings" button to see flashing algorithms. Verify that "nRF51xxx" is in the list of flashing algorithms, if not add it by pressing the "Add" button. Exit and save settings by pressing "OK". This is also important to do if you did find the "nRF51xxx" in the list of flashing algorithms. ``` -------------------------------- ### CMake Error Example Source: https://github.com/rfidresearchgroup/chameleonultra/wiki/troubleshooting Example of a CMake error encountered during compilation, specifically related to the C compiler not being able to compile a test program. ```log pm3 ~/ChameleonUltra/software/src$ cmake . -- Building for: Ninja -- The C compiler identification is GNU 10.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - failed -- Check for working C compiler: C:/Users/moeya/Desktop/Chamelion/ProxSpace/msys2/mingw64/bin/cc.exe -- Check for working C compiler: C:/Users/moeya/Desktop/Chamelion/ProxSpace/msys2/mingw64/bin/cc.exe - broken CMake Error at C:/Users/moeya/Desktop/Chamelion/ProxSpace/msys2/mingw64/share/cmake-3.21/Modules/CMakeTestCCompiler.cmake:69 (message): The C compiler "C:/Users/xxx/ProxSpace/msys2/mingw64/bin/cc.exe" is not able to compile a simple test program. ``` -------------------------------- ### Start RTT Logging Session Source: https://github.com/rfidresearchgroup/chameleonultra/wiki/development Initiates an RTT logging session using stlink-tool and then connects to the target terminal with screen. ```bash stlink-tool sleep 1 screen /dev/ttyBmpTarg ``` -------------------------------- ### Run Chameleon CLI Natively (Windows) Source: https://github.com/rfidresearchgroup/chameleonultra/wiki/cli After native build and setup, activate the Python virtual environment and run the CLI. ```powershell .\venv\Scripts\Activate.ps1 ``` ```powershell python chameleon_cli_main.py ```