diff --git a/Makefile b/Makefile index cf17d8a..80e4d2d 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,7 @@ PROJECT_NAME := nina-fw +M4_PORT := /dev/cu.usbmodem1431201 +M4_BOOTLOADER := /Volumes/FEATHERBOOT/. +ESP_PORT := /dev/cu.usbserial-AH03B302 EXTRA_COMPONENT_DIRS := $(PWD)/arduino @@ -14,7 +17,26 @@ endif include $(IDF_PATH)/make/project.mk +# M4 to USB-Serial Passthrough +passthrough: + cp passthrough.UF2 $(M4_BOOTLOADER) + echo "Copied to BOOT!" + +# Upload to ESP32 after entering passthrough +upload: + echo "Uploading nina-fw to ESP32" + esptool.py --port $(M4_PORT) --before no_reset --baud 115200 write_flash 0 NINA_W102-1.3.1.bin + +serial: + miniterm.py -p + firmware: all python combine.py .PHONY: firmware + +.PHONY: passthrough + +.PHONY: upload + +.PHONY: serial \ No newline at end of file diff --git a/esp_helper.py b/esp_helper.py deleted file mode 100644 index b7c6066..0000000 --- a/esp_helper.py +++ /dev/null @@ -1,35 +0,0 @@ -import time -import os -import subprocess -import argparse - -parser = argparse.ArgumentParser() - -parser.add_argument('-p', action='store', dest='port_num', - help='Board port name') -parser.add_argument('-uf2', action='store', dest='uf2', - help='.UF2 file') - -results = parser.parse_args() -dest_port = results.port_num -uf2_file = results.uf2 - -def search_ports(): - proc = subprocess.Popen(["ls /dev/cu.* | grep cu.usbmodem"], stdout=subprocess.PIPE, shell=True) - (out, err) = proc.communicate() - avail_ports = out.decode('utf-8') - return avail_ports - -# Scan all ports for FEATHERBOOT -avail_ports = search_ports() -while not avail_ports: - search_ports() - print("Board not found, double-tap RESET to enter the bootloader...") - time.sleep(1) - -# cp provided uf2 to featherboot - -# wait for featherboot to pop back up as a usbmodem - -# execute esptool on port with compiled fw, the start up miniterm.py - diff --git a/ESP32PASSTHRU_WING.UF2 b/passthrough.UF2 similarity index 100% rename from ESP32PASSTHRU_WING.UF2 rename to passthrough.UF2 diff --git a/sdkconfig b/sdkconfig index 1d092a0..80d13e3 100644 --- a/sdkconfig +++ b/sdkconfig @@ -434,7 +434,7 @@ CONFIG_LOG_DEFAULT_LEVEL_WARN= CONFIG_LOG_DEFAULT_LEVEL_INFO= CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y CONFIG_LOG_DEFAULT_LEVEL_VERBOSE= -CONFIG_LOG_DEFAULT_LEVEL=3 +CONFIG_LOG_DEFAULT_LEVEL=4 CONFIG_LOG_COLORS=y # @@ -490,7 +490,7 @@ CONFIG_TCP_OVERSIZE_DISABLE= # CONFIG_LWIP_MAX_UDP_PCBS=16 CONFIG_UDP_RECVMBOX_SIZE=6 -CONFIG_TCPIP_TASK_STACK_SIZE=2048 +CONFIG_TCPIP_TASK_STACK_SIZE=3072 CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y CONFIG_TCPIP_TASK_AFFINITY_CPU0= CONFIG_TCPIP_TASK_AFFINITY_CPU1=