Skip to content

Can't display images from SD Card on cores3se #74

@artpi

Description

@artpi

I have CoreS3SE and when i try do display images from sd card, the screen either stays blank or device crashes.

This will fail (device will crash or just stay black)

M5.Lcd.drawImage("/sd/background.jpg", 0, 0)

While this works:

def display_sd_image(sd_path, flash_temp="/flash/temp.jpg"):
    """
    Display an image from SD card by copying to flash first.
    Workaround for M5Stack SPI bus conflict.
    """
    # Read from SD into memory
    with open(sd_path, "rb") as f:
        image_data = f.read()
    
    # Write to flash
    with open(flash_temp, "wb") as f:
        f.write(image_data)
    
    # Free memory
    del image_data
    
    # Now display from flash (this works!)
    M5.Lcd.drawImage(flash_temp, 0, 0)


def setup():
    M5.begin()
    Widgets.setRotation(1)
    
    # Mount SD card (CoreS3 SE pins)
    sdcard.SDCard(slot=3, width=1, sck=36, miso=35, mosi=37, cs=4, freq=20000000)
    
    # Display image using the workaround
    display_sd_image("/sd/background.jpg")

I think this is SPI conflict for reading and displaying at the same time

I've described it here:

https://piszek.com/2025/12/12/images-from-sd-card-on-m5stack-cores3/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions