Closed Navis-Raven closed 6 years ago
This is platform.ini content
[env:esp wrover kit]
platform = espressif32
framework = espidf
board = esp-wrover-kit
monitor_speed = 115200
For the first one the defined LED_BUILTIN number is not correct, I it should be 0 (red led of the RGB in the Wrover Kit v4 and v3) instead of the default 13
See here the documentation for the Wrover Kit v3 : https://docs.espressif.com/projects/esp-idf/en/latest/get-started/get-started-wrover-kit.html#related-documents
/*
* Blink
* Turns on an LED on for one second,
* then off for one second, repeatedly.
*/
#include <Arduino.h>
#ifndef LED_BUILTIN
// Set LED_BUILTIN if it is not defined by Arduino framework
#define LED_BUILTIN 13 //HERE it should be 0
#endif
void setup()
{
// initialize LED digital pin as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
void loop()
{
// turn the LED on (HIGH is the voltage level)
digitalWrite(LED_BUILTIN, HIGH);
// wait for a second
delay(1000);
// turn the LED off by making the voltage LOW
digitalWrite(LED_BUILTIN, LOW);
// wait for a second
delay(1000);
}
To solve the first bug a config file can be added with all espressif 32 boards and their led builtin pin out.
main.c
#include"arduino.h"
#include"ESP_Config.h"
...
ESP_Config
//Choose your board
#define LED_BUILTIN ESP_WROVER_KIT_LED
#define ESP_WROVER_KIT_LED 0
#define ESP32_FEATHER_LED 13
etc...
The second and third bird has been referenced here and the solution is to remove the spaces.
https://community.platformio.org/t/esp32-esp-idf-examples-does-not-upload/4985/4
Please run "Verbose Upload" form PlatformIO IDE for VSCode. You will see detailed upload command and arguments. Maybe, the issue with spaces in environment name.
@ivankravets no need we've already found the bug. Yes the second and third issue come from the spaces in environnement names. This is because the platform.ini is configurated like that in the default example codes for ESP-IDF
Look at here: https://github.com/platformio/platform-espressif32/blob/master/examples/espidf-hello-world/platformio.ini#L16
Hm... All tests are passed. Could you provide an output from pio run -t upload -v
command?
Please look at here: https://github.com/platformio/platform-espressif32/blob/master/examples/espidf-hello-world/platformio.ini#L16
I don't have my board with me at the moment, but no need, because we already now (and I've tested it behind you in the issue #1883 today), that the bug come from the spaces in environement name
Could you provide an output from pio run -t upload -v command?
I can do this only tomorrow if you need
For the build it is normal that it is passing, it is the upload which causes trouble, when esptool is called !
usage: esptool write_flash [-h] [--flash_freq {keep,40m,26m,20m,80m}]
[--flash_mode {keep,qio,qout,dio,dout}]
[--flash_size FLASH_SIZE]
[--spi-connection SPI_CONNECTION] [--no-progress]
[--verify] [--compress | --no-compress]
<address> <filename> [<address> <filename> ...]
esptool write_flash: error: argument <address> <filename>: [Errno 2] No such file or directory: 'c:\\Users\\gry\\Documents\\PlatformIO\\Projects\\180903-182438-espidf-hello-world\\.pioenvs\\esp'
*** [upload] Error 2
============================================================================================= [ERROR] Took 215.64 seconds =============================================================================================
Le processus du terminal s'est achevé avec le code de sortie 1
Le terminal sera réutilisé par les tâches, appuyez sur une touche pour le fermer.
@ivankravets look at this phrase in particular
No such file or directory: 'c:\\Users\\gry\\Documents\\PlatformIO\\Projects\\180903-182438-espidf-hello-world\\.pioenvs\\esp'
*** [upload] Error 2
Esptool doesn't find "esp" file or directory but the full name is not "esp" but "esp wrover kit" the spaces have made esptool crash
For the first bug
The problem is that the led builtin pin number vary in function of each board:
And here is the list of all board with their led builtin number: https://github.com/espressif/arduino-esp32/search?utf8=✓&q=LED_BUILTIN
And for ESP-WROVER-KIT it's "LED_BUILTIN 0" (for GPIO 0, the red led of the RGB)
It is related with the issue here: https://github.com/espressif/arduino-esp32/issues/74
@ivankravets look by yourself with the ble advertise example with verbose option:
"c:\users\gry\.platformio\penv\scripts\python.exe" "C:\Users\gry\.platformio\packages\tool-esptoolpy\esptool.py" --chip esp32 --port "COM7" --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 C:\Users\gry\Documents\PlatformIO\Projects\180903-195503-espidf-ble-adv\.pioenvs\esp wrover kit\bootloader.bin 0x8000 C:\Users\gry\Documents\PlatformIO\Projects\180903-195503-espidf-ble-adv\.pioenvs\esp wrover kit\partitions.bin 0x10000 ".pioenvs\esp wrover kit\firmware.bin"
usage: esptool write_flash [-h] [--flash_freq {keep,40m,26m,20m,80m}]
[--flash_mode {keep,qio,qout,dio,dout}]
[--flash_size FLASH_SIZE]
[--spi-connection SPI_CONNECTION] [--no-progress]
[--verify] [--compress | --no-compress]
<address> <filename> [<address> <filename> ...]
esptool write_flash: error: argument <address> <filename>: [Errno 2] No such file or directory: 'C:\\Users\\gry\\Documents\\PlatformIO\\Projects\\180903-195503-espidf-ble-adv\\.pioenvs\\esp'
*** [upload] Error 2
================================================================================================= [ERROR] Took 257.19 seconds =================================================================================================
I'm not able to upload all the rest of the verbose output because of github limitations.
@ivankravets can you check the updates on this topics please
I'm having the same issue, here. The problem is that esptool.py invokes the images files without escaping whitespaces.
"c:\users\ignaw\.platformio\penv\scripts\python.exe" "C:\Users\ignaw\.platformio\packages\tool-esptoolpy\esptool.py" --chip esp32 --port "COM5" --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio
--flash_freq 40m --flash_size detect 0x1000 C:\Users\ignaw\Google Drive\Proyectos\esp32-test\.pioenvs\nodemcu-32s\bootloader.bin 0x8000 C:\Users\ignaw\Google Drive\Proyectos\esp32-test\.pioenvs\nodemcu-32s\partitions.bin 0x10000 ".pioenvs\nodemcu-32s\firmware.bin"usage: esptool write_flash [-h] [--flash_freq {keep,40m,26m,20m,80m}]
[--flash_mode {keep,qio,qout,dio,dout}]
[--flash_size FLASH_SIZE]
[--spi-connection SPI_CONNECTION] [--no-progress]
[--verify] [--compress | --no-compress]
<address> <filename> [<address> <filename> ...]
esptool write_flash: error: argument <address> <filename>: [Errno 2] No such file or directory: 'C:\\Users\\ignaw\\Google'
*** [upload] Error 2
My solution was to manually edit .platformio\platforms\espressif32\builder\main.py
line 271:
- env.Append(UPLOADERFLAGS=[ image[0], "%s" % image[1]])
+ env.Append(UPLOADERFLAGS=[ image[0], "\"%s\"" % image[1]])
After re-building and uploading:
"c:\users\ignaw\.platformio\penv\scripts\python.exe" "C:\Users\ignaw\.platformio\packages\tool-esptoolpy\esptool.py" --chip esp32 --port "COM5" --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio
--flash_freq 40m --flash_size detect 0x1000 "C:\Users\ignaw\Google Drive\Proyectos\esp32-test\.pioenvs\nodemcu-32s\bootloader.bin" 0x8000 "C:\Users\ignaw\Google Drive\Proyectos\esp32-test\.pioenvs\nodemcu-32s\partitions.bin" 0x10000 .pioenvs\nodemcu-32s\firmware.bin
Now whitespaces are between double quotes, and esptool works just fine.
Serial port COM5
Connecting........__
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core
MAC: 30:ae:a4:1a:13:2c
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 18112 bytes to 11090...
Wrote 18112 bytes (11090 compressed) at 0x00001000 in 0.1 seconds (effective 1073.3 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 82...
Wrote 3072 bytes (82 compressed) at 0x00008000 in 0.0 seconds (effective 2457.6 kbit/s)...
Hash of data verified.
Compressed 154336 bytes to 80535...
Wrote 154336 bytes (80535 compressed) at 0x00010000 in 1.1 seconds (effective 1085.0 kbit/s)...
Hash of data verified.
Hope this helps.
excellent
First one: I've imported the arduino blinky, and uploaded to ESP-32-WROVER however no led blinks at the result.
Second one (and third one): I tried to do the same with the hello world example project with ESP-IDF however it fails into uploading, it gave me this (same remark for other ESP-IDF example like ble-adv example):