anyone using Ubuntu under Windows 10?

Digital Larry
Posts: 13
Joined: Sat Mar 07, 2020 4:20 am

anyone using Ubuntu under Windows 10?

Postby Digital Larry » Wed Mar 11, 2020 3:23 am

I want to get the ESP-IDF build tools running on my Windows machine as it's the fastest one I have. I did get the hello_world to run under the ESP-IDF Windows native command prompt but this is not Linux. The reason I want to run Linux is to be able to streamline development of audio algorithms using Faust, which doesn't have direct Windows support.

Here's the result of attempting to upload hello_world to the AITinker ESP32-A1S board using Windows 10 Ubuntu.

Code: Select all

gary@Windows10-Pro-STUDIO:~/ESP32-A1S/esp-idf/hello_world$ idf.py -p /dev/ttyS4 flash
Checking Python dependencies...
Python requirements from /home/gary/ESP32-A1S/esp-idf/requirements.txt are satisfied.
Adding flash's dependency "all" to list of actions
Executing action: all (aliases: build)
Running make in directory /home/gary/ESP32-A1S/esp-idf/hello_world/build
Executing "make -j 14 all"...
[  0%] Built target esp32_linker_script
[  1%] Built target _project_elf_src
[  1%] Built target partition_table
[  1%] Built target __idf_app_trace
[  1%] Performing build step for 'bootloader'
[  2%] Built target __idf_cxx
[  1%] Built target _project_elf_src
[  4%] Built target __idf_log
[  4%] Built target __idf_newlib
[ 12%] Built target __idf_xtensa
[  5%] Built target __idf_vfs
[ 50%] Built target __idf_soc
[  7%] Built target __idf_freertos
[ 53%] Built target __idf_micro-ecc
[  8%] Built target __idf_heap
[  9%] Built target __idf_log
[ 79%] Built target __idf_bootloader_support
[ 87%] Built target __idf_efuse
[ 12%] Built target __idf_soc
[ 90%] Built target __idf_spi_flash
[ 13%] Built target __idf_esp_rom
[ 93%] Built target __idf_main
[ 14%] Built target __idf_esp_common
[ 98%] Built target bootloader.elf
[ 15%] Built target __idf_xtensa
[100%] Built target gen_project_binary
[ 18%] Built target __idf_esp32
[100%] Built target app
[ 18%] Built target __idf_espcoredump
[ 18%] No install step for 'bootloader'
[ 19%] Built target __idf_pthread
[ 19%] Completed 'bootloader'
[ 19%] Built target __idf_esp_event
[ 20%] Built target bootloader
[ 21%] Built target __idf_tcpip_adapter
[ 31%] Built target __idf_lwip
[ 33%] Built target __idf_esp_eth
[ 34%] Built target __idf_esp_wifi
[ 35%] Built target __idf_nvs_flash
[ 36%] Built target __idf_spi_flash
[ 36%] Built target __idf_app_update
[ 37%] Built target __idf_bootloader_support
[ 38%] Built target __idf_efuse
[ 48%] Built target __idf_wpa_supplicant
[ 49%] Built target mbedtls
[ 58%] Built target mbedcrypto
[ 59%] Built target mbedx509
[ 61%] Built target __idf_driver
[ 61%] Built target __idf_esp_ringbuf
[ 62%] Built target __idf_json
[ 65%] Built target __idf_esp_adc_cal
[ 65%] Built target __idf_protobuf-c
[ 65%] Built target __idf_console
[ 65%] Built target __idf_nghttp
[ 66%] Built target __idf_esp_gdbstub
[ 67%] Built target __idf_asio
[ 68%] Built target __idf_wear_levelling
[ 69%] Built target __idf_expat
[ 72%] Built target __idf_coap
[ 73%] Built target __idf_sdmmc
[ 77%] Built target __idf_freemodbus
[ 77%] Built target __idf_jsmn
[ 90%] Built target __idf_libsodium
[ 91%] Built target __idf_openssl
[ 91%] Built target __idf_ulp
[ 92%] Built target __idf_spiffs
[ 92%] Built target __idf_unity
[ 92%] Built target __idf_mdns
[ 92%] Built target __idf_esp-tls
[ 92%] Built target __idf_esp_http_server
[ 93%] Built target __idf_fatfs
[ 94%] Built target __idf_tcp_transport
[ 95%] Built target __idf_protocomm
[ 96%] Built target __idf_esp_http_client
[ 96%] Built target __idf_esp_websocket_client
[ 97%] Built target __idf_mqtt
[ 97%] Built target __idf_esp_local_ctrl
[ 98%] Built target __idf_wifi_provisioning
[100%] Built target __idf_esp_https_ota
[100%] Built target __idf_main
[100%] Built target __ldgen_output_esp32.project.ld
[100%] Built target hello-world.elf
[100%] Built target gen_project_binary
[100%] Built target app
Executing action: flash
Running esptool.py in directory /home/gary/ESP32-A1S/esp-idf/hello_world/build
Executing "/usr/bin/python /home/gary/ESP32-A1S/esp-idf/components/esptool_py/esptool/esptool.py -p /dev/ttyS4 -b 460800 --before default_reset --after hard_reset write_flash @flash_project_args"...
esptool.py -p /dev/ttyS4 -b 460800 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 2MB 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x10000 hello-world.bin
esptool.py v2.8
Serial port /dev/ttyS4
Connecting....
Detecting chip type... ESP32
Chip is ESP32D0WDQ5 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 24:0a:c4:2c:a0:98
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Traceback (most recent call last):
  File "/home/gary/ESP32-A1S/esp-idf/components/esptool_py/esptool/esptool.py", line 3201, in <module>
    _main()
  File "/home/gary/ESP32-A1S/esp-idf/components/esptool_py/esptool/esptool.py", line 3194, in _main
    main()
  File "/home/gary/ESP32-A1S/esp-idf/components/esptool_py/esptool/esptool.py", line 2916, in main
    esp.change_baud(args.baud)
  File "/home/gary/ESP32-A1S/esp-idf/components/esptool_py/esptool/esptool.py", line 104, in inner
    return func(*args, **kwargs)
  File "/home/gary/ESP32-A1S/esp-idf/components/esptool_py/esptool/esptool.py", line 707, in change_baud
    self._set_port_baudrate(baud)
  File "/home/gary/ESP32-A1S/esp-idf/components/esptool_py/esptool/esptool.py", line 257, in _set_port_baudrate
    self._port.baudrate = baud
  File "/home/gary/.local/lib/python2.7/site-packages/serial/serialutil.py", line 295, in baudrate
    self._reconfigure_port()
  File "/home/gary/.local/lib/python2.7/site-packages/serial/serialposix.py", line 438, in _reconfigure_port
    [iflag, oflag, cflag, lflag, ispeed, ospeed, cc])
