Skip to content

Support Cheap Yellow Display#110

Draft
jedie wants to merge 3 commits intoMicroPythonOS:mainfrom
jedie:cyd
Draft

Support Cheap Yellow Display#110
jedie wants to merge 3 commits intoMicroPythonOS:mainfrom
jedie:cyd

Conversation

@jedie
Copy link
Copy Markdown
Contributor

@jedie jedie commented Mar 31, 2026

see: #88

@jedie jedie marked this pull request as draft March 31, 2026 19:14
@jedie jedie force-pushed the cyd branch 2 times, most recently from e291fc9 to 780688e Compare April 1, 2026 20:29
jedie added 2 commits April 1, 2026 23:28
On a new, unsupported device, you may get a reboot loop. Because if the "mpos.main" can't detect the
board it just continues and tries to init the display. In by case (on a CYD) it results in a hard
crash -> a boot loop. This loop is short and avoids to be able to use "mpremote
cp"...

It looks like:

```
...
sys.version=3.4.0; LVGL (9.3.0) MicroPython (1.25.0) Binding compiled on 2026-04-01
sys.implementation=(name='micropython', version=(1, 25, 0, ''), _machine='Generic ESP32 module with
SPIRAM with ESP32', _mpy=11014, _build='ESP32_GENERIC-SPIRAM')
Free space on root filesystem:
total_space=0 / used_space=0 / free_space=0 bytes
RAM: 110656 free, 640 allocated, 111296 total
Passing execution over to mpos.main
MicroPythonOS 0.9.0 running lib/mpos/main.py
unPhone ?
odroid_go ?
m5stack_core2 ?
Try to I2C initialized on sda=21 scl=22
fail_save_i2c ok
Attempt to write a single byte to I2C bus address 0x34...
No device at this address: [Errno 116] ETIMEDOUT
m5stack_fire ?
Try to I2C initialized on sda=21 scl=22
fail_save_i2c ok
Attempt to write a single byte to I2C bus address 0x68...
No device at this address: [Errno 116] ETIMEDOUT
Unknown board: couldn't detect known I2C devices or unique_id prefix

A fatal error occurred. The crash dump printed below may be used to help
determine what caused it. If you are not already running the most recent
version of MicroPython, consider upgrading. New versions often fix bugs.

To learn more about how to debug and/or report this crash visit the wiki
page at: https://github.com/micropython/micropython/wiki/ESP32-debugging

LVGL MicroPython
IDF version : 67c1de1e
Machine     : Generic ESP32 module with SPIRAM with ESP32

Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.
...
```
The interesting line is `Unknown board: couldn't detect known I2C devices or unique_id prefix` so
that `detect_board()` returns `None` but the code just continues.

This PR will raise and error, that will be captured in the `main.py` and we end in the REPL. This
looks like:
```
...
sys.version=3.4.0; LVGL (9.3.0) MicroPython (1.25.0) Binding compiled on 2026-04-01
sys.implementation=(name='micropython', version=(1, 25, 0, ''), _machine='Generic ESP32 module with
SPIRAM with ESP32', _mpy=11014, _build='ESP32_GENERIC-SPIRAM')
Free space on root filesystem:
total_space=0 / used_space=0 / free_space=0 bytes
RAM: 110656 free, 640 allocated, 111296 total
Passing execution over to mpos.main
MicroPythonOS 0.9.0 running lib/mpos/main.py
unPhone ?
odroid_go ?
m5stack_core2 ?
Try to I2C initialized on sda=21 scl=22
fail_save_i2c ok
Attempt to write a single byte to I2C bus address 0x34...
No device at this address: [Errno 116] ETIMEDOUT
m5stack_fire ?
Try to I2C initialized on sda=21 scl=22
fail_save_i2c ok
Attempt to write a single byte to I2C bus address 0x68...
No device at this address: [Errno 116] ETIMEDOUT
Unknown board: couldn't detect known I2C devices or unique_id prefix
Traceback (most recent call last):
  File "main.py", line 32, in <module>
  File "mpos/main.py", line 253, in <module>
RuntimeError: No board detected, exit initialization!
Error in mpos.main, sleep for 5 seconds and end then...
LVGL (9.3.0) MicroPython (1.25.0) Binding compiled on 2026-04-01; Generic ESP32 module with SPIRAM
with ESP32
Type "help()" for more information.
>>>
```
Seems to be just another hacky way to expand the build process. Maybe the whole thing should be
restructured?

