Skip to content

Instantly share code, notes, and snippets.

@ddewaele
Last active September 2, 2017 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ddewaele/8fa91063a5494695029b3576127766ac to your computer and use it in GitHub Desktop.
Save ddewaele/8fa91063a5494695029b3576127766ac to your computer and use it in GitHub Desktop.
ESP32 make monitor / pyserial issue
rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
Falling back to built-in command interpreter.
OK
>ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
Falling back to built-in command interpreter.
OK
>ets Jun  8 2016 00:22:57

What worked for me with this code

#include "btstack.h"
 
int btstack_main(int argc, const char * argv[]){
 
    l2cap_init();
    sdp_init();
 
    gap_discoverable_control(1);
    gap_set_local_name("HelloSpark2");
 
    hci_power_control(HCI_POWER_ON);
 
    return 0;
}
  1. changing the code
  2. turning bluetooth off on PC
  3. make ; make flash
  4. connect arduino IDE serial console
  5. Press reset on the board
  6. turn bluetooth on on PC

Be sure to use a stable module

git clone --recursive https://github.com/espressif/esp-idf.git
git checkout release/v2.1
git submodule update --init --recursive

When getting this :

make[2]: *** No rule to make target `/Users/ddewaele/Projects/ESP32/esp-idf/components/bootloader/src/main/./bootloader_start.c', needed by `bootloader_start.o'.  Stop.
make[1]: *** [component-main-build] Error 2
make: *** [/Users/ddewaele/Projects/ESP32/esp-idf/examples/bluetooth/gatt_server/build/bootloader/bootloader.bin] Error 2

just do a clean and rebuild

make monitor

MONITOR
--- idf_monitor on /dev/cu.usbserial-DN035QK8 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---

Exception in thread Thread-2:
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/Users/ddewaele/Projects/ESP32/esp-idf/tools/idf_monitor.py", line 118, in _run_outer
    self.run()
  File "/Users/ddewaele/Projects/ESP32/esp-idf/tools/idf_monitor.py", line 191, in run
    if not self.serial.is_open:
AttributeError: 'Serial' object has no attribute 'is_open'

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/Users/ddewaele/Projects/ESP32/esp-idf/tools/idf_monitor.py", line 118, in _run_outer
    self.run()
  File "/Users/ddewaele/Projects/ESP32/esp-idf/tools/idf_monitor.py", line 153, in run
    c = self.console.getkey()
  File "/Users/ddewaele/Projects/ESP32/esp-idf/tools/idf_monitor.py", line 233, in getkey_patched
    c = self.enc_stdin.read(1)
AttributeError: 'Console' object has no attribute 'enc_stdin'
sudo pip install --upgrade pyserial

Password:
The directory '/Users/ddewaele/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/ddewaele/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pyserial
  Downloading pyserial-3.4-py2.py3-none-any.whl (193kB)
    100% |████████████████████████████████| 194kB 1.5MB/s 
Installing collected packages: pyserial
  Found existing installation: pyserial 2.7
    Uninstalling pyserial-2.7:
      Successfully uninstalled pyserial-2.7
Successfully installed pyserial-3.4
make monitor
MONITOR
--- idf_monitor on /dev/cu.usbserial-DN035QK8 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0010,len:4
load:0x3fff0014,len:588
load:0x40078000,len:0
load:0x40078000,len:9768
entry 0x400789b8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment