proxmark3/doc/md/Use_of_Proxmark/0_Compilation-Instructions.md

173 lines
5.8 KiB
Markdown
Raw Normal View History

2021-12-31 18:42:15 +08:00
<a id="Top"></a>
2019-05-06 01:53:58 +08:00
# Compilation instructions
2021-12-31 18:42:15 +08:00
# Table of Contents
- [Compilation instructions](#compilation-instructions)
- [Table of Contents](#table-of-contents)
- [Tuning compilation parameters](#tuning-compilation-parameters)
- [Compile for Proxmark3 RDV4](#compile-for-proxmark3-rdv4)
- [Compile for generic Proxmark3 platforms](#compile-for-generic-proxmark3-platforms)
- [Get the latest commits](#get-the-latest-commits)
- [Clean and compile everything](#clean-and-compile-everything)
- [if you got an error](#if-you-got-an-error)
- [Install](#install)
- [Flash the BOOTROM & FULLIMAGE](#flash-the-bootrom--fullimage)
2022-08-20 05:14:31 +08:00
- [The button trick](#the-button-trick)
2022-02-27 15:07:10 +08:00
- [flasher stops and warns you about firmware image](#flasher-stops-and-warns-you-about-firmware-image)
2021-12-31 18:42:15 +08:00
- [Run the client](#run-the-client)
- [Next steps](#next-steps)
2019-07-12 07:48:39 +08:00
## Tuning compilation parameters
2021-12-31 18:42:15 +08:00
^[Top](#top)
2019-07-12 07:48:39 +08:00
The client and the Proxmark3 firmware should always be in sync.
Nevertheless, the firmware can be tuned depending on the Proxmark3 platform and options.
2022-02-27 00:15:32 +08:00
Indeed, the Iceman fork can be used on other Proxmark3 hardware platforms as well.
2019-07-12 07:48:39 +08:00
2021-07-10 01:03:54 +08:00
Via some definitions, you can adjust the firmware for a given platform, but also to add features like the support of the Blue Shark add-on or to select which standalone mode to embed. To learn how to adjust the firmware, please read [Advanced compilation parameters](/doc/md/Use_of_Proxmark/4_Advanced-compilation-parameters.md).
2021-07-10 01:05:46 +08:00
### Compile for Proxmark3 RDV4
2021-12-31 18:42:15 +08:00
^[Top](#top)
2021-07-10 01:03:54 +08:00
The repo defaults for compiling a firmware and client suitable for Proxmark3 RDV4.
2021-07-10 01:05:46 +08:00
### Compile for generic Proxmark3 platforms
2021-12-31 18:42:15 +08:00
^[Top](#top)
2021-07-10 01:03:54 +08:00
In order to build this repo for generic Proxmark3 platforms we urge you to read [Advanced compilation parameters](/doc/md/Use_of_Proxmark/4_Advanced-compilation-parameters.md)
2019-07-12 07:48:39 +08:00
2019-05-06 01:53:58 +08:00
## Get the latest commits
2021-12-31 18:42:15 +08:00
^[Top](#top)
2019-05-06 01:53:58 +08:00
```sh
cd proxmark3
git pull
```
## Clean and compile everything
2021-12-31 18:42:15 +08:00
^[Top](#top)
2019-05-06 01:53:58 +08:00
```sh
make clean && make -j
2019-05-06 01:53:58 +08:00
```
2020-09-15 23:36:07 +08:00
### if you got an error
2021-12-31 18:42:15 +08:00
^[Top](#top)
2020-09-15 23:36:07 +08:00
Read the [troubleshooting guide](/doc/md/Installation_Instructions/Troubleshooting.md),
2021-07-10 01:04:53 +08:00
For instance, on WSl-1 you usually get the `libQt5Core.so.5 not found` message
2020-09-15 23:36:07 +08:00
[solution](/doc/md/Installation_Instructions/Troubleshooting.md#libQt5Coreso5-not-found)
2019-09-04 04:54:42 +08:00
## Install
2021-12-31 18:42:15 +08:00
^[Top](#top)
2019-09-04 04:54:42 +08:00
This is an optional step. If you do
```sh
sudo make install
```
Then the required files will be installed on your system, by default in `/usr/local/bin` and `/usr/local/share/proxmark3`.
Maintainers can read [this doc](../Development/Maintainers.md) to learn how to modify installation paths via `DESTDIR` and `PREFIX` Makefile variables.
The commands given in the documentation assume you did the installation step. If you didn't, you've to adjust the commands paths and files paths accordingly,
e.g. calling `./pm3` or `client/proxmark3` instead of just `pm3` or `proxmark3`.
2019-05-06 01:53:58 +08:00
## Flash the BOOTROM & FULLIMAGE
2021-12-31 18:42:15 +08:00
^[Top](#top)
2019-05-06 01:53:58 +08:00
2019-09-10 01:55:55 +08:00
In most cases, you can run the following script which try to auto-detect the port to use, on several OS:
2019-05-06 01:53:58 +08:00
2019-09-10 01:55:55 +08:00
```sh
pm3-flash-all
```
For the other cases, specify the port by yourself. For example, for a Proxmark3 connected via USB under Linux (adjust the port for your OS):
2019-05-06 01:53:58 +08:00
2019-09-04 04:54:42 +08:00
```sh
2019-09-10 01:55:55 +08:00
proxmark3 /dev/ttyACM0 --flash --unlock-bootloader --image bootrom.elf --image fullimage.elf
2019-09-04 04:54:42 +08:00
```
2019-09-10 01:55:55 +08:00
The firmware files will be searched in the expected locations (installed files, working repo files, user folder, etc.). You can also specify their location:
```sh
pm3-flash -b /tmp/my-bootrom.elf /tmp/my-fullimage.elf
```
or
2019-09-04 04:54:42 +08:00
2019-05-06 01:53:58 +08:00
```sh
2019-09-10 01:55:55 +08:00
proxmark3 /dev/ttyACM0 --flash --unlock-bootloader --image /tmp/my-bootrom.elf --image /tmp/my-fullimage.elf
2019-05-06 01:53:58 +08:00
```
2022-08-20 05:14:31 +08:00
### The button trick
^[Top](#top)
2022-08-20 05:15:48 +08:00
2022-08-20 05:14:31 +08:00
If the flasher can't detect your Proxmark3 (especially the very first time you flash a new device), force it to enter the bootloader mode as following:
With your Proxmark3 unplugged from your machine, press and hold the button on your Proxmark3 as you plug it into a USB port.
You can release the button, two of the four LEDs should stay on.
You're in bootloader mode, ready for the next step.
In case the two LEDs don't stay on when you're releasing the button, you've a very old bootloader, start over and keep the button pressed during the whole flashing procedure.
2022-02-27 20:44:35 +08:00
2022-02-27 15:07:10 +08:00
## flasher stops and warns you about firmware image
^[Top](#top)
2022-02-27 19:06:14 +08:00
The Proxmark3 software and firmware is connected tightly. The strong recommendation is to use the client with a Proxmark3 device flashed with firmware images from same source version.
In the flash process you might get this message because the firmware images is downloaded or distributed and you have compiled your own client from a different source version.
To minimize the risks the flasher warns about it and stops.
2022-02-27 15:07:10 +08:00
```
Make sure to flash a correct and up-to-date version
You can force flashing this firmware by using the option '--force'
```
2022-02-27 19:06:14 +08:00
If you know what you are doing and want to proceed despite the mismatch, you need to add the `--force` param in order to continue flashing.
2022-02-27 15:07:10 +08:00
```sh
pm3-flash-all --force
```
2019-07-12 07:48:39 +08:00
## Run the client
2021-12-31 18:42:15 +08:00
^[Top](#top)
2019-09-04 04:54:42 +08:00
In most cases, you can run the script `pm3` which try to auto-detect the port to use, on several OS.
2021-07-10 01:06:45 +08:00
```sh
./pm3
```
2019-07-12 07:48:39 +08:00
For the other cases, specify the port by yourself. For example, for a Proxmark3 connected via USB under Linux:
2019-09-10 01:55:55 +08:00
Here, for example, for a Proxmark3 connected via USB under Linux (adjust the port for your OS):
```sh
2019-09-04 04:54:42 +08:00
proxmark3 /dev/ttyACM0
```
or from the local repo
```sh
client/proxmark3 /dev/ttyACM0
```
2019-05-06 01:53:58 +08:00
## Next steps
2021-12-31 18:42:15 +08:00
^[Top](#top)
2019-05-06 01:53:58 +08:00
For the next steps, please read the following pages:
* [Validating proxmark client functionality](/doc/md/Use_of_Proxmark/1_Validation.md)
* [First Use and Verification](/doc/md/Use_of_Proxmark/2_Configuration-and-Verification.md)
2019-05-06 02:05:02 +08:00
* [Commands & Features](/doc/md/Use_of_Proxmark/3_Commands-and-Features.md)
2019-05-06 01:53:58 +08:00