cancel
Showing results for 
Search instead for 
Did you mean: 

STM8 Workbench and breakpoint

system_of_a_68
Associate
Posted on June 09, 2014 at 20:26

Hi,

I use a stm8a-discovery board and IAR workbench for STM8 1.42 to developp a project.

I try to DEBUG my application but I have a problem when I use breakpoint or break the application execution because the MCU stop when it is on the breakpoint. For example, if I use output PWM, I see PWM on oscilloscope until I break the execution and I see it again when I execute from the current statement.

How can I change it to don't stop the MCU when I break the application execution ?

Thank you
2 REPLIES 2
chen
Associate II
Posted on June 10, 2014 at 12:10

Hi

''I try to DEBUG my application but I have a problem when I use breakpoint or break the application execution because the MCU stop when it is on the breakpoint. For example, if I use output PWM, I see PWM on oscilloscope until I break the execution and I see it again when I execute from the current statement.

How can I change it to don't stop the MCU when I break the application execution ?''

I think you miss-understand. The point of a break point is to stop the processor executing.

''How can I change it to don't stop the MCU when I break the application execution ?''

You cannot. The whole reason for a break point is to stop and examine what the processor is doing.

If you want to debug without stopping, 'instrument the code'

eg

Put printf in (if you have support for it eg through serial port)

Toggle spare IOport pin at certain points in the code.

mike23
Associate II
Posted on June 20, 2014 at 18:10

Don't use a breakpoint.  They are used to stop execution so you can examine registers and lines.

Often I use either a debug pin to capture output signals states, or install an infinite wait loop.  The problem with the loop is that if interrupts are still enabled (timers and such), they will still be active so may change things on you.