summaryrefslogtreecommitdiff
path: root/Makefile
blob: 8dfd366c062f92253a6f4490465e7f32592b9632 (plain)
  1. PROJECT = main.ino
  2. BUILD_DIR = $(CURDIR)/.build
  3. OPTS_HARDWARE = -hardware /usr/share/arduino/hardware -hardware ~/.arduino15/packages
  4. OPTS_TOOLS = -tools /usr/share/arduino/hardware/tools/avr -tools ~/.arduino15/packages
  5. OPTS_LIBS = -libraries ~/Arduino/libraries
  6. #FQBN = -fqbn=esp32:esp32:esp32:JTAGAdapter=default,PSRAM=disabled,PartitionScheme=default,CPUFreq=240,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,LoopCore=1,EventsCore=1,DebugLevel=none,EraseFlash=none
  7. FQBN = -fqbn=esp32:esp32:esp32
  8. all: build upload
  9. build:
  10. mkdir --parents .build .cache
  11. arduino-builder -compile -logger=machine \
  12. $(OPTS_HARDWARE) $(OPTS_TOOLS) $(OPTS_LIBS) $(FQBN) \
  13. -ide-version=10819 -build-path $(BUILD_DIR) -warnings=none -build-cache ~/.cache \
  14. -verbose \
  15. $(PROJECT)
  16. clean:
  17. rm -rf .build
  18. distclean: clean
  19. rm -rf .cache
  20. .NOTPARALLEL:
  21. upload:
  22. python3 ~/.arduino15/packages/esp32/tools/esptool_py/4.5.1/esptool.py \
  23. --chip esp32 --port /dev/ttyUSB0 --baud 921600 \
  24. --before default_reset --after hard_reset write_flash \
  25. -z --flash_mode dio --flash_freq 80m --flash_size 4MB \
  26. 0x1000 .build/$(PROJECT).bootloader.bin \
  27. 0x8000 .build/$(PROJECT).partitions.bin \
  28. 0xe000 ~/.arduino15/packages/esp32/hardware/esp32/2.0.14/tools/partitions/boot_app0.bin \
  29. 0x10000 .build/$(PROJECT).bin