Make flash error "Inappropriate ioctl for device"

mbreyt
Posts: 1
Joined: Sat Apr 07, 2018 10:13 pm

Make flash error "Inappropriate ioctl for device"

Postby mbreyt » Sat Apr 07, 2018 10:19 pm

Hello,

I'm having some trouble setting up my new ESP32-WROOM32 and building the basic hello_world example !
When I run make flash I get this error :

Code: Select all

LD build/hello-world.elf
esptool.py v2.3.1
Flashing binaries to serial port /dev/ttys002 (app at offset 0x10000)...
esptool.py v2.3.1
Connecting...
Traceback (most recent call last):
  File "/Users/mb/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 2637, in <module>
    _main()
  File "/Users/mb/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 2630, in _main
    main()
  File "/Users/mb/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 2356, in main
    esp.connect(args.before)
  File "/Users/mb/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 407, in connect
    last_error = self._connect_attempt(mode=mode, esp32r0_delay=False)
  File "/Users/mb/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 365, in _connect_attempt
    self._port.setDTR(False)  # IO0=HIGH
  File "/Users/mb/.virtualenvs/arduino/lib/python3.6/site-packages/serial/serialutil.py", line 599, in setDTR
    self.dtr = value
  File "/Users/mb/.virtualenvs/arduino/lib/python3.6/site-packages/serial/serialutil.py", line 469, in dtr
    self._update_dtr_state()
  File "/Users/mb/.virtualenvs/arduino/lib/python3.6/site-packages/serial/serialposix.py", line 636, in _update_dtr_state
    fcntl.ioctl(self.fd, TIOCMBIC, TIOCM_DTR_str)
OSError: [Errno 25] Inappropriate ioctl for device
make: *** [flash] Error 1
Here's the command being run :

Code: Select all

python /Users/mb/esp/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/ttys002 --baud 115200 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 /Users/mb/esp/hello_world/build/bootloader/bootloader.bin 0x10000 /Users/mb/esp/hello_world/build/hello-world.bin 0x8000 /Users/mb/esp/hello_world/build/partitions_singleapp.bin
I'm on mac, using python3.6
Hope somebody can help,
cheers

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Make flash error "Inappropriate ioctl for device"

Postby WiFive » Sun Apr 08, 2018 2:58 am


jlrtrevenga
Posts: 4
Joined: Sun May 20, 2018 11:20 am

Re: Make flash error "Inappropriate ioctl for device"

Postby jlrtrevenga » Sun May 20, 2018 2:32 pm

Hello WiFive,

I have just started to play with this card and ubuntu, so my knowledge is very limited. But I believe everything is correct in my dev environment.

I have the same issue as mbreyt, although my configuration is different:
- Ubuntu 18.04 running on Oracle Virtual Box 5.2.8
- ESP32-IDF V3.0 just installed
- ESP-WROOM-32 in an AZ-Delivery ESP32 Dev. Board (http://flyt.it/ESP32-Devboard)

Already compiled Hello_World example, and when trying to flash it, I get the same issue.

I have already read the document you attach "Establish Serial Connection with ESP32". After checking all steps, I connect from a PuTTY session though /dev/ttyUSB0 (virtual port connected to the virtual machine), and get boot information from the ESP32 dev board when I reboot it. So the PuTTY terminal reads correctly info from the ESP board.

Error is this (some previous error related to /home/ivan/... libraries incorectly included in ESP3-IDF V3.0 also):
jlrt@JLR-IoT:~/esp32_apps_jlr/hello_world$ make flash
fatal: not a git repository: /home/ivan/esp-idf/.git/modules/components/aws_iot/aws-iot-device-sdk-embedded-C
fatal: not a git repository: /home/ivan/esp-idf/.git/modules/components/aws_iot/aws-iot-device-sdk-embedded-C
Flashing binaries to serial port /dev/ttyUSB0 (app at offset 0x10000)...
esptool.py v2.1
Traceback (most recent call last):
File "/home/jlrt/esp/esp-idf-v3.0/components/esptool_py/esptool/esptool.py", line 2525, in <module>_main()
File "/home/jlrt/esp/esp-idf-v3.0/components/esptool_py/esptool/esptool.py", line 2518, in _main main()
File "/home/jlrt/esp/esp-idf-v3.0/components/esptool_py/esptool/esptool.py", line 2247, in main esp = chip_class(args.port, initial_baud)
File "/home/jlrt/esp/esp-idf-v3.0/components/esptool_py/esptool/esptool.py", line 175, in __init__
if isinstance(port, serial.Serial):
AttributeError: 'module' object has no attribute 'Serial'
/home/jlrt/esp/esp-idf-v3.0/components/esptool_py/Makefile.projbuild:54: recipe for target 'flash' failed
make: *** [flash] Error 1

The serial port is mapped to the Virtual Machine via a "Silicon Labs CP2102 USB to UART Bridge Controller".

I can get this info from the console:
jlrt@JLR-IoT:~/esp32_apps_jlr/hello_world$ dmesg |grep tyUSB0
[20072.805458] usb 2-2: cp210x converter now attached to ttyUSB0
jlrt@JLR-IoT:~/esp32_apps_jlr/hello_world$ setserial -g /dev/ttyUSB0
Cannot get serial info: Inappropriate ioctl for device

Any idea how to solve it?

Thanks,

jlrtrevenga
Posts: 4
Joined: Sun May 20, 2018 11:20 am

Re: Make flash error "Inappropriate ioctl for device"

Postby jlrtrevenga » Fri May 25, 2018 7:24 pm

I attach the answer provided by ESP_Angus in another thread, in case somebody has the same problem (I have done it and it solves the problem):

__________________________________
I this is caused by having run "pip install serial" rather than "pip install pyserial". This is a known issue.

You can probably work around by running:

Code: Select all
sudo pip uninstall serial
sudo apt-get install python-serial
___________________________________

Who is online

Users browsing this forum: No registered users and 31 guests