2 Replies Latest reply on Sep 11, 2017 2:45 AM by user_1377889

    Debug stack trace without main - How?

    wm-cypress.com_1887796

      Hi All,

       

      Short version:

       

      I've got a debug stack trace which doesn't contain 'main' - how is that possible? (see attached)

       

      Thanks!

       

       

      Long version:

       

       

      I'm struggling with a weird intermittent problem around I2C and how the process is somehow stalling after running well for a LONG time, but it's complex to detail, so I'm trying to abstract the fundamental symptoms from this post and look at a curious symptom which may give a clue to the cause.

       

      I've connected through SWD to a PSOC exhibiting the issue and investigated a bit.

      I've done it a few times, everytime it halts in the WDT callback process as expected (good that the WDT keeps firing!) and I see an oddity about the stack trace:  there is no main anywhere in it, the root is the function '__aeabi_uidivmod'.

       

      Can anyone help me understand how this is possible?

      is it a sign of a stack smash, or are there other explanations?

       

      I should highlight I'm using interrupts on:

      - WDT, (8hz)

      - GPIO, (never used in these tests)

      - (EZ)I2C, (controlled by EZI2C)

      - ADC done (store value)

       

      There is an infinite loop in main that should never exit.

      for(;;){ ... }
      

       

      I've caused normal WDT timeouts to occur, and that stack trace includes the expected function list (see attached screenshot).

       

      I'm hoping that this may be a cryptic clue to the cause of my other troubles...

       

      Any thoughts appreciated, no matter how speculative.

       

      Thanks for any suggestions!

       

      P.S. Unfortunately I've not been able to make a minimal project with the same symptoms yet and there is proprietary code mixed in so I can't post the code.  I may in future if I can get similar results from a basic project.