<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    Doing the watchdog init ourselves avoids the issue.<br>
    <br>
    To do so, we need to change line 38 in ovms_main to…<br>
    <font face="monospace">#if !CONFIG_ESP_TASK_WDT_INIT</font><br>
    …and disable that config option.<br>
    <br>
    Regards,<br>
    Michael<br>
    <br>
    <br>
    <div class="moz-cite-prefix">Am 18.02.23 um 10:12 schrieb Michael
      Balzer:<br>
    </div>
    <blockquote type="cite"
      cite="mid:1b4278c4-38de-dfcd-051d-a8481b19d5b4@expeedo.de">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      Ludovic,<br>
      <br>
      the issue is bound to the docker image version, I was using
      "espressif/idf", which is "latest".<br>
      <br>
      The build works using the same sdkconfig with
      "espressif/idf:release-v5.0" (and again fails at that mbedtls
      module when switching back to the "latest" image).<br>
      <br>
      So to build the current experimental state, I recommend using the
      docker image and basically doing the steps Ludovic formalized in
      the github action:<br>
      <br>
      <font face="monospace">### SETUP ###<br>
        <br>
        cd ~/esp/Open-Vehicle-Monitoring-System-3<br>
        <br>
        # setup branch:<br>
        git remote add llange    <a class="moz-txt-link-abbreviated
          moz-txt-link-freetext"
          href="mailto:git@github.com:llange/Open-Vehicle-Monitoring-System-3.git"
          moz-do-not-send="true">git@github.com:llange/Open-Vehicle-Monitoring-System-3.git</a><br>
        git branch -t experimental-esp-idf-build-workflow
        llange/experimental-esp-idf-build-workflow<br>
        <br>
        # switch to branch:<br>
        git checkout experimental-esp-idf-build-workflow<br>
        git submodule update --init --recursive<br>
        <br>
        # apply mongoose patch:<br>
        git apply
        --directory=vehicle/OVMS.V3/components/mongoose/mongoose
        vehicle/OVMS.V3/support/mongoose-espv5.patch<br>
        <br>
        # install v5 sdkconfig defaults:<br>
        cp vehicle/OVMS.V3/support/sdkconfig.defaults.esp5
        vehicle/OVMS.V3/sdkconfig.defaults<br>
        <br>
        # install v5 idf components:<br>
        cp vehicle/OVMS.V3/support/idf_component.yml.esp5
        vehicle/OVMS.V3/main/idf_component.yml<br>
        <br>
        <br>
        ### BUILD ###<br>
        <br>
        cd ~/esp/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3<br>
        <br>
        # launch docker shell:<br>
        docker run --rm -v $PWD:/project -w /project -it
        espressif/idf:release-v5.0<br>
        # init docker image (needs to be done on every start):<br>
        apt-get update && apt-get install -y dos2unix<br>
        <br>
        # OPTION 1: start with default config:<br>
        rm vehicle/OVMS.V3/sdkconfig<br>
        # NOTE: this will build for ESP32 >= rev3, excluding the
        SPIRAM bug workarounds<br>
        <br>
        # OPTION 2: update your existing sdkconfig:<br>
        idf.py menuconfig<br>
        # → press '/'<br>
        #   … enable FREERTOS_ENABLE_BACKWARD_COMPATIBILITY<br>
        #   … disable FREERTOS_ASSERT_ON_UNTESTED_FUNCTION<br>
        #   … disable MG_ENABLE_SSL<br>
        <br>
        # build:<br>
        idf.py build<br>
        <br>
        # flash & start USB monitor:<br>
        idf.py app-flash && idf.py monitor<br>
        <br>
      </font><br>
      The build boots & works, issues you described excluded.<br>
      <br>
      An issue I didn't expect:<br>
      <br>
      <font face="monospace">I (0) cpu_start: Starting scheduler on APP
        CPU.<br>
        E (0) task_wdt: esp_task_wdt_add(747): TWDT was never
        initialized<br>
        …<br>
        E (10) task_wdt: esp_task_wdt_add(747): TWDT was never
        initialized<br>
        <br>
        …and then repeated 4x per second:<br>
        E (3130) task_wdt: esp_task_wdt_reset(783): task not found</font><br>
      <br>
      I'll try to find the cause, as we cannot silent these ("early"
      logging) they make using the shell challenging.<br>
      <br>
      But, besides that, it has Wifi & cellular connectivity, so
      looks very promising -- nice work, Ludovic!<br>
      <br>
      Regards,<br>
      Michael<br>
      <br>
      <br>
      <div class="moz-cite-prefix">Am 18.02.23 um 00:53 schrieb Ludovic
        LANGE:<br>
      </div>
      <blockquote type="cite"
        cite="mid:6374592f-4437-244c-433b-3a58cd6c04e5@lange.nom.fr">
        <meta http-equiv="Content-Type" content="text/html;
          charset=UTF-8">
        <div class="moz-cite-prefix">Hi Michael,</div>
        <div class="moz-cite-prefix"><br>
        </div>
        <div class="moz-cite-prefix">I'm sorry to read that you're
          facing those issues.</div>
        <div class="moz-cite-prefix"><br>
        </div>
        <div class="moz-cite-prefix">It's almost certain that my
          sdkconfig, after being changed back and forth to disable
          certain modules that would not compile, is now not in a
          "pristine" state, and that's certainly why your build and mine
          do not activate the same compilation paths.</div>
        <div class="moz-cite-prefix"><br>
        </div>
        <div class="moz-cite-prefix">I'll be interested in getting your
          sdkconfig file to see what is left to fix to have it properly
          compile.</div>
        <div class="moz-cite-prefix"><br>
        </div>
        <div class="moz-cite-prefix">(In the meantime I have forced the
          compilation of this part of the module, fixed the compilation
          errors you were likely to have, and force-pushed those fixes
          on the 2 branches experimental-esp-idf-v5 and
          experimental-esp-idf-build-workflow)</div>
        <div class="moz-cite-prefix"><br>
        </div>
        <div class="moz-cite-prefix">Regarding the linking error, I'm
          not sure why you have it, as it's looks like it is part of the
          mbedtls of ESP-IDF 5.0 - I'll see if I can reproduce it when I
          have your sdkconfig.<br>
        </div>
        <div class="moz-cite-prefix"><br>
        </div>
        <div class="moz-cite-prefix">Regards,</div>
        <div class="moz-cite-prefix"><br>
        </div>
        <div class="moz-cite-prefix">Ludovic<br>
        </div>
        <div class="moz-cite-prefix"><br>
        </div>
        <div class="moz-cite-prefix">Le 17/02/2023 à 22:54, Michael
          Balzer a écrit :<br>
        </div>
        <blockquote type="cite"
          cite="mid:d4434bed-1d56-ee50-990b-b7a96587f22d@expeedo.de">
          <meta http-equiv="Content-Type" content="text/html;
            charset=UTF-8">
          Ludovic,<br>
          <br>
          using the docker image I managed to make some progress.<br>
          <br>
          I can now start the build process, but then run into printf
          format errors on main/ovms_module.cpp, e.g.<br>
          <br>
          /project/main/ovms_module.cpp: In function 'void
          print_blocks(OvmsWriter*, TaskHandle_t, bool)':<br>
          /project/main/ovms_module.cpp:438:37: error: format '%d'
          expects argument of type 'int', but argument 4 has type
          'uint32_t' {aka 'long unsigned int'} [-Werror=format=]<br>
          <br>
          I'm here:<br>
          <br>
          commit 19e36125c6e0597c901eb82a546ef82c1dea8a1e (HEAD ->
          experimental-esp-idf-v5, llange/experimental-esp-idf-v5)<br>
          Author: Ludovic LANGE <a class="moz-txt-link-rfc2396E"
            href="mailto:llange@users.noreply.github.com"
            moz-do-not-send="true"><llange@users.noreply.github.com></a><br>
          <br>
          I thought maybe you've sorted that out in your new build
          branch, but apparently that has the same error, which leaves
          me wondering how the automated build can work…<br>
          <br>
          I see you don't have CONFIG_FREERTOS_USE_TRACE_FACILITY in
          your new "sdkconfig.defaults.esp5", so the module isn't
          included in your build. But you also have
          CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=y, which automatically
          enables CONFIG_FREERTOS_USE_TRACE_FACILITY in my setup.<br>
          <br>
          Disabling both options, I just almost got through, just a
          final linker error:<br>
          <br>
          /project/components/zip/libzip/lib/zip_crypto_mbedtls.c:124:
          undefined reference to `mbedtls_pkcs5_pbkdf2_hmac'<br>
          <br>
          I assume there are more differences in your new branch /
          sdkconfig, I'll try that one next.<br>
          <br>
          Regards,<br>
          Michael<br>
          <br>
          <br>
          <div class="moz-cite-prefix">Am 10.02.23 um 09:37 schrieb
            Ludovic LANGE:<br>
          </div>
          <blockquote type="cite"
            cite="mid:189cc986-dd4a-151d-deef-3dd9feda5a3d@lange.nom.fr">
            <meta http-equiv="Content-Type" content="text/html;
              charset=UTF-8">
            <div class="moz-cite-prefix">Hi,</div>
            <div class="moz-cite-prefix"><br>
            </div>
            <div class="moz-cite-prefix">Just as a curiosity, I setup
              GitHub to build the v5 branch with "GitHub actions".</div>
            <div class="moz-cite-prefix"><br>
            </div>
            <div class="moz-cite-prefix">You can find the latest runs
              here : <a class="moz-txt-link-freetext"
href="https://github.com/llange/Open-Vehicle-Monitoring-System-3/actions"
                moz-do-not-send="true">https://github.com/llange/Open-Vehicle-Monitoring-System-3/actions</a></div>
            <div class="moz-cite-prefix"><br>
            </div>
            <div class="moz-cite-prefix">The configuration file is here
              : <a class="moz-txt-link-freetext"
href="https://github.com/llange/Open-Vehicle-Monitoring-System-3/blob/experimental-esp-idf-build-workflow/.github/workflows/build-ovms.yml"
                moz-do-not-send="true">https://github.com/llange/Open-Vehicle-Monitoring-System-3/blob/experimental-esp-idf-build-workflow/.github/workflows/build-ovms.yml</a></div>
            <div class="moz-cite-prefix"><br>
            </div>
            <div class="moz-cite-prefix"><i>Note: It's a specific branch
                because I had to add some configuration files (default
                sdkconfig options for example), change the reference to
                wolfssl submodule, add a patch for our mongoose version,
                ... ; but in the future I could make a PR for this
                feature if we find it useful.</i></div>
            <div class="moz-cite-prefix"><i>(I also would like to
                experiment a little bit with static code analysis, unit
                tests, etc...)</i></div>
            <div class="moz-cite-prefix"><br>
            </div>
            <div class="moz-cite-prefix">Regards,<br>
            </div>
            <div class="moz-cite-prefix"><br>
            </div>
            <div class="moz-cite-prefix">Le 06/02/2023 à 15:23, Ludovic
              LANGE a écrit :<br>
            </div>
            <blockquote type="cite"
              cite="mid:15321ef3-ca26-7026-32df-0bcbe8a60ab4@lange.nom.fr">
              <meta http-equiv="Content-Type" content="text/html;
                charset=UTF-8">
              <div class="moz-cite-prefix">Hi again,</div>
              <div class="moz-cite-prefix"><br>
              </div>
              <div class="moz-cite-prefix">Additionally, I've just
                verified that the official docker image for ESP-IDF
                (doc: <a class="moz-txt-link-freetext"
href="https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-docker-image.html"
                  moz-do-not-send="true">https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-docker-image.html</a>
                ) is able to build the branch.</div>
              <div class="moz-cite-prefix"><br>
              </div>
              <div class="moz-cite-prefix">The only thing to add to the
                image is the "dos2unix" utility ("apt update &&
                apt-get install dos2unix"), after that you'll be able to
                build the image.</div>
              <div class="moz-cite-prefix"><br>
              </div>
              <div class="moz-cite-prefix">Do not forget to update your
                sdkconfig (enabling FreeRTOS compatibility and
                unchecking SSL for mongoose) before building, and to do
                the patches for mongoose / wolfssl as described here: <a
                  class="moz-txt-link-freetext"
href="https://github.com/llange/Open-Vehicle-Monitoring-System-3/blob/experimental-esp-idf-v5/README.md"
                  moz-do-not-send="true">https://github.com/llange/Open-Vehicle-Monitoring-System-3/blob/experimental-esp-idf-v5/README.md</a><br>
              </div>
              <div class="moz-cite-prefix"><br>
              </div>
              <div class="moz-cite-prefix">Then "idf.py build" should
                work - at least !<br>
              </div>
              <div class="moz-cite-prefix"><br>
              </div>
              <div class="moz-cite-prefix">I've used the `<font
                  face="monospace"><span></span>docker run --rm -v <span
                    class="nv">$PWD</span>:/project -w /project -it
                  espressif/idf:<code class="docutils literal
                    notranslate"><span class="pre">release-v5.0</span></code></font>`
                command to have a shell prompt (launch that in your
                source file path)</div>
              <div class="moz-cite-prefix"><br>
              </div>
              <div class="moz-cite-prefix">Then install dos2unix, launch
                menuconfig, then build.</div>
              <div class="moz-cite-prefix"><br>
              </div>
              <div class="moz-cite-prefix">Tell me how it works for you.</div>
              <div class="moz-cite-prefix"><br>
              </div>
              <div class="moz-cite-prefix">(You may have some component
                build failure ; depending on the sdkconfig flags, I'm
                still trying to document it)</div>
              <div class="moz-cite-prefix"><br>
              </div>
              <div class="moz-cite-prefix">Regards,<br>
              </div>
              <div class="moz-cite-prefix"><br>
              </div>
            </blockquote>
            <br>
            <br>
            <fieldset class="moz-mime-attachment-header"></fieldset>
            <pre class="moz-quote-pre" wrap="">_______________________________________________
