Skip to main content
Raghu Rajappa
Visitor II
September 4, 2017
Question

Debugging SPC56EL behaves strangely

  • September 4, 2017
  • 1 reply
  • 749 views
Posted on September 04, 2017 at 14:35

I have a simple for loop that should ideally run 20 times, inside which I toggle an LED.

When I debug this code on my SPC56EL controller (on a daughter board which is mounted onto the XP56 motherboard) WITHOUT hardware breakpoints, it toggles only once and exits the main handler (confirmed this behavior). But when I add breakpoints in the loop, it works perfectly. Any logical reasoning for such a behavior?

Summarizing - The code works when I put breakpoints in the loop but executes the loop only once when I do not put any breakpoints in the loop. 

#pls #spc56 #32bits #microcontroller
    This topic has been closed for replies.

    1 reply

    Erwan YVIN
    ST Employee
    September 4, 2017
    Posted on September 04, 2017 at 17:11

    Hello Raghu ,

    It is maybe due to the Compiler optimization.

    Which compiler do you use ?

    for such case , it is better to switch in assembler by Mixed Code

    Do you reproduce the issue in some examples applications in SPC5Studio ?

    SPC56ELxx_RLA SERIAL Test Application for DiscoveryPlus

       Best regards

                 Erwan