<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I don’t use PDINSTANCE, but after checking some online stuff I thought maybe the size of the stack is the problem so I’ve changed it from 0x400 to 0x4000 and heap size from 0x200 to 0x2000, but no success.<div class="">Still - I guess there is something going on with the memory so I’ll be checking this some more.</div><div class=""><img apple-inline="yes" id="B3F317AE-D35F-4748-A74C-D96BCF4F0A05" width="582" height="287.5" src="cid:0F0A8671-4F4E-471B-81BD-BB2AA9D2DC33" class=""></div><div><br class=""><blockquote type="cite" class=""><div class="">On 22 Mar 2020, at 18:01, Christof Ressi <<a href="mailto:info@christofressi.com" class="">info@christofressi.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
  
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" class="">
  
  <div class=""><p class="">Don't worry too much about *vp for now. The fault actually occurs
      in m_class.c:506.</p><p class="">Do you use PDINSTANCE?<br class="">
    </p><p class="">Also, you can check stm32f4xx_it.c:90 to see what kind of error
      you're getting.</p><p class="">How much memory do you have available?<br class="">
    </p><p class="">Christof<br class="">
    </p>
    <div class="moz-cite-prefix">On 22.03.2020 17:15, Boštjan Jerko
      wrote:<br class="">
    </div>
    <blockquote type="cite" cite="mid:944E473B-6963-40F1-847A-1369A682E80C@gmail.com" class="">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" class="">
      I’m attaching images from debugger. The strange thing is that
      type1 is A_DEFFLOAT, but *vp is still A_NULL. Guess I need to work
      (at least) on that.
      <div class="">That way the loop doesn’t even get started.</div>
      <div class="">So one image shows values of type1 and *vp and the
        other is stack.</div>
      <div class=""><br class="">
      </div>
      <div class="">I’m using stm32f429 and Segger programmer with their
        Ozone debugger.</div>
      <div class=""><br class="">
      </div>
      <div class="">B.</div>
      <div class=""><br class="">
      </div>
      <div class=""><span id="cid:part1.BAF0769F.1B088BF4@christofressi.com"><vp_value.png></span><span id="cid:part2.A43806B0.0807CC49@christofressi.com"><stack.png></span></div>
      <div class="">
        <div class=""><br class="">
          <div class=""><br class="">
            <blockquote type="cite" class="">
              <div class="">On 22 Mar 2020, at 11:52, Christof Ressi
                <<a href="mailto:info@christofressi.com" class="" moz-do-not-send="true">info@christofressi.com</a>>
                wrote:</div>
              <br class="Apple-interchange-newline">
              <div class="">
                <div class="">
                  <blockquote type="cite" class="">and then in function
                    class_new vp is empty so while (*vp) doesn’t go
                    through it<br class="">
                  </blockquote>
                  What do you mean by "empty", when exactly is "vp"
                  empty and how did you test?<br class="">
                  <br class="">
                  "vp" is initially set to "type1", which in the case of
                  pdint_setup() is "A_DEFFLOAT". So it would be very
                  strange if "vp" was initially empty in the case
                  pdint_setup(). The while loop sets "vp" to the next
                  vararg and increments the pointer until it encounters
                  "A_NULL" (= 0). So finally, "*vp" will always be 0, if
                  that is what you mean by empty.<br class="">
                  <br class="">
                  Or did you mean "vp" itself is NULL? This would be
                  even stranger, because it points to the stack.<br class="">
                  <br class="">
                  Do your run the code in a debugger? If yes, post the
                  stack trace. If not, well, use a debugger :-)<br class="">
                  <br class="">
                  BTW, which device are you using?<br class="">
                  <br class="">
                  Christof<br class="">
                  <br class="">
                  On 22.03.2020 09:13, Boštjan Jerko wrote:<br class="">
                  <blockquote type="cite" class="">Hi Christof,<br class="">
                    <br class="">
                    the problem is that I don’t really know what happens
                    but it goes something like that:<br class="">
                    <br class="">
                    calling pd_init -> pd_init_systems ->
                    conf_init -> x_connective_setup -> pdint_setup<br class="">
                    <br class="">
                    and then in function class_new vp is empty so while
                    (*vp) doesn’t go through it and after exiting
                    class_new the microcontroller stops with a hard
                    error.<br class="">
                    So maybe the question is really - should the vp be
                    empty and if not - why is that happening?<br class="">
                    <br class="">
                    B.<br class="">
                    <br class="">
                    <blockquote type="cite" class="">On 21 Mar 2020, at
                      13:58, Christof Ressi <<a href="mailto:info@christofressi.com" class="" moz-do-not-send="true">info@christofressi.com</a>>
                      wrote:<br class="">
                      <br class="">
                      Hi,<br class="">
                      <br class="">
                      <blockquote type="cite" class="">The code compiles
                        but I get the error when running in the
                        pdint_setup where pdint_new in class_new breaks
                        with an error.<br class="">
                        My idea is to first try to understand the code
                        hence my question:<br class="">
                      </blockquote>
                      I think first you should post the error you get
                      ;-) Maybe the problem is trivially solved without
                      having to look at  code for class_new() at all.<br class="">
                      <blockquote type="cite" class="">What does
                        class_new do?<br class="">
                      </blockquote>
                      It creates a new Pd class (t_pd). The class
                      contains all the methods and some metadata. It
                      also registers a creator function in
                      pd_objectmaker, which is the factory object for
                      all classes.<br class="">
                      <br class="">
                      When you type "[foo 0]" you really send a message
                      "obj <x> <y> foo 0" to the canvas,
                      which in turn sends a message "foo 0" to
                      pd_objectmaker, which finally returns a newly
                      created instance (given that it can find a creator
                      method for "foo").<br class="">
                      <br class="">
                      But again, I think the problem is likely trivial
                      and those implementation details shouldn't concern
                      you, unless you want to learn about Pd internals,
                      of course :-)<br class="">
                      <br class="">
                      Christof<br class="">
                      <br class="">
                      On 21.03.2020 13:20, Boštjan Jerko wrote:<br class="">
                      <blockquote type="cite" class="">Hi,<br class="">
                        <br class="">
                        I’m trying to port libpd to stm32. I don’t need
                        gui so working only on connecting pd script to
                        the output (which is DAC from stm32 in my case).<br class="">
                        The code compiles but I get the error when
                        running in the pdint_setup where pdint_new in
                        class_new breaks with an error.<br class="">
                        My idea is to first try to understand the code
                        hence my question:<br class="">
                        What does class_new do?<br class="">
                        <br class="">
                        My guess is connecting puredata command with a
                        function in C. Am I correct or completely
                        missing the point?<br class="">
                        <br class="">
                        Thanks.<br class="">
                        <br class="">
                        B.<br class="">
                        <br class="">
                        <br class="">
                        _______________________________________________<br class="">
                        Pd-dev mailing list<br class="">
                        <a href="mailto:Pd-dev@lists.iem.at" class="" moz-do-not-send="true">Pd-dev@lists.iem.at</a><br class="">
                        <a class="moz-txt-link-freetext" href="https://lists.puredata.info/listinfo/pd-dev">https://lists.puredata.info/listinfo/pd-dev</a><br class="">
                      </blockquote>
                      <br class="">
                      <br class="">
                      _______________________________________________<br class="">
                      Pd-dev mailing list<br class="">
                      <a href="mailto:Pd-dev@lists.iem.at" class="" moz-do-not-send="true">Pd-dev@lists.iem.at</a><br class="">
                      <a class="moz-txt-link-freetext" href="https://lists.puredata.info/listinfo/pd-dev">https://lists.puredata.info/listinfo/pd-dev</a><br class="">
                    </blockquote>
                  </blockquote>
                  <br class="">
                  <br class="">
                  <br class="">
                  _______________________________________________<br class="">
                  Pd-dev mailing list<br class="">
                  <a href="mailto:Pd-dev@lists.iem.at" class="" moz-do-not-send="true">Pd-dev@lists.iem.at</a><br class="">
                  <a class="moz-txt-link-freetext" href="https://lists.puredata.info/listinfo/pd-dev">https://lists.puredata.info/listinfo/pd-dev</a><br class="">
                </div>
              </div>
            </blockquote>
          </div>
          <br class="">
        </div>
      </div>
    </blockquote>
  </div>

_______________________________________________<br class="">Pd-dev mailing list<br class=""><a href="mailto:Pd-dev@lists.iem.at" class="">Pd-dev@lists.iem.at</a><br class="">https://lists.puredata.info/listinfo/pd-dev<br class=""></div></blockquote></div><br class=""></body></html>