<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Looks good, no problems up to now.<br>
    <br>
    I've been building with SPIMEM_AGGRESSIVE before using the 3.1
    defaults. <br>
    <br>
    With the two new bluetooth memory options enabled…<br>
    <blockquote><tt>CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=y</tt><br>
      <tt>CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY=y</tt><br>
    </blockquote>
    …I now get this bluetooth memory footprint:<br>
    <br>
    <blockquote><tt>OVMS# power bluetooth status </tt><br>
      <tt>Power for bluetooth is off</tt><br>
      <br>
      <tt>OVMS# module memory </tt><br>
      <tt>Free 8-bit 66336/230084, 32-bit 232/376, SPIRAM
        4045440/4194252</tt><br>
      <br>
      <tt>OVMS# power bluetooth on     </tt><br>
      <tt>Power mode of bluetooth is now on</tt><br>
      <tt>I (140846) bluetooth: Powering bluetooth on...</tt><br>
      <tt>I (140906) BTDM_INIT: BT controller compile version [a4252a2]|</tt><br>
      <tt>I (140956) system_api: Base MAC address is not set, read
        default base MAC address from BLK0 of EFUSE</tt><br>
      <tt>E (141186) BT: bta_gattc_co_cache_addr_init, Line = 334, nvs
        flash get blob data fail, err_code = 1102</tt><br>
      <tt>I (141236) bluetooth: Reg app succeeded with inteface ID 3</tt><br>
      <tt>D (141286) bluetooth: event = 0|</tt><br>
      <tt>D (141336) bluetooth: GAP_EVT, event 22|</tt><br>
      <tt>D (141386) bluetooth: GAP_EVT, event 0|</tt><br>
      <tt>D (141446) bluetooth: GAP_EVT, event 1|</tt><br>
      <tt>D (141506) bluetooth: GAP_EVT, event 6|</tt><br>
      <tt>I (141546) bluetooth: advertising start success</tt><br>
      <br>
      <tt>OVMS# module memory </tt><br>
      <tt>Free 8-bit 37824/230084, 32-bit 232/376, SPIRAM
        4018840/4194252</tt><br>
      <tt>--Task--     Total DRAM D/IRAM   IRAM SPIRAM   +/- DRAM
        D/IRAM   IRAM SPIRAM</tt><br>
      <tt>tiT                 464    664      0   7980         +0    
        +0     +0     +4</tt><br>
      <tt>OVMS NetMan           4  14712    100  32248         +0 
        +9968     +0    +20</tt><br>
      <tt>btController          0     88      0      0         +0   
        +88     +0     +0</tt><br>
      <tt>Btc_task              0  14924      0   1304         +0
        +14924     +0  +1304</tt><br>
      <tt>btuT                  0   2252      0  23492         +0 
        +2252     +0 +23492</tt><br>
      <br>
      <tt>OVMS# module memory </tt><br>
      <tt>Free 8-bit 37556/230084, 32-bit 232/376, SPIRAM
        4017244/4194252</tt><br>
      <tt>--Task--     Total DRAM D/IRAM   IRAM SPIRAM   +/- DRAM
        D/IRAM   IRAM SPIRAM</tt><br>
      <tt>tiT                 464    912      0   7980         +0  
        +248     +0     +0</tt><br>
      <tt>wifi               1568     64      0   3748         +0    
        +0     +0  -1732</tt><br>
      <br>
      <tt>OVMS# power bluetooth off</tt><br>
      <tt>Power mode of bluetooth is now off</tt><br>
      <tt>I (184576) bluetooth: Powering bluetooth off...</tt><br>
      <tt>E (184626) BT: bta_dm_disable BTA_DISABLE_DELAY set to 200 ms</tt><br>
      <tt>D (184626) bluetooth: event = 6|</tt><br>
      <tt>I (191606) ovms-server-v2: Send MP-0
S0,K,0,0,,storage,29,50,0,0,0,0,0,0,1,0,0,0,96.59,124,91,0,95,-1,0,0,0,-1,91,58,0,0.00,0.00,0</tt><br>
      <tt>I (191656) ovms-server-v2: Send MP-0
        D0,0,5,0,0,0,0,0,0,191,0,0,1,0,12.9,0,13.14,0,0,0</tt><br>
      <tt>I (191706) ovms-server-v2: Send MP-0
        L51.302567,7.390008,223.4,339.7,1,1,0,10002,0,0.0,0.0</tt><br>
      <tt>D (192626) simcom: rx line ch=3 len=10  : +CREG: 1,1</tt><br>
      <tt>D (192676) simcom: rx line ch=3 len=26  : +CCLK:
        "80/01/23,09:12:28"</tt><br>
      <tt>D (192736) simcom: rx line ch=3 len=10  : +CSQ: 5,99</tt><br>
      <tt>D (192786) simcom: rx line ch=3 len=23  : +COPS:
        0,0,"congstar",2</tt><br>
      <tt>D (192836) simcom: rx line ch=3 len=2   : OK</tt><br>
      <br>
      <tt>OVMS# module memory </tt><br>
      <tt>Free 8-bit 61684/230084, 32-bit 232/376, SPIRAM
        4045296/4194252</tt><br>
      <tt>--Task--     Total DRAM D/IRAM   IRAM SPIRAM   +/- DRAM
        D/IRAM   IRAM SPIRAM</tt><br>
      <tt>main*             12516      0      0   6348       -128    
        +0     +0     +0</tt><br>
      <tt>Btc_task*             0    128      0      0         +0
        -14796     +0  -1304</tt><br>
      <tt>btuT*                 0     20      0      0         +0 
        -2232     +0 -23492</tt><br>
      <tt>tiT                 464    664      0   6420         +0  
        -248     +0  -1560</tt><br>
      <tt>wifi               1568     64      0   3788         +0    
        +0     +0    +40</tt><br>
      <tt>OVMS NetMan           4   9296    100  32248         +0 
        -5416     +0     +0</tt><br>
      <tt>btController          0      0      0      0         +0   
        -88     +0     +0</tt><br>
    </blockquote>
    <br>
    Better, but it still needs a lot (too much) of internal RAM.<br>
    <br>
    Btw, I needed to change the signature of the
    xt_error_handler_callback to build with bluetooth enabled on the
    current esp-idf.<br>
    <br>
    I'll push that change to our esp-idf.<br>
    <br>
    Regards,<br>
    Michael<br>
    <br>
    <br>
    <div class="moz-cite-prefix">Am 16.05.2018 um 05:10 schrieb Mark
      Webb-Johnson:<br>
    </div>
    <blockquote type="cite"
      cite="mid:AE2C0F4C-A9F3-457F-BC2F-2E8EEA56E3D5@webb-johnson.net">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      I’m doing some work on optimising RAM usage in OVMS v3.1. This is
      to try to make space for bluetooth, etc.
      <div class=""><br class="">
      </div>
      <div class="">First step is fixing the (broken) SPIMEM_AGGRESSIVE
        option to work better. Saving is worthwhile:</div>
      <div class=""><br class="">
      </div>
      <blockquote style="margin: 0 0 0 40px; border: none; padding:
        0px;" class="">
        <div class="">
          <div class="">Without aggressive:</div>
          <div class="">Free 8-bit 113116/281672, 32-bit 8020/24276,
            SPIRAM 4140964/4194252</div>
        </div>
        <div class=""><br class="">
        </div>
        <div class="">
          <div class="">With aggressive:</div>
          <div class="">Free 8-bit 137380/281640, 32-bit 8020/24276,
            SPIRAM 4108616/4194252</div>
        </div>
      </blockquote>
      <div class=""><br class="">
      </div>
      <div class="">That is the first step only. We are still using far
        too much internal RAM, and almost the whole 4MB of external RAM
        is sitting idle.</div>
      <div class=""><br class="">
      </div>
      <div class="">The reason for this eMail: Hopefully I didn’t break
        anything. If I did, let me know.</div>
      <div class=""><br class="">
      </div>
      <div class="">Regards, Mark.<br class="">
        <div><br class="">
          <blockquote type="cite" class="">
            <div class="">Begin forwarded message:</div>
            <br class="Apple-interchange-newline">
            <div style="margin-top: 0px; margin-right: 0px;
              margin-bottom: 0px; margin-left: 0px;" class=""><span
                style="font-family: -webkit-system-font, Helvetica Neue,
                Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);"
                class=""><b class="">From: </b></span><span
                style="font-family: -webkit-system-font, Helvetica Neue,
                Helvetica, sans-serif;" class="">GitHub <<a
                  href="mailto:noreply@github.com" class=""
                  moz-do-not-send="true">noreply@github.com</a>><br
                  class="">
              </span></div>
            <div style="margin-top: 0px; margin-right: 0px;
              margin-bottom: 0px; margin-left: 0px;" class=""><span
                style="font-family: -webkit-system-font, Helvetica Neue,
                Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);"
                class=""><b class="">Subject: </b></span><span
                style="font-family: -webkit-system-font, Helvetica Neue,
                Helvetica, sans-serif;" class=""><b class="">[openvehicles/Open-Vehicle-Monitoring-System-3]
                  2816b9: Support minimal build (all components
                  disabled) - ...</b><br class="">
              </span></div>
            <div style="margin-top: 0px; margin-right: 0px;
              margin-bottom: 0px; margin-left: 0px;" class=""><span
                style="font-family: -webkit-system-font, Helvetica Neue,
                Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);"
                class=""><b class="">Date: </b></span><span
                style="font-family: -webkit-system-font, Helvetica Neue,
                Helvetica, sans-serif;" class="">16 May 2018 at 10:13:49
                AM HKT<br class="">
              </span></div>
            <div style="margin-top: 0px; margin-right: 0px;
              margin-bottom: 0px; margin-left: 0px;" class=""><span
                style="font-family: -webkit-system-font, Helvetica Neue,
                Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);"
                class=""><b class="">To: </b></span><span
                style="font-family: -webkit-system-font, Helvetica Neue,
                Helvetica, sans-serif;" class=""><a
                  href="mailto:mark@webb-johnson.net" class=""
                  moz-do-not-send="true">mark@webb-johnson.net</a><br
                  class="">
              </span></div>
            <div style="margin-top: 0px; margin-right: 0px;
              margin-bottom: 0px; margin-left: 0px;" class=""><span
                style="font-family: -webkit-system-font, Helvetica Neue,
                Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);"
                class=""><b class="">Reply-To: </b></span><span
                style="font-family: -webkit-system-font, Helvetica Neue,
                Helvetica, sans-serif;" class="">GitHub <<a
                  href="mailto:noreply@github.com" class=""
                  moz-do-not-send="true">noreply@github.com</a>><br
                  class="">
              </span></div>
            <br class="">
            <div class=""><span style="caret-color: rgb(0, 0, 0);
                font-family: Menlo-Regular; font-size: 14px; font-style:
                normal; font-variant-caps: normal; font-weight: normal;
                letter-spacing: normal; text-align: start; text-indent:
                0px; text-transform: none; white-space: normal;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration: none; float: none; display: inline
                !important;" class="">Commit:
                23f307757abb6411f77500182b72b11417019317</span><br
                style="caret-color: rgb(0, 0, 0); font-family:
                Menlo-Regular; font-size: 14px; font-style: normal;
                font-variant-caps: normal; font-weight: normal;
                letter-spacing: normal; text-align: start; text-indent:
                0px; text-transform: none; white-space: normal;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration: none;" class="">
              <span style="caret-color: rgb(0, 0, 0); font-family:
                Menlo-Regular; font-size: 14px; font-style: normal;
                font-variant-caps: normal; font-weight: normal;
                letter-spacing: normal; text-align: start; text-indent:
                0px; text-transform: none; white-space: normal;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration: none; float: none; display: inline
                !important;" class="">     </span><a
