Xinyuan-LilyGO / T-Display-S3

MIT License
734 stars 174 forks source link

How to reset to factory settings after Burn Bootloader? #111

Closed headkit closed 1 year ago

headkit commented 1 year ago

Is there a way to reset the board to factory settings after Burn Bootloader? Thnx!

teastainGit commented 1 year ago

Hi! I am curious what you mean by after Burn Bootloader ? The board comes from LilyGO with a boot loader already installed and I believe it is permanently installed in ROM. What happened to yours? And what do you mean by factory settings?

I would like to help but I would like some more info.

How are you programming it? Arduino IDE, PlatformIO, ESP-IDF, Python?

Cheers ! Terry Stainton

@.***

On Mar 1, 2023, at 4:40 PM, headkit @.***> wrote:

Is there a way to reset the board to factory settings after Burn Bootloader? Thnx!

— Reply to this email directly, view it on GitHub https://github.com/Xinyuan-LilyGO/T-Display-S3/issues/111, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATCNKOGQ2YRJHTLLGPZD443WZ663FANCNFSM6AAAAAAVMSX6NE. You are receiving this because you are subscribed to this thread.

headkit commented 1 year ago

Thank you for your help. I had problems to upload Code via Aruino IDE app on macOs 12.6 Monterey. I got the error

bash: /esptool: No such file or directory
exit status 127

Testing things and clicking to fast I accidently fired 'Burn Bootloader'. I think I flashed it. Now I am stuck at all, trying to reconnect to the board, loosing the port one second afte selecting it. I don't get it to work again: When connecting Port, Serial Monitor says invalid header: 0xffffffff then connection is gone again.

With esptool I am able to connect and python3 -m esptool read_flash 0 0x400000 tmp.bin downloads an image. (found this here - don't know why to use 0x400000)

I think I could use write_flash to fix this. Is there a basic bin file that would reset the flash to factory settings?

I also found this option: CONFIG_BOOTLOADER_FACTORY_RESET but don't know how to use it.

I am using Arduino IDE and terminal/python to connect to the board. Arduino IDE is acting weird as I always lose connection.

doh38 commented 1 year ago

@headkit check which library you are using. I had a very similar (bad situation) while updating this week to the last esp-32 direver (2.0.7) I reverted back to 2.0.6, put it in bootloader mode, used old 1.8.19 arduino ide (which keeps the port connection somehow even if the esp is disconnecting from usb) and uploaded from there an empty neutral sketch (only setup and loop empty). this saved it. Hope that helps :)

headkit commented 1 year ago

I guess I need to find out first what bootloader mode means. I am such a beginner to board dev. Arduino IDE is acting weird, losing connection every second. In most cases its a wrong path to sources, but that should not be the problem. I don't get it why Apple changes everything every year so that finding matching resources is such a pain.

I think they changed the Arduino IDE to use VS Code in the background. I will try to use an older IDE. thnx

headkit commented 1 year ago

@headkit check which library you are using. I had a very similar (bad situation) while updating this week to the last esp-32 direver (2.0.7) I reverted back to 2.0.6, put it in bootloader mode, used old 1.8.19 arduino ide (which keeps the port connection somehow even if the esp is disconnecting from usb) and uploaded from there an empty neutral sketch (only setup and loop empty). this saved it. Hope that helps :)

using Arduino 1.8.19 I get the error

Caused by: java.io.IOException: error=2, No such file or directory

when uploading example sketches, like 'Sprite_draw'.

headkit commented 1 year ago

I deinstalled v2.0.6 and reinstalled 2.0.7 of esp32 by Espressif Systems. Using Arduino IDE 2.0.4 I still lose USB connection right after connecting port. But with Arduino 1.8.19 I was now able to upload the "Sprite_draw" example code to the system.

teastainGit commented 1 year ago

I heard that ESP32 v2.0.7 was buggy and 206 works great for me and using Arduino 2.0.4. Do you have a simple baseline program to test with? -Terry

headkit commented 1 year ago

@teastainGit I now can upload and run code using Arduino 1.8.19 and 2.0.7 of esp32 by Espressif Systems. Arduino IDE still is losing port connection right after selection.

teastainGit commented 1 year ago

So. You can upload a sketch using Arduino IDE 1.8.19? I don't think ESP32 2.0.7 is released by Arduino yet, as 2.0.6 is just fine. I use Arduino IDE 2.0.4 and ESP32 2.0.6 and it is very stable for LilyGO T-Display S3. Furthermore I have had some prototype sketches utilizing dual core and one other with too much graphics and no delay in the Loop. They were almost impossible to load a new more stable program with them running, which required much fiddling with the Boot switch and reset, In the end I pressed Boot and held, pressed reset, released reset and released Boot and go it into "Upload Mode" I then uploaded a stable baseline sketch and no further problems! -Terry

headkit commented 1 year ago

I now also put the device into "Upload mode" and it seems that Arduino IDE is establishing a stable connection again.

e-p-s commented 1 year ago

what is the upload mode?

i flashed mine and now i have a boot loop. the usb pling pling from windows repeats and repeats. and the red flash led is blinking all the time

lewisxhe commented 1 year ago

@e-p-s https://github.com/Xinyuan-LilyGO/T-Display-S3#quick-start

e-p-s commented 1 year ago

can't see the wood for the trees

LucasEaston commented 1 year ago

can't see the wood for the trees

This helped me fix mine. The BOOT button is the bottom Right button when holding the unit horizontally. I'm assuming this puts it in a mode where it doesn't run whatever broken sketch you have accidentally uploaded haha. So it boots in an idle state, so you can replace the broken sketch without the unit crashing constantly. Then when you hit reset it will run the fresh sketch.

1.Connect the board via the USB cable 2.Press and hold the BOOT button , While still pressing the BOOT button, press RST 3.Release the RST 4.Release the BOOT button 5.Upload sketch 6.Once sketch is uploaded, press and release RST