Skip to content

Commit

Permalink
Attempt to build C3 binary with GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
gfwilliams committed Jul 8, 2024
1 parent 785b594 commit 5f8c058
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
strategy:
# devices to build for
matrix:
board: [LINUX, ESP32, ESP8266_BOARD, ESP8266_4MB, MICROBIT1, MICROBIT2]
board: [LINUX, ESP32, ESP8266_BOARD, ESP8266_4MB, MICROBIT1, MICROBIT2, ESP32C3_IDF4]
# try and build for all devices even if one fails
fail-fast: false
steps:
Expand Down
21 changes: 15 additions & 6 deletions make/targets/ESP32_IDF4.make
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,24 @@ $(CMAKEFILE):


$(PROJ_NAME).bin: $(CMAKEFILE) $(PLATFORM_CONFIG_FILE) $(PININFOFILE).h $(PININFOFILE).c $(WRAPPERFILE)
cp ${ROOT}/targets/esp32/IDF4/${SDKCONFIG} $(BINDIR)/sdkconfig
cp ${ROOT}/targets/esp32/IDF4/CMakeLists.txt $(BINDIR)
cp ${ROOT}/targets/esp32/IDF4/partitions.csv $(BINDIR)
$(Q)cp ${ROOT}/targets/esp32/IDF4/${SDKCONFIG} $(BINDIR)/sdkconfig
$(Q)cp ${ROOT}/targets/esp32/IDF4/CMakeLists.txt $(BINDIR)
$(Q)cp ${ROOT}/targets/esp32/IDF4/partitions.csv $(BINDIR)
cd $(BINDIR) && idf.py build
$(Q)cp $(BINDIR)/build/espruino.bin $(PROJ_NAME).bin

#$(ESP_ZIP): $(PROJ_NAME).bin
$(ESP_ZIP): $(PROJ_NAME).bin
$(Q)rm -rf $(PROJ_NAME)
$(Q)mkdir -p $(PROJ_NAME)
$(Q)cp $(PROJ_NAME).bin $(PROJ_NAME)/espruino-esp32c3.bin
$(Q)cp $(BINDIR)/build/partition_table/partition-table.bin $(PROJ_NAME)/partition-table.bin
$(Q)cp $(BINDIR)/build/bootloader/bootloader.bin $(PROJ_NAME)/bootloader.bin
$(Q)cp targets/esp32/README_flash_C3.txt $(PROJ_NAME)
$(Q)$(TAR) -zcf $(ESP_ZIP) $(PROJ_NAME) --transform='s/$(PROJ_NAME)\///g'
@echo "Created $(ESP_ZIP)"

proj: $(PROJ_NAME).bin
#depend on $(ESP_ZIP)
proj: $(ESP_ZIP)
#depend on $(PROJ_NAME).bin

flash: $(PROJ_NAME).bin
cd $(BINDIR) && idf.py flash -p $(PORT)
Expand Down
16 changes: 16 additions & 0 deletions targets/esp32/README_flash_C3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
How to flash Espruino ESP32C3
===========================

To flash an ESP32 using the serial port use:

```
esptool.py -p (PORT) -b 460800 --before default_reset --after hard_reset \
--chip esp32c3 write_flash \
--flash_mode dio --flash_size detect --flash_freq 80m \
0x0 bootloader.bin \
0x8000 partition-table.bin \
0x10000 espruino-esp32c3.bin
```

On Windows, you can use the flash tools from espressif found here:
http://espressif.com/sites/default/files/tools/flash_download_tools_v3.4.4.zip

0 comments on commit 5f8c058

Please sign in to comment.