href="https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/commit/23f307757abb6411f77500182b72b11417019317"
                style="font-family: Menlo-Regular; font-size: 14px;
                font-style: normal; font-variant-caps: normal;
                font-weight: normal; letter-spacing: normal; orphans:
                auto; text-align: start; text-indent: 0px;
                text-transform: none; white-space: normal; widows: auto;
                word-spacing: 0px; -webkit-text-size-adjust: auto;
                -webkit-text-stroke-width: 0px;" class=""
                moz-do-not-send="true">https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/commit/23f307757abb6411f77500182b72b11417019317</a><br
                style="caret-color: rgb(0, 0, 0); font-family:
                Menlo-Regular; font-size: 14px; font-style: normal;
                font-variant-caps: normal; font-weight: normal;
                letter-spacing: normal; text-align: start; text-indent:
                0px; text-transform: none; white-space: normal;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration: none;" class="">
              <span style="caret-color: rgb(0, 0, 0); font-family:
                Menlo-Regular; font-size: 14px; font-style: normal;
                font-variant-caps: normal; font-weight: normal;
                letter-spacing: normal; text-align: start; text-indent:
                0px; text-transform: none; white-space: normal;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration: none; float: none; display: inline
                !important;" class=""> Author: Mark Webb-Johnson <</span><a
                href="mailto:mark@webb-johnson.net" style="font-family:
                Menlo-Regular; font-size: 14px; font-style: normal;
                font-variant-caps: normal; font-weight: normal;
                letter-spacing: normal; orphans: auto; text-align:
                start; text-indent: 0px; text-transform: none;
                white-space: normal; widows: auto; word-spacing: 0px;
                -webkit-text-size-adjust: auto;
                -webkit-text-stroke-width: 0px;" class=""
                moz-do-not-send="true">mark@webb-johnson.net</a><span
                style="caret-color: rgb(0, 0, 0); font-family:
                Menlo-Regular; font-size: 14px; font-style: normal;
                font-variant-caps: normal; font-weight: normal;
                letter-spacing: normal; text-align: start; text-indent:
                0px; text-transform: none; white-space: normal;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration: none; float: none; display: inline
                !important;" class="">></span><br style="caret-color:
                rgb(0, 0, 0); font-family: Menlo-Regular; font-size:
                14px; font-style: normal; font-variant-caps: normal;
                font-weight: normal; letter-spacing: normal; text-align:
                start; text-indent: 0px; text-transform: none;
                white-space: normal; word-spacing: 0px;
                -webkit-text-stroke-width: 0px; text-decoration: none;"
                class="">
              <span style="caret-color: rgb(0, 0, 0); font-family:
                Menlo-Regular; font-size: 14px; font-style: normal;
                font-variant-caps: normal; font-weight: normal;
                letter-spacing: normal; text-align: start; text-indent:
                0px; text-transform: none; white-space: normal;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration: none; float: none; display: inline
                !important;" class=""> Date:   2018-05-16 (Wed, 16 May
                2018)</span><br style="caret-color: rgb(0, 0, 0);
                font-family: Menlo-Regular; font-size: 14px; font-style:
                normal; font-variant-caps: normal; font-weight: normal;
                letter-spacing: normal; text-align: start; text-indent:
                0px; text-transform: none; white-space: normal;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration: none;" class="">
              <br style="caret-color: rgb(0, 0, 0); font-family:
                Menlo-Regular; font-size: 14px; font-style: normal;
                font-variant-caps: normal; font-weight: normal;
                letter-spacing: normal; text-align: start; text-indent:
                0px; text-transform: none; white-space: normal;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration: none;" class="">
              <span style="caret-color: rgb(0, 0, 0); font-family:
                Menlo-Regular; font-size: 14px; font-style: normal;
                font-variant-caps: normal; font-weight: normal;
                letter-spacing: normal; text-align: start; text-indent:
                0px; text-transform: none; white-space: normal;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration: none; float: none; display: inline
                !important;" class=""> Changed paths:</span><br
                style="caret-color: rgb(0, 0, 0); font-family:
                Menlo-Regular; font-size: 14px; font-style: normal;
                font-variant-caps: normal; font-weight: normal;
                letter-spacing: normal; text-align: start; text-indent:
                0px; text-transform: none; white-space: normal;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration: none;" class="">
              <span style="caret-color: rgb(0, 0, 0); font-family:
                Menlo-Regular; font-size: 14px; font-style: normal;
                font-variant-caps: normal; font-weight: normal;
                letter-spacing: normal; text-align: start; text-indent:
                0px; text-transform: none; white-space: normal;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration: none; float: none; display: inline
                !important;" class="">   M vehicle/OVMS.V3/main/ovms.cpp</span><br
                style="caret-color: rgb(0, 0, 0); font-family:
                Menlo-Regular; font-size: 14px; font-style: normal;
                font-variant-caps: normal; font-weight: normal;
                letter-spacing: normal; text-align: start; text-indent:
                0px; text-transform: none; white-space: normal;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration: none;" class="">
              <span style="caret-color: rgb(0, 0, 0); font-family:
                Menlo-Regular; font-size: 14px; font-style: normal;
                font-variant-caps: normal; font-weight: normal;
                letter-spacing: normal; text-align: start; text-indent:
                0px; text-transform: none; white-space: normal;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration: none; float: none; display: inline
                !important;" class="">   M vehicle/OVMS.V3/main/ovms.h</span><br
                style="caret-color: rgb(0, 0, 0); font-family:
                Menlo-Regular; font-size: 14px; font-style: normal;
                font-variant-caps: normal; font-weight: normal;
                letter-spacing: normal; text-align: start; text-indent:
                0px; text-transform: none; white-space: normal;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration: none;" class="">
              <br style="caret-color: rgb(0, 0, 0); font-family:
                Menlo-Regular; font-size: 14px; font-style: normal;
                font-variant-caps: normal; font-weight: normal;
                letter-spacing: normal; text-align: start; text-indent:
                0px; text-transform: none; white-space: normal;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration: none;" class="">
              <span style="caret-color: rgb(0, 0, 0); font-family:
                Menlo-Regular; font-size: 14px; font-style: normal;
                font-variant-caps: normal; font-weight: normal;
                letter-spacing: normal; text-align: start; text-indent:
                0px; text-transform: none; white-space: normal;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration: none; float: none; display: inline
                !important;" class=""> Log Message:</span><br
                style="caret-color: rgb(0, 0, 0); font-family:
                Menlo-Regular; font-size: 14px; font-style: normal;
                font-variant-caps: normal; font-weight: normal;
                letter-spacing: normal; text-align: start; text-indent:
                0px; text-transform: none; white-space: normal;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration: none;" class="">
              <span style="caret-color: rgb(0, 0, 0); font-family:
                Menlo-Regular; font-size: 14px; font-style: normal;
                font-variant-caps: normal; font-weight: normal;
                letter-spacing: normal; text-align: start; text-indent:
                0px; text-transform: none; white-space: normal;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration: none; float: none; display: inline
                !important;" class=""> -----------</span><br
                style="caret-color: rgb(0, 0, 0); font-family:
                Menlo-Regular; font-size: 14px; font-style: normal;
                font-variant-caps: normal; font-weight: normal;
                letter-spacing: normal; text-align: start; text-indent:
                0px; text-transform: none; white-space: normal;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration: none;" class="">
              <span style="caret-color: rgb(0, 0, 0); font-family:
                Menlo-Regular; font-size: 14px; font-style: normal;
                font-variant-caps: normal; font-weight: normal;
                letter-spacing: normal; text-align: start; text-indent:
                0px; text-transform: none; white-space: normal;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration: none; float: none; display: inline
                !important;" class=""> Correct implementation of
                CONFIG_OVMS_HW_SPIMEM_AGGRESSIVE.</span><br
                style="caret-color: rgb(0, 0, 0); font-family:
                Menlo-Regular; font-size: 14px; font-style: normal;
                font-variant-caps: normal; font-weight: normal;
                letter-spacing: normal; text-align: start; text-indent:
                0px; text-transform: none; white-space: normal;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration: none;" class="">
            </div>
          </blockquote>
        </div>
        <br class="">
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
OvmsDev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OvmsDev@lists.openvehicles.com">OvmsDev@lists.openvehicles.com</a>
<a class="moz-txt-link-freetext" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="160">-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
</pre>
  </body>
</html>