<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How can I use AtomS3R&#x27;s PSRAM with UIFlow2.0?]]></title><description><![CDATA[<p dir="auto">How can I use AtomS3R's PSRAM with UIFlow2.0?<br />
I thought I could use 8MB of AtomS3R's PSRAM.<br />
However I could only use about 100kBytes by with UIFlow2.0.<br />
(Memory usage was checked using gc.mem_alloc() and gc.mem_free(). )</p>
<ul>
<li>Hardware: AtomS3R</li>
<li>Firmware: UIFlow2.0 AtomS3R v2.1.9</li>
</ul>
<p dir="auto"><strong>Memory Check Sample Program</strong></p>
<pre><code>import os, sys, io
import M5
from M5 import *
import gc

def setup():

  print("Allocated:", gc.mem_alloc(), "bytes")
  print("Free:", gc.mem_free(), "bytes")


def loop():
  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")
</code></pre>
<p dir="auto"><strong>Result</strong></p>
<pre><code>Allocated: 27488 bytes
Free: 87712 bytes
</code></pre>
]]></description><link>https://community.m5stack.com/topic/7090/how-can-i-use-atoms3r-s-psram-with-uiflow2-0</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Apr 2026 05:24:33 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/7090.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 14 Dec 2024 10:27:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How can I use AtomS3R&#x27;s PSRAM with UIFlow2.0? on Sat, 12 Apr 2025 06:24:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/230953">@ewoodier84</a><br />
I don't know way to do the with out Linux.<br />
I used Linux on virtual environment in windows.<br />
How about trying virtual environments like Hyper-V or VirtualBox?</p>
]]></description><link>https://community.m5stack.com/post/28868</link><guid isPermaLink="true">https://community.m5stack.com/post/28868</guid><dc:creator><![CDATA[UIgAVvwEs]]></dc:creator><pubDate>Sat, 12 Apr 2025 06:24:29 GMT</pubDate></item><item><title><![CDATA[Reply to How can I use AtomS3R&#x27;s PSRAM with UIFlow2.0? on Thu, 06 Mar 2025 00:44:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/189074">@UIgAVvwEs</a> Is there any way to do this without Linux? I need to do this exact thing but I can only be on windows</p>
]]></description><link>https://community.m5stack.com/post/28406</link><guid isPermaLink="true">https://community.m5stack.com/post/28406</guid><dc:creator><![CDATA[ewoodier84]]></dc:creator><pubDate>Thu, 06 Mar 2025 00:44:26 GMT</pubDate></item><item><title><![CDATA[Reply to How can I use AtomS3R&#x27;s PSRAM with UIFlow2.0? on Sat, 21 Dec 2024 05:28:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/189074">@UIgAVvwEs</a><br />
Note:<br />
Base Firmware:<br />
<a href="https://github.com/m5stack/uiflow-micropython/tree/master" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/m5stack/uiflow-micropython/tree/master</a><br />
Ver.2.2.0<br />
Hash: d0ff1edc97401edc0ab9063f0765730c44335b94</p>
<p dir="auto">Build Environment:</p>
<ul>
<li>OS: Linux Mint 21.3 Cinamon(*)  ... on Hyper-V of Windows</li>
</ul>
<p dir="auto">(* : Because, it was difficult to set up a build environment for "uiflow-micropython" on Windows.)</p>
]]></description><link>https://community.m5stack.com/post/27537</link><guid isPermaLink="true">https://community.m5stack.com/post/27537</guid><dc:creator><![CDATA[UIgAVvwEs]]></dc:creator><pubDate>Sat, 21 Dec 2024 05:28:26 GMT</pubDate></item><item><title><![CDATA[Reply to How can I use AtomS3R&#x27;s PSRAM with UIFlow2.0? on Sat, 21 Dec 2024 05:03:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/168201">@kuriko</a><br />
Thank you for advice.<br />
The problem of AtomS3R's PSRAM not being usable in UIFlow2.0 has been resolved.</p>
<p dir="auto">Cause:<br />
The PSARM enable setting in the following file, which sets the build settings, was missing.</p>
<p dir="auto">uiflow_micropython/m5stack/boards/sdkconfig.spiram_oct</p>
<p dir="auto">Solution:<br />
Modify the missing description as shown below, then build the firmware and write it to AtomS3R.</p>
<p dir="auto">Before:</p>
<pre><code># 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
</code></pre>
<p dir="auto">After:</p>
<pre><code># 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
</code></pre>
<p dir="auto">Result:<br />
8MB of memory space is now available as shown below.</p>
<p dir="auto"><img src="/assets/uploads/files/1734757204193-%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2024-12-21-135933.png" alt="スクリーンショット 2024-12-21 135933.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Souce Code Of "Rseult":</p>
<pre><code>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")
</code></pre>
<p dir="auto">==================================================<br />
kuriko さんありがとうございます。</p>
<p dir="auto">AtomS3RのPSRAMがUIFlow2.0で使用できない問題が解決しました。</p>
<p dir="auto">原因：<br />
ビルド設定を行う下記のファイルのPSARM有効化の設定が不足していました。<br />
uiflow_micropython/m5stack/boards/sdkconfig.spiram_oct</p>
<p dir="auto">対策：<br />
不足ている記載を上記英文「After:」のように修正ししてからファームウェアをビルドしAtomS3Rに書き込みます。</p>
<p dir="auto">結果：<br />
下記の様に8MBのメモリ空間が使用可能になりました。</p>
<p dir="auto">(日本の方にも情報共有できるよう、日本語併記としました。)</p>
]]></description><link>https://community.m5stack.com/post/27536</link><guid isPermaLink="true">https://community.m5stack.com/post/27536</guid><dc:creator><![CDATA[UIgAVvwEs]]></dc:creator><pubDate>Sat, 21 Dec 2024 05:03:54 GMT</pubDate></item><item><title><![CDATA[Reply to How can I use AtomS3R&#x27;s PSRAM with UIFlow2.0? on Fri, 20 Dec 2024 17:02:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/168201">@kuriko</a><br />
Hello kuriko,<br />
I tried manual memory allocation, but it failed.<br />
Is there any difference from your environment? Did you know anything?</p>
<p dir="auto"><img src="/assets/uploads/files/1734714080663-%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2024-12-21-020014.png" alt="スクリーンショット 2024-12-21 020014.png" class=" img-fluid img-markdown" /></p>
<pre><code>import os, sys, io
import M5
from M5 import *

