Due to high demand expect some shipping delays at this time, orders may not ship for 1-2 business days.
0

Installing circuitpython on TTGO T8 ESP32-S2 ST7789
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Installing circuitpython on TTGO T8 ESP32-S2 ST7789

by fmentiplay on Sun Mar 14, 2021 7:37 pm

I have a TTGO T8 ESP32-S2 ST7789 which is listed in downloads on circuitpython.org
I downloaded the latest .bin file and the latest .uf2 files
When I try to put the TTGO T8 ESP32-S2 ST7789 into boot mode by holding down the bot button and powering on TTGO T8 ESP32-S2 ST7789 I do not see a drive appear in my Windows 10 PC.
So I am not sure how to install circuitpython on my TTGO T8 ESP32-S2 ST7789.
Any help much appreciated
Thanks fmentiplay

fmentiplay
 
Posts: 6
Joined: Sun Mar 14, 2021 7:12 pm

Re: Installing circuitpython on TTGO T8 ESP32-S2 ST7789

by mikeysklar on Mon Mar 15, 2021 5:42 pm

@fmentiplay,

When you say you d/l'd the latest uf2/bin files. Where they the beta or the stable? It looks like we just started merging the display version of the TTGO T8 in late January so you will need to work with the BETA release to ensure device support.

https://github.com/adafruit/circuitpython/pull/4077

In terms of seeing your device on Windows. This is really a device specific driver issue. You need the CP210x USB VCP drivers and a valid USB DATA cable.

https://docs.espressif.com/projects/esp ... ction.html

mikeysklar
 
Posts: 4154
Joined: Mon Aug 01, 2016 8:10 pm

Re: Installing circuitpython on TTGO T8 ESP32-S2 ST7789

by fmentiplay on Tue Mar 16, 2021 9:05 am

Hello Mikeyskair

Thank you for replying to my post. I really appreciate it.
I have done some research. My understanding is that if I want to use the circuitpython uf2 file for the lilygo_ttgo_t8_s2_st7789 then I need to install an Adafruit uf2 bootloader specific for the lilygo_ttgo_t8_s2_st7789. There does not seem to be one already compiled.

To build an Adafruit uf2 bootloader specific for the lilygo_ttgo_t8_s2_st7789 I attempted the following
I installed esp-idf v4.3 and I cloned Adafruit's tinyuf2 from https://github.com/adafruit/tinyuf2. I followed the instructions from https://github.com/adafruit/tinyuf2 but using the command ...
pi@raspberrypi:~/tinyuf2/ports/esp32s2 $ make BOARD=lilygo_ttgo_t8_s2_st7789 all
failed with a fatal error hal/cpu_hal.h No such file or diectory

I tried compiling the Adafruit tinyuf2 bootloader for the feather_stm32_express as a test and it compiled. So my "method" seems ok but I think there is something wrong with the files for the lilygo_ttgo_t8_s2_st7789 on the github site, https://github.com/adafruit/tinyuf2.

Do you know if there is a compiled adafruit uf2 bootloader for the lilygo_ttgo_t8_s2_st7789

Any help much appreciated
Regards Frank

fmentiplay
 
Posts: 6
Joined: Sun Mar 14, 2021 7:12 pm

Re: Installing circuitpython on TTGO T8 ESP32-S2 ST7789

by mikeysklar on Tue Mar 16, 2021 11:45 am

Good work getting this far with tinyuf2 at least building for other boards.

The updates for the lilygo are on-going so I'm not surprised something broke. I don't see any binaries being available in UF2 format now or in the future as we don't sell this board.

I would try and previous revisions to see if that helps resolve it. I have seen success with early developers getting things going so you are close.

https://github.com/adafruit/circuitpython/pull/4124

mikeysklar
 
Posts: 4154
Joined: Mon Aug 01, 2016 8:10 pm

Re: Installing circuitpython on TTGO T8 ESP32-S2 ST7789

by fmentiplay on Wed Mar 17, 2021 1:23 am

Hello Mikeyskar
Once again thank you for your help

I updated the esp-idf to v4.4 but I am still having compile errors. The problem is that the compile process can't find a lot of the #include files. They exist but the compile can't find them. I am not a C programming person, I program with Python that is why I want to get Circuitpython running on my lilygo_ttgo_t8_s2_st7789. I am not a C programming person.

Do you have the email of the person who put the the circuitpython .uf2 and .bin files on circuitpython.org?

It is my understanding that there are two methods for installing Circuitpython.
1. installing the appropriate bootloader then doing a drag and drop with the circuitpython.uf2 file for the lilygo_ttgo_t8_s2_st7789.
This is the method I am having trouble with.

2. Use esptool.py and upload the circuitpython .bin file. I tried this but when I tried to go to the REPL on the lilygo_ttgo_t8_s2_st7789 using Putty but I got scrolling data (which is unusable), which looks like it from the lilygo_ttgo_t8_s2_st7789 rom? I think I am using the wrong arguments for esptool.py
This is what I tried ...
PS C:\Users\xxxxxl\Downloads> esptool.py --chip esp32s2 --port COM17 -b 115200 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 4MB 0x0000 adafruit-circuitpython-lilygo_ttgo_t8_s2_st7789-en_US-20210314-da030ce.bin
It uploaded without error but I got scrolling text as mentioned above.
Do you know what arguments to use with esptool.py?

Thanks for all your help
Regards Frank

fmentiplay
 
Posts: 6
Joined: Sun Mar 14, 2021 7:12 pm

Re: Installing circuitpython on TTGO T8 ESP32-S2 ST7789

by danhalbert on Wed Mar 17, 2021 9:18 am

We have not tested with ESP-IDF 4.4 and we recommend you stick with the current version chosen in the source tree. Some people are testing 4.3, but it's an ongoing process.

Your description of how to install the .bin looks OK to me. The scrolling text you mention will really add a clue as to what is going on. Are you talking about text scrolling on the screen or in the REPL? In the first case, you could take a picture; in the second, copy and paste should work (unplug the board to stop the text, for instance).

danhalbert
 
Posts: 2377
Joined: Tue Aug 08, 2017 12:37 pm

Re: Installing circuitpython on TTGO T8 ESP32-S2 ST7789

by fmentiplay on Fri Mar 19, 2021 8:21 am

Hello danhalbert
Thank you for responding to my post. To answer your question about method two (i.e trying to use esptool to upload the circuitoython.bin file to the lilygo_ttgo_t8_s2_st7789)
1. I put the dip switches of the lilygo_ttgo_t8_s2_st7789 in the Native USB mode.
2. I put the lilygo_ttgo_t8_s2_st7789 into boot mode by holding down the bot button then hold and release the rst button then release the bot button. This puts the lilygo_ttgo_t8_s2_st7789 into bot mode and it uses com15 (I am using windows 10)
3. In Powershell I run the following command
S C:|Users\xxxx> esptool.py --port COM15 --after=no_reset write_flash 0x0 circuitpython.bin
Note: I got the latest circuitpython from S3 as recommended in circuitpython.org and renamed it circuitpython.bin
The install runs without an error.
4. I do a reboot of the lilygo_ttgo_t8_s2_st7789. I do not see the "circuitpython picture" on the st7789 screen on the lilygo_ttgo_t8_s2_st7789 as illustrated at https://circuitpython.org/board/lilygo_ ... s2_st7789/ I only see a blank screen.
5. I use putty, in serial mode, to try and access the REPL of the circuitpython as a check to see if circuitpyton installed correctly.
I see flashing text. I captured the putty screen. Please see the attached file. That text just keeps repeating.
I am very keen to get circuitpython working on the lilygo_ttgo_t8_s2_st7789 so any help would be really be appreciated.
Thanks
Regards Frank
Attachments
Lilygo-circuitpython.JPG
Lilygo-circuitpython.JPG (24.22 KiB) Viewed 41 times

fmentiplay
 
Posts: 6
Joined: Sun Mar 14, 2021 7:12 pm

Re: Installing circuitpython on TTGO T8 ESP32-S2 ST7789

by fmentiplay on Sat Mar 20, 2021 2:27 am

