|
| 1 | +###################################### |
| 2 | +# |
| 3 | +# Hello world for ESP32/Cmake |
| 4 | +# |
| 5 | +###################################### |
| 6 | +cmake_minimum_required(VERSION 3.0) |
| 7 | +#-------------------------------------------------------------------------------------- |
| 8 | +# Select platform |
| 9 | +SET(PLATFORM_ARCHITECTURE "ESP32") |
| 10 | +# and installation for extra arduino files AND toolchain (compiler...) |
| 11 | +# Path to the toolchain, must contain arm-none-eabi-gcc,-g++ and friends |
| 12 | +SET(PLATFORM_TOOLCHAIN_PATH "/home/fx/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/") |
| 13 | +# Path to the platform folder |
| 14 | +# You can download it from https://github.com/rogerclarkmelbourne/Arduino_STM32.git |
| 15 | +# ***** The last folder ** MUST BE *** arduino ***** |
| 16 | +SET(PLATFORM_PATH "/home/fx/Arduino/hardware/espressif/esp32") |
| 17 | +# and here we go |
| 18 | +SET(CMAKE_TOOLCHAIN_FILE cmake/ArduinoToolchain.cmake) |
| 19 | +MESSAGE(STATUS "Starting hello-esp32") |
| 20 | +# |
| 21 | +# |
| 22 | +# |
| 23 | +Project("Hello_esp32" C CXX ASM) # ASM must be present ! |
| 24 | +MESSAGE(STATUS "Dumping board") |
| 25 | +print_board_list() |
| 26 | +# |
| 27 | +# that changes the way the binary is linked, better to use DFU in all cases ! |
| 28 | +SET(ARDUINO_UPLOAD_METHOD DFUUpload) |
| 29 | + |
| 30 | +# |
| 31 | +set(ARDUINO_DEFAULT_BOARD esp32) # Default Board ID, when not specified |
| 32 | +#set(ARDUINO_DEFAULT_PORT ttyACM0) # Default Port, when not specified |
| 33 | +#set(ARDUINO_CPU STM32F103C8) |
| 34 | +# |
| 35 | +generate_arduino_firmware(GetChipID |
| 36 | + SKETCH GetChipID.ino # Folder to get the .ino from, must follow DIR_NAME/DIR_NAME.ino patten ! |
| 37 | + PORT ${ARDUINO_DEFAULT_PORT} |
| 38 | + ) |
| 39 | +#-------------------------------------------------------------------------------------- |
0 commit comments