### Clone and Navigate to USB/IP Runner Directory Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/docs/usbip.md Clone the firmware repository and change into the usbip directory to begin the setup process. ```bash git clone https://github.com/Nitrokey/nitrokey-3-firmware.git cd runners/usbip ``` -------------------------------- ### Execute the USB/IP Runner Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/docs/usbip.md Start the USB/IP device simulation by running the compiled program. ```bash cargo run ``` -------------------------------- ### Setup, Test, and Cleanup Commands for SSH Authentication Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/ssh/troubles/README.md These commands are used to manage the build and testing process for SSH authentication. 'make build' sets up the environment, 'make test' runs the authentication tests, and 'make clean' resets the system by removing keys and the built image. ```bash # to set everything up $ make build # to run the actual SSH auth test $ make test # to reset - remove keys, remove built image $ make clean ``` -------------------------------- ### Start J-Link GDB Server Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/utils/lpc55-builder/README.md Start the J-Link GDB server for interactive debugging. This requires the J-Link Software and Documentation Pack to be installed. ```bash make jlink ``` -------------------------------- ### Install Rust Toolchain for Embedded Development Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/docs/lpc55-quickstart.md Install the necessary Rust target for embedded development on the Nitrokey 3. ```bash $ rustup target add thumbv8m.main-none-eabi ``` -------------------------------- ### Run Firmware and Enter Debugger Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/utils/lpc55-builder/README.md Flash and run the firmware, then enter the GDB debugger. Useful for logging via semihosting. ```bash make run ``` -------------------------------- ### Build All Artifacts Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/utils/nrf-builder/README.md Use this command to build all firmware artifacts. It is equivalent to running 'make build'. ```bash make ``` ```bash make build ``` -------------------------------- ### Provision Test Keys and Certificates Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/utils/nrf-builder/README.md Command to provision test keys and certificates onto the device. This is typically done after flashing the provisioner. ```bash make provision-keys ``` -------------------------------- ### Run Firmware with Semihosting and Trace Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/utils/lpc55-builder/README.md Run the firmware with specific features enabled, such as logging via semihosting and trace. This command allows for more detailed debugging output. ```bash make run FEATURES=log-semihosting,log-traceP ``` -------------------------------- ### Verify Firmware Provisioning Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/docs/lpc55-quickstart.md Test the provisioned firmware by checking UUID, version, and FIDO2 functionality. Expect a FIDO2 failure due to missing batch keys. ```bash $ nitropy nk3 test --exclude provisioner ``` -------------------------------- ### Full Deployment Round Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/utils/nrf-builder/README.md Executes a complete firmware deployment cycle, including building, flashing all components, and provisioning keys. ```bash make full-deploy ``` -------------------------------- ### Build LPC55 Firmware Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/utils/lpc55-builder/README.md Use this command to build the LPC55 firmware. Ensure you are in the lpc55-builder directory. ```bash make build ``` -------------------------------- ### View RTT Debugging Outputs Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/utils/nrf-debugging/README.md Flash the device and then connect to the debugger to view RTT outputs. Ensure the device is flashed before connecting to the debugger. ```bash # - flash the device (make -C ../nrf-builder flash-develop) # inside a terminal, connect to the debugger make ocd # inside another terminal, show rtt outputs make rtt ``` -------------------------------- ### Build Nitrokey 3 Test Firmware Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/docs/lpc55-quickstart.md Compile the Nitrokey 3 test firmware by activating the 'test' feature. Ensure you have the necessary build environment set up. ```bash make -C runners/embedded build-nk3xn FEATURES=test ``` -------------------------------- ### Provision Nitrokey 3 Firmware Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/docs/lpc55-quickstart.md Build, configure, and flash the release version of the Nitrokey 3 firmware. ```bash $ make -C utils/lpc55-builder provision-release ``` -------------------------------- ### Compile Nitrokey 3 Firmware Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/docs/lpc55-quickstart.md Compile the Nitrokey 3 firmware using the provided Makefile. ```bash $ make -C runners/embedded build-nk3xn ``` -------------------------------- ### Attach the Simulated USB/IP Device Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/docs/usbip.md Load the vhci-hcd kernel module and attach the simulated device to the host system. This command requires root privileges. ```bash make attach ``` -------------------------------- ### Build the USB/IP Runner Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/docs/usbip.md Compile the USB/IP runner using Cargo, the Rust package manager. ```bash cargo build ``` -------------------------------- ### Fetch and Update Nitrokey 3 Firmware Release Candidate Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/docs/testing.md Use this command sequence to download a specific release candidate firmware image and then update your Nitrokey 3 device. Ensure you replace `` and `` with the appropriate values for your device and the desired release candidate. ```bash $ nitropy nk3 fetch-update --variant lpc55 --version v1.0.3-rc.1 Command line tool to interact with Nitrokey devices 0.4.26 Download v1.0.3-rc.1: 100%|██████████████████████████████████████████| 305k/305k [00:00<00:00, 5.63MB/s] Successfully downloaded firmware release v1.0.3-rc.1 to ./firmware-nk3xn-lpc55-v1.0.3-rc.1.sb2 $ nitropy nk3 update firmware-nk3xn-lpc55-v1.0.4-rc.1.sb2 ``` -------------------------------- ### Run J-Link Debugger for Nitrokey 3 Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/docs/lpc55-quickstart.md Execute the J-Link debugger command to flash the firmware and prepare for debugging with gdb. Ensure JP2 is closed before running. ```bash make -C utils/lpc55-builder jlink ``` -------------------------------- ### Clone Firmware Repository Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/docs/lpc55-quickstart.md Clone the Nitrokey 3 firmware repository to your local machine. ```bash $ git clone https://github.com/nitrokey/nitrokey-3-firmware $ cd nitrokey-3-firmware ``` -------------------------------- ### Flash and Execute Firmware with GDB Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/docs/lpc55-quickstart.md Flash the Nitrokey 3 firmware and execute it using gdb via the J-Link debugger. This command is used after setting up the J-Link connection. ```bash make -C utils/lpc55-builder run ``` -------------------------------- ### Run GDB for Debugging Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/utils/nrf-debugging/README.md Connect to the debugger and then run GDB. This is used for interactive debugging sessions. ```bash make ocd make it ``` -------------------------------- ### Flash Specific Parts Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/utils/nrf-builder/README.md Commands to flash individual components of the firmware. Use these for targeted updates or debugging. ```bash make flash-provisioner ``` ```bash make flash-firmware ``` ```bash make flash-bootloader ``` -------------------------------- ### Dump Filesystem (LFS) Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/utils/nrf-debugging/README.md Dumps the filesystem using the 'lfs_fast' command. Note that the device will be stuck after this operation. ```bash make lfs_fast # after this operation the device is stuck! ``` -------------------------------- ### Program J-Link Firmware Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/docs/lpc55-quickstart.md Program the J-Link debugger firmware using the lpcscrypt tool. This step is necessary if the SEGGER J-Link PLUS device does not appear in lsusb output. ```bash /usr/local/lpcscrypt/scripts/program_JLINK ``` -------------------------------- ### Clean Build Artifacts Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/utils/nrf-builder/README.md Removes all generated build artifacts, cleaning the project directory. Use this before a fresh build if needed. ```bash make clean ``` -------------------------------- ### Run USB/IP Runner with CCID Feature Enabled Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/docs/usbip.md Execute the USB/IP runner with the 'ccid' feature enabled, which is necessary for using the CCID transport protocol. This may require stopping pcscd services beforehand. ```bash cargo run --features ccid ``` -------------------------------- ### Update Nitrokey 3 Firmware Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/docs/lpc55-quickstart.md Re-build and update the Nitrokey 3 firmware, potentially requiring touch button interaction. ```bash $ make -C utils/lpc55-builder flash FEATURES=develop ``` -------------------------------- ### Flash Nitrokey 3 Test Firmware Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/docs/lpc55-quickstart.md Update the Nitrokey 3 to the test firmware using the lpc55-builder utility. This requires the 'develop' and 'test' features to be enabled. ```bash make -C utils/lpc55-builder flash FEATURES=develop,test ``` -------------------------------- ### Identify Nitrokey 3 Hardware Variant Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/docs/testing.md Reboot your Nitrokey 3 into bootloader mode and use this command to list connected devices and identify their hardware variant. This is crucial for selecting the correct firmware image during updates. ```bash $ nitropy nk3 list Command line tool to interact with Nitrokey devices 0.4.26 :: 'Nitrokey 3' keys /dev/hidraw4: Nitrokey 3 Bootloader (LPC55) ``` -------------------------------- ### Reset Nitrokey 3 Device Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/docs/lpc55-quickstart.md Reset the Nitrokey 3 device to a clean state before flashing. ```bash $ make -C utils/lpc55-builder reset ``` -------------------------------- ### Patching a Dependency in Cargo.toml Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/docs/contributing.md Use this method to override a dependency with a forked version from a Git repository when upstream changes are not feasible in time. Ensure the patch is specific to the required dependency. ```toml [patch."https://github.com/trussed-dev/trussed"] trussed = { git = "https://github.com/Nitrokey/trussed", branch = "wink" } ``` -------------------------------- ### Stop pcscd Services for CCID Feature Source: https://github.com/nitrokey/nitrokey-3-firmware/blob/main/docs/usbip.md Before activating the 'ccid' feature, it is recommended to stop the pcscd service and socket to avoid potential conflicts or issues. ```bash sudo systemctl stop pcscd.service pcscd.socket ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.