ESP-IDF semihost example doesn't work under Windows.

rokko1337
Posts: 3
Joined: Fri Jan 22, 2021 8:53 pm

ESP-IDF semihost example doesn't work under Windows.

Postby rokko1337 » Fri Jan 22, 2021 9:01 pm

Please help, I'm tying to run ESP-IDF example of REST server with semihost file upload through JTAG, but can't make it work.

https://github.com/espressif/esp-idf/tr ... ful_server

In my project I'm using ESP32-WROOM-32, FT2232HL JTAG, Eclipse IDE running under Windows 10. SD variant of that example works fine, but when I set semihost through menuconfig "C:\esp32_semihost" and run OpenOCD like this:

Code: Select all

openocd -c "set ESP_SEMIHOST_BASEDIR C:\\esp32_semihost" -f board/esp32-wrover-kit-3.3v.cfg
It goes through all initialization without errors, but file upload from PC to ESP32 web server just doesn't work...

Eclipse output during file request:

Code: Select all

E (138679) esp-rest: Failed to open file : /www/index.html
W (138679) httpd_txrx: httpd_resp_send_err: 500 Internal Server Error - Failed to read existing file
W (138689) httpd_uri: httpd_uri: uri handler execution failed
OpenOCD output (if I run OCD before resetting/flashing ESP32):

Code: Select all

Info : Target halted. CPU0: PC=0x400DEF54 (active)
Info : Target halted. CPU1: PC=0x401557EE
OpenOCD output (if I run OCD after resetting/flashing ESP32):

Code: Select all

Info : Target halted. CPU0: PC=0x400DEF54 (active)
Info : Target halted. CPU1: PC=0x401557EE
Error: File name length if greater then the maximum possible value!
UPD1:
Also tried running openocd inside eclipse using this guide: https://medium.com/@kondal.kolipaka/gdb ... 7a6661f32f but with only these config options in Debugger tab, output still same:

Code: Select all

-c "set ESP_SEMIHOST_BASEDIR C:\\semihost"
-f board/esp32-wrover-kit-3.3v.cfg
Couldn't find any useful information about semihosting except one paragraph in espressif docs about how to run it and few mentions here and there that it's a thing and you can use it with JTAG, any example from scratch how to configure and use it for retrieving files from PC...

UPD2:
Looks like this guy had same issue: viewtopic.php?p=61230#p61230 still no solution to make it work...
Last edited by rokko1337 on Sat Jan 23, 2021 2:24 pm, edited 1 time in total.

rokko1337
Posts: 3
Joined: Fri Jan 22, 2021 8:53 pm

Re: ESP-IDF semihost example doesn't work under Windows.

Postby rokko1337 » Sat Jan 23, 2021 2:00 pm

Looks like I found the solution of my problem. I was confused by "Host path to mount (e.g. absolute path to web dist directory) " option in project menuconfig, specifically "absolute path to web dist directory". If you run openocd with absolute path in ESP_SEMIHOST_BASEDIR argument, you need to leave "Host path to mount" value empty or just set second argument in esp_vfs_semihost_register function NULL.

sup999
Posts: 1
Joined: Tue Jul 26, 2022 7:13 am

Re: ESP-IDF semihost example doesn't work under Windows.

Postby sup999 » Thu Jul 28, 2022 7:45 am

I have the same problem,Can you tell me how to set the host path?

FloridaMan
Posts: 4
Joined: Tue Sep 29, 2020 3:45 pm

Re: ESP-IDF semihost example doesn't work under Windows.

Postby FloridaMan » Thu Aug 25, 2022 4:34 pm

I don't have time to test this today, but here are some things to verify.

1) Build your web application. IIRC it is in ./front/web-demo. You'll need nodejs installed and run "npm install" and then "npm build run" from the directory. VSCode is good for this.
2) In your config file, set your directory to /front/web-demo/dist

I use VisualGDB for ESP32 development. It's worth the $100 or whatever it costs. The custom edition allows for side-by-side framework installs for other hardware as well.

Who is online

Users browsing this forum: Bing [Bot] and 94 guests