@kuriko
Thank you for advice.
The problem of AtomS3R's PSRAM not being usable in UIFlow2.0 has been resolved.
Cause:
The PSARM enable setting in the following file, which sets the build settings, was missing.
uiflow_micropython/m5stack/boards/sdkconfig.spiram_oct
Solution:
Modify the missing description as shown below, then build the firmware and write it to AtomS3R.
Before:
# MicroPython on ESP32-S2 and ESP32-PAD1_subscript_3, ESP IDF configuration with SPIRAM support in Octal mode
CONFIG_SPIRAM_MODE_QUAD=
CONFIG_SPIRAM_MODE_OCT=y
After:
# MicroPython on ESP32-S2 and ESP32-PAD1_subscript_3, ESP IDF configuration with SPIRAM support in Octal mode
CONFIG_SPIRAM_MODE_QUAD=
CONFIG_SPIRAM_MODE_OCT=y
# MicroPython on ESP32, ESP IDF configuration with SPIRAM support
CONFIG_SPIRAM=y
CONFIG_SPIRAM_CACHE_WORKAROUND=y
CONFIG_SPIRAM_IGNORE_NOTFOUND=y
CONFIG_SPIRAM_USE_MALLOC=y
# This is the threshold for preferring small allocations from internal memory
# first, before failing over to PSRAM.
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=8192
# SPIRAM increases the size of the firmware and overflows iram0_0_seg, due
# to PSRAM bug workarounds. Apply some options to reduce the firmware size.
CONFIG_COMPILER_OPTIMIZATION_SIZE=y
CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT=y
# CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH=y # Workaround required: see main_esp32/linker.lf
CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y
CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH=y
Result:
8MB of memory space is now available as shown below.
Souce Code Of "Rseult":
import os, sys, io
import M5
from M5 import *
import gc
a = None
def setup():
global a
M5.begin()
print("--start--")
print("Mem-Free: " + str(gc.mem_free()))
print("Mem-Alloced: " + str(gc.mem_alloc()))
a = bytearray(1*1024*1024)
print("Memory allocated : about 1MB")
print("Mem-Free: " + str(gc.mem_free()))
print("Mem-Alloced: " + str(gc.mem_alloc()))
def loop():
global a
M5.update()
if __name__ == '__main__':
try:
setup()
while True:
loop()
except (Exception, KeyboardInterrupt) as e:
try:
from utility import print_error_msg
print_error_msg(e)
except ImportError:
print("please update to latest firmware")
==================================================
kuriko さんありがとうございます。
AtomS3RのPSRAMがUIFlow2.0で使用できない問題が解決しました。
原因:
ビルド設定を行う下記のファイルのPSARM有効化の設定が不足していました。
uiflow_micropython/m5stack/boards/sdkconfig.spiram_oct
対策:
不足ている記載を上記英文「After:」のように修正ししてからファームウェアをビルドしAtomS3Rに書き込みます。
結果:
下記の様に8MBのメモリ空間が使用可能になりました。
(日本の方にも情報共有できるよう、日本語併記としました。)