|
2 | 2 |
|
3 | 3 | First, you need an esp32 micro controller. If you do not yet have one, I typically buy [these ones](https://www.amazon.com/HiLetgo%C2%AE-ESP-WROOM-32-Development-Microcontroller-Integrated/dp/B0718T232Z/ref=sr_1_4?ie=UTF8&qid=1525458705&sr=8-4&keywords=esp32) from Amazon. If you are reading this because you know I will be at BSidesLV, BlackHat USA and DEFCON, you can ping me on Twitter and Ill hook you up with a pre-flashed on at co$t in Vegas. |
4 | 4 |
|
5 | | -Now, to get started, setup your esp32 build environment by following [this documentation](http://esp-idf.readthedocs.io/en/latest/get-started/#setup-toolchain). Once complete, you can build and flash the code from this repository just the same as you would from the example bluetooth programs in that project which are located in ```/esp-idf/examples/bluetooth/``` |
| 5 | +## Precompiled Binaries |
| 6 | + |
| 7 | +The easiest way to get this projects firmware flashed to an ESP32 is to flash the provided pre-compiled binaries. You will need to install [esptool](https://github.com/espressif/esptool) Then do the following: |
| 8 | +Clone the repository |
| 9 | +``` |
| 10 | +git clone https://github.com/hackgnar/ble_ctf_infinity |
| 11 | +``` |
| 12 | + |
| 13 | +Chage directory into the repository |
| 14 | +``` |
| 15 | +cd ble_ctf_infinity |
| 16 | +``` |
| 17 | + |
| 18 | +Flash the pre-compiled binaries |
| 19 | +``` |
| 20 | +esptool.py --chip esp32 --port /dev/ttyUSB0 \ |
| 21 | +--baud 115200 --before default_reset --after hard_reset write_flash \ |
| 22 | +-z --flash_mode dio --flash_freq 40m --flash_size detect \ |
| 23 | +0x1000 build/bootloader/bootloader.bin \ |
| 24 | +0x10000 build/gatt_server_service_table_demo.bin \ |
| 25 | +0x8000 build/partitions_singleapp.bin |
| 26 | +``` |
| 27 | + |
| 28 | +## Build From Docker |
| 29 | + |
| 30 | +If you want to compile the code yourself, but are having issues setting up an environment, you can use the docker build method. This will provide you with a clean uniform build environment each time. To build from docker do the following: |
| 31 | + |
| 32 | +Build your base docker image and compile the code |
| 33 | +``` |
| 34 | +docker build -t blectf_infinity:v1 . |
| 35 | +``` |
| 36 | + |
| 37 | +Start up a docker instance to pull out the binaries you compiled |
| 38 | +``` |
| 39 | +docker run blectf_infinity:v1 |
| 40 | +``` |
| 41 | + |
| 42 | +Copy the build from your docker instance |
| 43 | +``` |
| 44 | +docker cp <instance_name>:/ble_ctf_infinity/build . |
| 45 | +``` |
| 46 | + |
| 47 | +Shutdown and kill your docker |
| 48 | +``` |
| 49 | +docker stop <instance_name> |
| 50 | +docker rm <instance_name> |
| 51 | +``` |
| 52 | + |
| 53 | +Flash the firmware you built (you will need [esptool](https://github.com/espressif/esptool) installed) |
| 54 | +``` |
| 55 | +esptool.py --chip esp32 --port /dev/ttyUSB0 \ |
| 56 | +--baud 115200 --before default_reset --after hard_reset write_flash \ |
| 57 | +-z --flash_mode dio --flash_freq 40m --flash_size detect \ |
| 58 | +0x1000 build/bootloader/bootloader.bin \ |
| 59 | +0x10000 build/gatt_server_service_table_demo.bin \ |
| 60 | +0x8000 build/partitions_singleapp.bin |
| 61 | +``` |
| 62 | + |
| 63 | +## Build From Source |
| 64 | + |
| 65 | +Setup your esp32 build environment by following [this documentation](http://esp-idf.readthedocs.io/en/latest/get-started/#setup-toolchain). Once complete, you can build and flash the code from this repository just the same as you would from the example bluetooth programs in that project which are located in ```/esp-idf/examples/bluetooth/``` |
6 | 66 |
|
7 | 67 | If you need a reminder, do the following once you set up your whole esp build environment from the link above. |
8 | 68 | ```` |
9 | | -cd ble_ctf_infinity |
10 | | -make menuconfig # set your serial device in bla -> bla -> bla |
| 69 | +cd ble_ctf |
| 70 | +make menuconfig |
| 71 | +# check Component Config > Bluetooth > Bluetooth |
| 72 | +# set Compiler options > Disable new warnings introduced in GCC 6-8 |
| 73 | +# set Serial Flasher Config > Default serial device |
11 | 74 | make codegen |
12 | 75 | make |
13 | 76 | # plug in your esp32 to usb |
|
0 commit comments