russhughes / st7789s3_mpy

MicroPython driver for the TTGO T-Display-S3 st7789 display written in C
Other
63 stars 9 forks source link

Building firmware requires extra knowledge #8

Open kf106 opened 1 year ago

kf106 commented 1 year ago
  1. I couldn't get it to work with esp-idf v4.4, I needed to use esp-idf v4.4.4. I combined the esp-idf clone instructions as follows:

    git clone https://github.com/espressif/esp-idf.git
    git checkout v4.4.4
    git submodule update --init --recursive
  2. the micropython repo that is current didn't work. I had to use v1.20.0 as follows:

    git clone https://github.com/micropython/micropython.git
    git checkout v1.20.0
    git submodule update --init
  3. The relative path for the make command didn't work for the USER_C_MODULES; I had to use an absolute ~/<path to st7789_mpy> argument

  4. I needed to supply a board argument: BOARD=GENERIC_S3_SPIRAM_OCT

  5. the sdkconfig.board file in micropython/ports/esp32/boards/GENERIC_S3_SPIRAM_OCT/ needed editing to select 16MB:

    
    CONFIG_FLASHMODE_QIO=y
    CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
    CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y
    CONFIG_ESPTOOLPY_AFTER_NORESET=y

CONFIG_SPIRAM_MEMTEST=

CONFIG_ESPTOOLPY_FLASHSIZE_4MB= CONFIG_ESPTOOLPY_FLASHSIZE_8MB= CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y CONFIG_PARTITION_TABLE_CUSTOM=y CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-8MiB.csv"



After that, I got a firmware.bin in the build-GENERIC_S3_SPIRAM_OCT folder that, after flashing, gave me a micropython REPL after connecting with putty.

I hope this helps other people having the same problem. I was building on a clean install of Ubuntu 22.04.
robsannaa commented 1 year ago

Didn't you get an error like this? *** Support for FROZEN_MPY_DIR was removed. Please use manifest.py instead, see https://docs.micropython.org/en/latest/reference/manifest.html. Stop.

russhughes commented 1 year ago

That is another new change in the build system.

ubidefeo commented 11 months ago

@kf106

I have successfully compiled with the latest IDF (checkout 5.0.4) and MicroPython (master branch). I also configured default I2C(0) pins in mpconfigboard.cmake Here are the steps I followed, forgive the lengthy description, it's from my Obsidian notes

LilyGo T-Display S3 with 320x170 OLED parallel

if you're interested, here's the module I modified and froze

tdisplay.py

""" LilyGo T-DISPLAY-S3 170x320 ST7789 display """

from machine import Pin, SPI, freq
import st7789

freq(240000000)  # 240mhz clock

TFA = 0
BFA = 0

def Display(rotation=0, buffer_size=0, options=0):
    LCD_POWER = Pin(15, Pin.OUT)
    LCD_POWER.value(1)

    return st7789.ST7789(
        Pin(48, Pin.OUT),
        Pin(47, Pin.OUT),
        Pin(46, Pin.OUT),
        Pin(45, Pin.OUT),
        Pin(42, Pin.OUT),
        Pin(41, Pin.OUT),
        Pin(40, Pin.OUT),
        Pin(39, Pin.OUT),
        Pin(8, Pin.OUT),
        Pin(9, Pin.OUT),
        170,
        320,
        reset=Pin(5, Pin.OUT),
        cs=Pin(6, Pin.OUT),
        dc=Pin(7, Pin.OUT),
        backlight=Pin(38, Pin.OUT),
        rotation=rotation,
        options=options,
        buffer_size= buffer_size)

class Buttons():
    def __init__(self):
        self.name = "t-display-s3"
        self.left = Pin(0, Pin.IN)
        self.right = Pin(14, Pin.IN)
whatdtech commented 10 months ago

Thank you so much @ubidefeo

ubidefeo commented 10 months ago

@whatdtech , did you manage? :)

whatdtech commented 10 months ago

Yes