diff --git a/port/esp32/README.md b/port/esp32/README.md index e4d413cc0..612146db3 100644 --- a/port/esp32/README.md +++ b/port/esp32/README.md @@ -1,11 +1,11 @@ # BTstack Port for the Espressif ESP32 Platform -Status: Basic port incl. all examples. BTstack runs on dedicated FreeRTOS thread. Multi threading not supported. +Status: Basic port incl. all examples. BTstack runs on dedicated FreeRTOS thread. Multi threading (calling BTstack functions from a different thread) is not supported. ## Setup - Follow [Espressif IoT Development Framework (ESP-IDF) setup](https://github.com/espressif/esp-idf) to install XTensa toolchain and the ESP-IDF. -- In port/esp32, configure the serial port for firmware upload as described in the ESP-IDF setup guides. +- In port/esp32/template, configure the serial port for firmware upload as described in the ESP-IDF setup guides. ## Usage diff --git a/port/esp32/create_examples.py b/port/esp32/create_examples.py index 6c258b8f7..b24dae022 100755 --- a/port/esp32/create_examples.py +++ b/port/esp32/create_examples.py @@ -55,9 +55,13 @@ for file in os.listdir(examples_embedded): os.makedirs(apps_folder) # copy files - for item in ['sdkconfig']: + for item in ['sdkconfig', 'set_port.sh']: shutil.copyfile(script_path + '/template/' + item, apps_folder + '/' + item) + # mark set_port.sh as executable + os.chmod(apps_folder + '/set_port.sh', 0o755) + + # create Makefile file with open(apps_folder + "Makefile", "wt") as fout: fout.write(mk_template.replace("EXAMPLE", example).replace("TOOL", script_path).replace("DATE",time.strftime("%c"))) diff --git a/port/esp32/template/set_port.sh b/port/esp32/template/set_port.sh new file mode 100755 index 000000000..e20b5a870 --- /dev/null +++ b/port/esp32/template/set_port.sh @@ -0,0 +1,3 @@ +#!/bin/sh +PORT=$1 +sed -i "/CONFIG_ESPTOOLPY_PORT/c\CONFIG_ESPTOOLPY_PORT=\"$PORT\"" sdkconfig \ No newline at end of file