The idea is to add a target for CYD that has 4MB flash and no PSRAM. On the other side the normal
"esp32" build runs here ... So i really don't know it it's needed...
@jedie jedie force-pushed the cyd branch 2 times, most recently from 57ef6d6 to 0293dda Compare April 1, 2026 21:40
@jedie
Copy link
Copy Markdown
Contributor Author

jedie commented Apr 1, 2026

current progress:

sys.version=3.4.0; LVGL (9.3.0) MicroPython (1.25.0) Binding compiled on 2026-04-02
sys.implementation=(name='micropython', version=(1, 25, 0, ''), _machine='Generic ESP32 module with ESP32', _mpy=11014, _build='ESP32_GENERIC')
Free space on root filesystem:
total_space=225280 / used_space=16384 / free_space=208896 bytes
RAM: 165488 free, 1104 allocated, 166592 total
Passing execution over to mpos.main
MicroPythonOS 0.9.0 running lib/mpos/main.py
unPhone ?
odroid_go ?
cyd - Cheap Yellow Display ?
Detected cyd system, importing mpos.board.cyd
cyd.py initialization
lightsensor.read_uv()=1026000
cyd.py machine.SPI.Bus() initialization
cyd.py lcd_bus.SPIBus() initialization
cyd.py ili9341.ILI9341() initialization
cyd.py display.init()
cyd.py lv.init() initialization
cyd.py Touch initialization

cyd.py init finished

mounting freezefs_mount_builtin at /builtin.
SharedPreferences.load didn't find preferences: [Errno 2] ENOENT
[AppearanceManager] Setting primary color: 15769616
[AppearanceManager] Initialized: light_mode=True, primary_color=<lv_color_t>
init_rootscreen set resolution to 320x240 at 130 DPI
SharedPreferences.load didn't find preferences: [Errno 2] ENOENT
lv.task_handler() threw exception: memory allocation failed, allocating 9834 bytesWifiService: Auto-connect thread starting
SharedPreferences.load didn't find preferences: [Errno 2] ENOENT
E (2747) wifi:create wifi task: failed to create task
E (2747) wifi_init: Failed to deinit Wi-Fi driver (0x3001)
E (2747) wifi_init: Failed to deinit Wi-Fi (0x3001)

SharedPreferences.load didn't find preferences: [Errno 2] ENOENT
Traceback (most recent call last):
  File "task_handler.py", line 139, in _task_handler
MemoryEWifiServicrror: memory allocation failed, allocating 9834 bytes
AppManager finding apps...
e: No access points configured, eAppManager: handling apps got exception: [Errno 2] ENOENT
xiting
Found launcher com.micropythonos.launcher
Foreground app: com.micropythonos.launcher
Thread 1073548980: executing script with cwd: builtin/apps/com.micropythonos.launcher/assets/
Thread 1073548980: reading script from file builtin/apps/com.micropythonos.launcher/assets/launcher.py
execute_script: reading script_source took 29ms
Thread 1073548980: starting script
execute_script: compiling script_source took 114ms
apps.py execute_script: exec took 39ms
Classes: dict_keys(['DisplayMetrics', 'Launcher', 'Activity', 'AppearanceManager', 'AppManager'])
Functions: dict_keys([])
Variables: dict_keys(['time', '__name__', '__file__', 'ubinascii', 'math', 'uhashlib', 'lv'])
launcher.py onCreate()

The ILI9341 display doesn't work: Just garbage on it, today...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant