Prechádzať zdrojové kódy

switched to a Makefile

Andrew Tridgell 3 rokov pred
rodič
commit
0962973688
2 zmenil súbory, kde vykonal 67 pridanie a 1 odobranie
  1. 28 1
      BUILDING.md
  2. 39 0
      RemoteIDModule/Makefile

+ 28 - 1
BUILDING.md

@@ -15,7 +15,32 @@
  - ./scripts/regen_headers.sh
  - ./scripts/add_libraries.sh
 
-### Step3: Open the 'arduino' software in your linux desktop
+Now you have a choice, you can build with the command line and "make"
+or build with the Arduino GUI. I prefer make, but both will work.
+
+## Building with make
+
+### Step1: Use make to install ESP32 support
+
+ - cd RemoteIDModule
+ - make setup
+
+### Step2: Use make to build
+
+ - cd RemoteIDModule
+ - make
+
+### Step3: Use make to upload
+
+ - cd RemoteIDModule
+ - make upload
+
+If board does not flash, hold-down BOOT pushbutton on pcb while pressing RESET pushbutton briefly [to force it into bootloader mode] and retry.
+done, ESP32-S3 is now running and emitting test/demo remote-id bluetooth
+
+## Building with the Arduino GUI
+
+### Step1: Open the 'arduino' software in your linux desktop
 
  - arduino
 
@@ -29,6 +54,8 @@ tip:[if you have url/s already isted, you can add it to the end of them with a c
  - Open 'sketch - ie 'RemoteIDModule.ino 'from this repo
  - Arduino IDE -> File Menu -> Open ...
 
+### Step2: flash
+
 Plugin your ep32-s3 with usb cable using the port labeled "USB" on the pcb - this is for FLASHING it.
 
  - Arduino IDE -> Tools Menu -> Port:... -> /dev/ttyACM0

+ 39 - 0
RemoteIDModule/Makefile

@@ -0,0 +1,39 @@
+# Makefile using arduino-cli
+
+ARDUINO_HOME=$(HOME)/.arduino15
+ESP32_VER=2.0.3-RC1
+ESP32_TOOLS=$(ARDUINO_HOME)/packages/esp32/hardware/esp32/$(ESP32_VER)/tools
+ESPTOOL=$(ESP32_TOOLS)/esptool.py
+CHIP=esp32s3
+ESP32_FQBN=esp32:esp32:$(CHIP)
+SERDEV := $(wildcard /dev/serial/by-id/usb-Espressif_*)
+
+
+all: ArduRemoteID.bin
+
+ArduRemoteID.bin: ..esp32.esp32.esp32s3.bin
+	@echo "Merging $@"
+	@python3 $(ESPTOOL) --chip $(CHIP) merge_bin -o $@ --flash_size 4MB 0xe000 $(ESP32_TOOLS)/partitions/boot_app0.bin 0x0 ..esp32.esp32.$(CHIP).bootloader.bin 0x10000 ..esp32.esp32.$(CHIP).bin 0x8000 ..esp32.esp32.$(CHIP).partitions.bin
+
+setup:
+	@echo "Installing ESP32 support"
+	@arduino-cli core update-index --config-file arduino-cli.yaml
+	@arduino-cli core install esp32:esp32
+
+..esp32.esp32.$(CHIP).bin: *.cpp *.ino *.h
+	@echo "Building main binary"
+	@arduino-cli compile --fqbn $(ESP32_FQBN) .
+
+boards:
+	@echo "Listing boards"
+	@arduino-cli board list
+
+checkdev:
+	@[ "${SERDEV}" ] && echo "Using device $(SERDEV)" || ( echo "Failed to find serial device"; exit 1 )
+
+upload: checkdev ArduRemoteID.bin
+	@echo "Flashing"
+	@arduino-cli upload -p $(SERDEV) --fqbn $(ESP32_FQBN) .
+
+clean:
+	rm -f ..esp32* *.bin