OvmsDev mailing list
<a class="moz-txt-link-abbreviated moz-txt-link-freetext" href="mailto:OvmsDev@lists.openvehicles.com" moz-do-not-send="true">OvmsDev@lists.openvehicles.com</a>
<a class="moz-txt-link-freetext" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" moz-do-not-send="true">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a>
</pre>
          </blockquote>
          <br>
          <pre class="moz-signature" cols="72">-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26</pre>
          <br>
          <fieldset class="moz-mime-attachment-header"></fieldset>
          <pre class="moz-quote-pre" wrap="">_______________________________________________
OvmsDev mailing list
<a class="moz-txt-link-abbreviated moz-txt-link-freetext" href="mailto:OvmsDev@lists.openvehicles.com" moz-do-not-send="true">OvmsDev@lists.openvehicles.com</a>
<a class="moz-txt-link-freetext" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" moz-do-not-send="true">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a>
</pre>
        </blockquote>
        <p><br>
        </p>
        <br>
        <fieldset class="moz-mime-attachment-header"></fieldset>
        <pre class="moz-quote-pre" wrap="">_______________________________________________
OvmsDev mailing list
<a class="moz-txt-link-abbreviated moz-txt-link-freetext" href="mailto:OvmsDev@lists.openvehicles.com" moz-do-not-send="true">OvmsDev@lists.openvehicles.com</a>
<a class="moz-txt-link-freetext" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" moz-do-not-send="true">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a>
</pre>
      </blockquote>
      <br>
      <pre class="moz-signature" cols="72">-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26</pre>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-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="72">-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26</pre>
  </body>
</html>