GOT IT WORKING!!!!

20/3/2021
**** Finally got CircuitPython working on lilygo_tgo_t8_s2_st7789 *****

There are two methods for installing CircuitPython on the lilygo_tgo_t8_s2_st7789
The ESP32-S2 has a builtin bootloader. You cannot delete it, which is good, because basically you can't "brick" the lilygo_tgo_t8_s2_st7789.

With the builtin bootloader you can "load" a .bin file and the inbuilt bootloader will put the .bin file in the correct memory location.
The .bin file can be a C++/C program you have written and compiled into a .bin file OR it could be the circuitpython.bin file for the lilygo_tgo_t8_s2_st7789 you get from circuitpython.org. This is what I will call method one which I will detail shortly.

Another option to install CircuitPython on the lilygo_tgo_t8_s2_st7789 is to use the circuitpython.uf2 file from circuitpython.org. With this method you install a second bootloader, tinyuf2. This allows you to drag and drop the circuitpython.uf2 file onto the lilygo_tgo_t8_s2_st7789. I will not detail this method in this report. (Basically because I can't get it to work at the moment).

*** Details of first method - using builtin bootloader and the circuitpython.bin file ****
I will use the Raspberry Pi 4 (4M version)
The lilygo_tgo_t8_s2_st7789 board can be put in one of two modes, what I call Native USB mode and ch-340 mode. To use the "builtin bootloader and the circuitpython.bin" method you need to put the lilygo_tgo_t8_s2_st7789 board into ch-340 mode.
(If looking at the board the dip switch is in the lower left corner.
Dip Switch from left to right UP DOWN UP DOWN)
The ch-340 mode uses usb/uart chip.
Connect the lilygo_tgo_t8_s2_st7789 board to a USB port on the Raspberry Pi. Connect to the Raspberry Pi. You can connect using keyboard/Monitor or VNC or SSH. I used SSH.
1. Install esptool.py using pip ($sudo install esptool). Check what version of esptool you have ...
$esptool.py version My esptool is ...
esptool.py v3.1-dev
3.1-dev
make sure your version is 3.0 or later.
2. Find out what port is being used for the lilygo_tgo_t8_s2_st7789. Simplest method is to do a $ls /dev/tty* then remove the board a do $la /dev/tty* and check the difference. My port was /dev/ttyUSB0
3. Clean up your lilygo_tgo_t8_s2_st7789 board
$ esptool.py --chip auto --port /dev/ttyUSB0 erase_flash
4. If you haven't already download the latest circuipython.bin file for the lilygo_tgo_t8_s2_st7789 board from circuitpython.org
5. install the circuitpython.bin file onto the lilygo_tgo_t8_s2_st7789 board
$ esptool.py --chip auto --port /dev/ttyUSB0 -b 460800 --before=default_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 4MB 0x0000 ./circuitpython.bin

If all goes well you should see the following on the lilygo_tgo_t8_s2_st7789 screen ...
"Auto-reload is on. Simply save files
over USB to run them or enter REPL to
disable

code.py output:
Hello World!

code done running"
6. Disconnect the lilygo_tgo_t8_s2_st7789 board and change the dip switch to Native USB mode.
(If looking at the board the dip switch is in the lower left corner.
Dip Switch from left to right DOWN UP DOWN UP)

7. Reconnect the lilygo_tgo_t8_s2_st7789 board you should now see a new folder ..
/media/pi/CIRCUITPY It worked!!
Note: The port name changes from /dev/ttyUSB0 to /dev/ttyACM0
Also if you have installed Putty you can test out the REPL. It worked!!

8. As another check remove the lilygo_tgo_t8_s2_st7789 board and connect it to a Windows 10 machine. You should see a new folder CIRCUITPY(D:) It worked!!
Using Device Manager to get the COM port, Com21
Using Putty (in serial mode, Com21, 115200) you should be able to connect to REPL. It worked!!

Thanks for giving me your thoughts.
Regards Frank

fmentiplay
 
Posts: 6
Joined: Sun Mar 14, 2021 7:12 pm

Please be positive and constructive with your questions and comments.