long_text = None

def setup():
  global long_text
  M5.begin()
  long_text = bytearray(1*1024*1024)

def loop():
  global long_text
  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")
</code></pre>
]]></description><link>https://community.m5stack.com/post/27534</link><guid isPermaLink="true">https://community.m5stack.com/post/27534</guid><dc:creator><![CDATA[UIgAVvwEs]]></dc:creator><pubDate>Fri, 20 Dec 2024 17:02:19 GMT</pubDate></item><item><title><![CDATA[Reply to How can I use AtomS3R&#x27;s PSRAM with UIFlow2.0? on Wed, 18 Dec 2024 11:18:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/168201">@kuriko</a><br />
Thank you for the information.</p>
<p dir="auto">But I want to reserve as heap memory.<br />
Because I want to allocate memory as a buffer to be used for HTTP communication by "request2".</p>
<p dir="auto">However this problem would be solved if there was a way to allocate the memory allocated by bytearray to the "request2" buffer.</p>
]]></description><link>https://community.m5stack.com/post/27499</link><guid isPermaLink="true">https://community.m5stack.com/post/27499</guid><dc:creator><![CDATA[UIgAVvwEs]]></dc:creator><pubDate>Wed, 18 Dec 2024 11:18:29 GMT</pubDate></item><item><title><![CDATA[Reply to How can I use AtomS3R&#x27;s PSRAM with UIFlow2.0? on Wed, 18 Dec 2024 09:44:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/189074">@UIgAVvwEs</a><br />
You can try to manually allocate a larger buffer to verify whether the PSRAM is loaded correctly:<br />
<img src="/assets/uploads/files/1734515093687-d3db9a71-2dd7-4e7e-996c-bd6ecc4a57cf-image.png" alt="d3db9a71-2dd7-4e7e-996c-bd6ecc4a57cf-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.m5stack.com/post/27496</link><guid isPermaLink="true">https://community.m5stack.com/post/27496</guid><dc:creator><![CDATA[kuriko]]></dc:creator><pubDate>Wed, 18 Dec 2024 09:44:54 GMT</pubDate></item></channel></rss>