Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arduino IDE result in bootloop #7125

Closed
1 task done
LaudixGit opened this issue Aug 13, 2022 · 29 comments
Closed
1 task done

Arduino IDE result in bootloop #7125

LaudixGit opened this issue Aug 13, 2022 · 29 comments
Labels
Chip: ESP32-S3 Issue is related to support of ESP32-S3 Chip IDE: Arduino IDE Issue relates to Arduino IDE Status: Solved

Comments

@LaudixGit
Copy link

Board

UM TinyS3 & UM FeatherS3

Device Description

Using a Raspberry Pi 4B
New, 2020.4.04, desktop image (fails with both 32-bit and 64-bit)
ESP32S3 devices connected via USBC cable (know data cable. see, later, successful serial communications)

Hardware Configuration

brand new, just unpacked ESP32S3 boards - no modifications no additions

Version

v2.0.4

IDE Name

Arduino IDE

Operating System

Linux RPi4Arduino 5.15.32-v8+ #1538 SMP PREEMPT Thu Mar 31 19:40:39 BST 2022 aarch64 GNU/Linux

Flash frequency

QIO

PSRAM enabled

yes

Upload speed

921600

Description

Failure: After successful upload of any sketch, the device continuously reboots.

Expected: Device must reliably and successfully execute code.

cross-referencing:
6013
6519
6661

note: the UnexpectedMaker team assisted in isolating this issue

Sketch

void setup() {
Serial.begin(115200);
}
void loop() {
Serial.println("test");
delay(5000);
}

Debug Message

this is written to the serial port after any upload.
(redundant in case the timestamps helps understand the frequency)

14:29:18.102 -> ESP-ROM:esp32s3-20210327
14:29:18.102 -> Build:Mar 27 2021
14:29:18.102 -> rst:0x3 (RTC_SW_SYS_RST),boot:0x2b (SPI_FAST_FLASH_BOOT)
14:29:18.102 -> Saved PC:0x403bb22e
14:29:18.102 -> SPIWP:0xee
14:29:18.102 -> mode:DIO, clock div:1
14:29:18.102 -> load:0x3fcd0108,len:0x43c
14:29:18.102 -> load:0x403b6000,len:0xbd0
14:29:18.102 -> load:0x403ba000,len:0x29c8
14:29:18.102 -> entry 0x403b61d8
14:29:18.102 -> ESP-ROM:esp32s3-20210327
14:29:18.102 -> Build:Mar 27 2021
14:29:18.102 -> rst:0x3 (RTC_SW_SYS_RST),boot:0x2b (SPI_FAST_FLASH_BOOT)
14:29:18.102 -> Saved PC:0x403bb22e
14:29:18.136 -> SPIWP:0xee
14:29:18.136 -> mode:DIO, clock div:1
14:29:18.136 -> load:0x3fcd0108,len:0x43c
14:29:18.136 -> load:0x403b6000,len:0xbd0
14:29:18.136 -> load:0x403ba000,len:0x29c8
14:29:18.136 -> entry 0x403b61d8
14:29:18.136 -> ESP-ROM:esp32s3-20210327

Other Steps to Reproduce

Same results with ESP v2.0.3, v2.0.4, and with RC
Same results with 32-bit and 64-bit version of OS.

Note: ESP32S3 device comes preloaded with neopixel sketch; which worked fine until the upload of a sketch

Note: Using VS Code with PlatfomIO extension, succeeds on the host (no other changes needed).
(e.g., failure is only when using Arduino IDE)

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@LaudixGit LaudixGit added the Status: Awaiting triage Issue is waiting for triage label Aug 13, 2022
@LaudixGit
Copy link
Author

Worth noting. The SD Card for the Raspberry Pi host was created Aug 12, 2022.
Ran (sudo apt update && sudo apt -y full-upgrade ) before any installation.
rebooted and then installed Arduino and ESP32 boards

wget https://downloads.arduino.cc/arduino-1.8.19-linuxaarch64.tar.xz

https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

IOW: everything was freshly installed - no bloat, no residuals

@LaudixGit
Copy link
Author

Also worth noting. The environment succeeds using all the above, but targeting an older board, wESP32.

e.g., failure seems limited to the ESP32S3

@Jason2866
Copy link
Collaborator

Flash type correctly selected and set?
S3 bootloops if flash type for Flash and PSRAM is not 100% correct.

@LaudixGit
Copy link
Author

LaudixGit commented Aug 14, 2022

Hmm. not sure what the correct settings are, but same bootloop occurs with either Flash option, and with with PSRAM enabled or disabled.
But maybe I've got something else wrong? (essentially I kept the defaults the board set when I selected it)

@LaudixGit
Copy link
Author

My settings are identical to the ones suggested by the device manufacturer on their getting-started page.
temp

But if different settings will make this work, I am willing to try. I've attempted a dozen permutations with no better results.

@Jason2866
Copy link
Collaborator

@UnexpectedMaker Can you help?

@Jason2866
Copy link
Collaborator

Jason2866 commented Aug 14, 2022

Regarding https://esp32s3.com/tinys3.html it has 8 MB QIO flash and psram. So choose 8 MB partition (you did not) and enable PSRAM with mode QIO too. Reduce Upload speed to "115200"
Since i do not know "TinyUSB" and i do not use. Maybe it is the reason for the issues? Since the selected Partition scheme has no tinyusb section. If you choose this way you have to finde the matching partition scheme for.
EDIT:
After a look in the variants directory the partition scheme for UM Tiny S3 is partitions_tinyuf2.csv

@UnexpectedMaker
Copy link
Contributor

@UnexpectedMaker Can you help?

I have been helping. I asked the OP to open this issue. Definitely a problem unrelated to HW or tools menu config. Same settings work for Win, Mac. There are build issues on Linux flavours. Other open issues for Ubuntu. Lots of users on my discord unable to use Linux for Arduino dev.

Something isn’t right.

@Jason2866
Copy link
Collaborator

@UnexpectedMaker Have you tried with Platformio?

@UnexpectedMaker
Copy link
Contributor

@UnexpectedMaker Have you tried with Platformio?

Works for the OP in PIO, not in Arduino IDE. Asking the OP is better than me as he created the issue and has all of the info.

@Jason2866
Copy link
Collaborator

Thx. I am out, since it is working with PlatformIO. Not using ArduinoIDE.

@VojtechBartoska VojtechBartoska added the IDE: Arduino IDE Issue relates to Arduino IDE label Aug 15, 2022
@SuGlider
Copy link
Collaborator

@LaudixGit - It seems from the discussion that the issue is related to ARM64 Linux only and Arduino IDE. Is it right?

@VojtechBartoska VojtechBartoska added Chip: ESP32-S3 Issue is related to support of ESP32-S3 Chip Resolution: Awaiting response Waiting for response of author and removed Status: Awaiting triage Issue is waiting for triage labels Aug 15, 2022
@VojtechBartoska
Copy link
Contributor

Maybe @me-no-dev can help us with that when he is back.

@LaudixGit
Copy link
Author

related to ARM64 Linux only and Arduino IDE. Is it right?

@SuGlider Nope: Same bootloop results with both 32-bit and 64-bit OS when using Arduino IDE.
(and, for the record, PIO works on both OS versions)

@SuGlider
Copy link
Collaborator

@LaudixGit - Could you please try this other Arduino IDE configuration:

There are a few changes to the one you posted, related to OTG/UART0/CDC.

image

@LaudixGit
Copy link
Author

@SuGlider same results - bootlooping
(interesting to note that it loops slower though)

image

@SuGlider
Copy link
Collaborator

@LaudixGit - but it works fine with PlatformIO, right?

Could you please send me your PIO setup and configuration?

@LaudixGit
Copy link
Author

@SuGlider I am very new to PIO (1st install 2 days ago). I am not sure where setup and config are, but the files I know of are attached.
And, yes, PIO successfully compiles and uploads; the TinyS3 runs fine. (and so does the FeatherS3)

platformio.ini.txt
main.cpp.txt

@VojtechBartoska VojtechBartoska added Status: Needs investigation We need to do some research before taking next steps on this issue and removed Resolution: Awaiting response Waiting for response of author labels Aug 17, 2022
@SuGlider
Copy link
Collaborator

We need to investigate it further... It may be related to second-stage bootloader used in Arduino.

@me-no-dev
Copy link
Member

Has the board config been checked? Maybe lingering bootloader.bin in the variant folder? Errors seem to point that bootloader was not found or is not valid. Last log even suggests that partition scheme was not found either.

@me-no-dev
Copy link
Member

The problem is in esptool. Versions differ slightly between the ones for win+mac and linux. You can get the correct esptool.py from inside this archive and replace the one in ~/.arduino15/packages/esp32/tools/esptool_py/3.3.0/. This issue will be resolved in the next version (esptool is updated).

@me-no-dev me-no-dev added Status: To be implemented Selected for Development and removed Status: Needs investigation We need to do some research before taking next steps on this issue labels Aug 22, 2022
@VojtechBartoska VojtechBartoska added this to the 2.0.5 milestone Aug 22, 2022
@VojtechBartoska VojtechBartoska moved this from Todo to In Progress in Arduino ESP32 Core Project Roadmap Aug 22, 2022
@VojtechBartoska VojtechBartoska moved this from In Progress to In Review in Arduino ESP32 Core Project Roadmap Aug 22, 2022
@UnexpectedMaker
Copy link
Contributor

The problem is in esptool. Versions differ slightly between the ones for win+mac and linux. You can get the correct esptool.py from inside this archive and replace the one in ~/.arduino15/packages/esp32/tools/esptool_py/3.3.0/. This issue will be resolved in the next version (esptool is updated).

Oh wicked!!! Thanks heaps for getting this resolved - will be lots of happy S3 Linux users now!

@VojtechBartoska
Copy link
Contributor

Same here as in #7165, this issue will be investigated at the end of September, it's postponed due to HW location.

One thing you can help us is to test this on 2.0.3. Our investigation showed that it only doesn't work on 2.0.4. Thanks!

@VojtechBartoska VojtechBartoska moved this from In Review to Under investigation in Arduino ESP32 Core Project Roadmap Aug 24, 2022
@VojtechBartoska VojtechBartoska removed this from the 2.0.5 milestone Aug 24, 2022
@LaudixGit
Copy link
Author

Our investigation showed that it only doesn't work on 2.0.4. Thanks!

I tried the TinyS3 with 2.0.3 and had the bootloop issue.

Note: I'll try the archive workaround in a few days; currently have the hardware wired into a project.

@LaudixGit
Copy link
Author

Before making any changes, I downloaded and extracted the archive.

Then listed my original files and the newly downloaded ones.
I was very surprised to see my original files are all the identical size. That seems suspicious.

My orig files
laudix@RPiArduino:~ $ ls -l ~/.arduino15/packages/esp32/tools/
total 28
drwxr-xr-x 3 laudix laudix 4096 Aug 12 22:56 esptool_py
drwxr-xr-x 3 laudix laudix 4096 Aug 12 22:56 mklittlefs
drwxr-xr-x 3 laudix laudix 4096 Aug 12 22:56 mkspiffs
drwxr-xr-x 3 laudix laudix 4096 Aug 12 22:54 riscv32-esp-elf-gcc
drwxr-xr-x 3 laudix laudix 4096 Aug 12 22:54 xtensa-esp32-elf-gcc
drwxr-xr-x 3 laudix laudix 4096 Aug 12 22:55 xtensa-esp32s2-elf-gcc
drwxr-xr-x 3 laudix laudix 4096 Aug 12 22:55 xtensa-esp32s3-elf-gcc

Newly downloaded files
laudix@RPiArduino:~ $ ls -l esptool-3.3/
total 408
drwxr-xr-x 2 laudix laudix 4096 Mar 22 05:07 build_tools
-rw-r--r-- 1 laudix laudix 5208 Mar 22 05:07 CONTRIBUTING.rst
drwxr-xr-x 4 laudix laudix 4096 Mar 22 05:07 docs
-rwxr-xr-x 1 laudix laudix 8273 Mar 22 05:07 espefuse.py
drwxr-xr-x 3 laudix laudix 4096 Mar 22 05:07 espressif
-rwxr-xr-x 1 laudix laudix 9902 Mar 22 05:07 esp_rfc2217_server.py
-rwxr-xr-x 1 laudix laudix 51917 Mar 22 05:07 espsecure.py
-rwxr-xr-x 1 laudix laudix 268415 Mar 22 05:07 esptool.py
drwxr-xr-x 4 laudix laudix 4096 Mar 22 05:07 flasher_stub
-rw-r--r-- 1 laudix laudix 18092 Mar 22 05:07 LICENSE
-rw-r--r-- 1 laudix laudix 246 Mar 22 05:07 MANIFEST.in
-rw-r--r-- 1 laudix laudix 1371 Mar 22 05:07 README.md
-rw-r--r-- 1 laudix laudix 1070 Mar 22 05:07 setup.cfg
-rw-r--r-- 1 laudix laudix 4609 Mar 22 05:07 setup.py
drwxr-xr-x 7 laudix laudix 4096 Mar 22 05:07 test

@LaudixGit
Copy link
Author

LaudixGit commented Sep 5, 2022

Replacing the esptool.py file, as suggested, did not make any difference.

My environment
image

image

My Code
`void setup() {
// put your setup code here, to run once:
Serial.begin(11520);
}

void loop() {
// put your main code here, to run repeatedly:
Serial.println("test");
delay(5000);
}`

The steps I took

Before using the archived file

  • test the TinyS3; programmed via PlatformIO - success
  • using ArduinoIDE upload sketch to TinyS3 - FAIL, bootloop

Making changes

File listing after change
laudix@RPiArduino:~ $ ls -l ~/.arduino15/packages/esp32/tools/
total 292
-rwxr-xr-x 1 laudix laudix 268415 Sep 5 10:41 esptool.py
drwxr-xr-x 3 laudix laudix 4096 Aug 12 22:56 esptool_py
drwxr-xr-x 3 laudix laudix 4096 Aug 12 22:56 mklittlefs
drwxr-xr-x 3 laudix laudix 4096 Aug 12 22:56 mkspiffs
drwxr-xr-x 3 laudix laudix 4096 Aug 12 22:54 riscv32-esp-elf-gcc
drwxr-xr-x 3 laudix laudix 4096 Aug 12 22:54 xtensa-esp32-elf-gcc
drwxr-xr-x 3 laudix laudix 4096 Aug 12 22:55 xtensa-esp32s2-elf-gcc
drwxr-xr-x 3 laudix laudix 4096 Aug 12 22:55 xtensa-esp32s3-elf-gcc

Results

  • using ArduinoIDE upload sketch to TinyS3 - FAIL, bootloop

@LaudixGit
Copy link
Author

LaudixGit commented Sep 5, 2022

It occurred to me I misread the path and the .py file didn't end up in the correct folder
so.

cp ~/esptool-3.3/esptool.py ~/.arduino15/packages/esp32/tools/esptool_py/3.3.0/

Results

  • using ArduinoIDE upload sketch to TinyS3 - SUCCESS!

Update the ESP32 platform
image

Before
laudix@RPiArduino:~ $ ls -l ~/.arduino15/packages/esp32/tools/esptool_py/3.3.0/
total 264
-rwxr-xr-x 1 laudix laudix 267470 Mar 29 03:15 esptool.py

Repair QIO see

nano .arduino15/packages/esp32/hardware/esp32/2.0.4/boards.txt
image

Results

  • using ArduinoIDE upload sketch to TinyS3 - FAIL, bootloop

Using the archive
cp ~/esptool-3.3/esptool.py ~/.arduino15/packages/esp32/tools/esptool_py/3.3.0/

laudix@RPiArduino:~ $ ls -l ~/.arduino15/packages/esp32/tools/esptool_py/3.3.0/
total 264
-rwxr-xr-x 1 laudix laudix 268415 Sep 5 11:54 esptool.py

Results

  • using ArduinoIDE upload sketch to TinyS3 - SUCCESS!

@LaudixGit
Copy link
Author

@SuGlider , @UnexpectedMaker

Using the archive file I was successful at using ArduinoIDE to upload to theTinyS3 with both ESP 2.0.3 and ESP 2.0.4
(see above for details)

@SuGlider
Copy link
Collaborator

SuGlider commented Sep 5, 2022

Nice! Thanks for the information.

@mrengineer7777 mrengineer7777 added Status: Solved and removed Status: To be implemented Selected for Development labels Apr 13, 2023
@github-project-automation github-project-automation bot moved this from Under investigation to Done in Arduino ESP32 Core Project Roadmap Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chip: ESP32-S3 Issue is related to support of ESP32-S3 Chip IDE: Arduino IDE Issue relates to Arduino IDE Status: Solved
Projects
Development

No branches or pull requests

7 participants