termios.error: (5, 'Input/output error')
esptool.py failed with exit code 1
gary@Windows10-Pro-STUDIO:~/ESP32-A1S/esp-idf/hello_world$
Windows detects the board on COM4, which translated to Ubuntu talk, is ttyS4. You can see that there is some communication with the board, but it ultimately fails.

doglike
Posts: 63
Joined: Fri Aug 18, 2017 4:21 pm

Re: anyone using Ubuntu under Windows 10?

Postby doglike » Wed Mar 11, 2020 1:27 pm

I am using Ubuntu with Virtualbox on a Win10 machine. Without any issues.
Dont forget to configure the number of CPU cores in Virtualbox to use full CPU power during build

Digital Larry
Posts: 13
Joined: Sat Mar 07, 2020 4:20 am

Re: anyone using Ubuntu under Windows 10?

Postby Digital Larry » Wed Mar 11, 2020 4:01 pm

OK, that's another approach I might try. So, you don't have any problems flashing the board over USB using Ubuntu in Virtualbox? Looks like from the error I got it had some problem adjusting the baud rate. And to be clear, this error does not happen when doing the same thing in the Windows native ESP-IDF command prompt on the same machine.

Thanks,

DL

doglike
Posts: 63
Joined: Fri Aug 18, 2017 4:21 pm

Re: anyone using Ubuntu under Windows 10?

Postby doglike » Thu Mar 12, 2020 8:01 am

No issues at all. Just passthrough the connected USB port to Virtualbox, that's it.

devanl
Posts: 14
Joined: Sat Jan 04, 2020 5:26 pm

Re: anyone using Ubuntu under Windows 10?

Postby devanl » Thu Mar 12, 2020 3:57 pm

I do a lot of development with Ubuntu under WSL on Windows 10. I've since switched to using openocd (running under Windows) to flash my boards, but when I was still using the bootloader, I ran into a similar issue.

I found the discussion on a GitHub issue helpful - oddly enough, certain baudrates work with the WSL serial port passthrough and others don't.

Besides running slower at 115200, bumping it up to 921600 works for me, as does 1500000.

Digital Larry
Posts: 13
Joined: Sat Mar 07, 2020 4:20 am

Re: anyone using Ubuntu under Windows 10?

Postby Digital Larry » Thu Mar 12, 2020 7:56 pm

I've tried setting different speeds in the menuconfig

Serial Flasher Config-> 'idf.py monitor' baud rate (921600 bps) --->

No matter what I set it to, when the program goes to flash the board, it still reports as 460800.

??

:?:

devanl
Posts: 14
Joined: Sat Jan 04, 2020 5:26 pm

Re: anyone using Ubuntu under Windows 10?

Postby devanl » Thu Mar 12, 2020 9:39 pm

Digital Larry wrote:
Thu Mar 12, 2020 7:56 pm
I've tried setting different speeds in the menuconfig

Serial Flasher Config-> 'idf.py monitor' baud rate (921600 bps) --->

No matter what I set it to, when the program goes to flash the board, it still reports as 460800.
Hmm, I'm not sure what would cause that issue. Fow now, maybe just manually pass in the baudrate with -p, i.e:

Code: Select all

idf.py -p /dev/ttyS4 -b 921600 flash

Digital Larry
Posts: 13
Joined: Sat Mar 07, 2020 4:20 am

Re: anyone using Ubuntu under Windows 10?

Postby Digital Larry » Fri Mar 13, 2020 4:09 am

Putting the baud rate on the cmd line works, thanks!

Who is online

Users browsing this forum: Google [Bot] and 327 guests