Cypress技术论坛
直播中

罗标雄

8年用户 140经验值
私信 关注
[问答]

在调试模式下,ISR消耗单步

亲爱的论坛读者,
在调试模式下运行时,我一直在PSoC5和5LP系列部件上出现问题。我的问题是,当我有一个tiC ISR系统,每秒100000万次更新计数器。我想调试一个单独的不相关的代码段。所以我会设置一个断点,然后尝试单步通过我要检查的代码。我需要打开的中断才能进入这段代码。计数器计数,然后在计数器达到特定值后执行特定代码。所以我需要调试的代码。我将设置一个断点,代码执行停止。现在我想单步执行下一行代码,单击单步按钮,然后我在ISR中,而不是我想去的地方。好的,我会点击跳出按钮,然后我又回到ISR的开始。回到断点的唯一方法是点击播放按钮。在这一点上,我回到那里,我点击单步按钮,我在ISR再次。我希望部分/调试器有一种方式允许我在中断启用时使用单步模式。当我遇到一个断点时,内部时钟似乎并没有停止,调试器没有在我通过每一行代码时向处理器添加一个固定数量的时钟。C代码的每一条独特代码行都必须与X .ASM指令的Y系统时钟相等,而C是C的特定行中的指令。相反,我得到一个断点,调试器停止并显示我在哪里,但是处理器上的内部时钟继续运行时钟。时钟是从CyOnCH出来的示意区,这是绑在一个ISR。它与主控有同步。我应该使用另一种时钟吗?我知道我也可以关闭我的断点后,手动中断我的断点和重新启用它们,一旦我通过调试,但必须有一个更好的更清洁的方式来工作。
谢谢你的帮助!!
马特

以上来自于百度翻译


     以下为原文
  Dear Forum readers,
    I have been having an issue on the Psoc5, and 5lp series parts when running in debug mode.  My problem is when I have a system tic isr that goes off at 1000-10000 times per second to update counters.  I am wanting to debug a separate unrelated section of code.  So ill set a break point and then attempt to single step through the code I want to inspect.  I need the interrupts turned on to get into this section of code.  Counter counts up and then executes specific code once counters reach a specific value.  So I'm in the code I need to debug.  I'll set a break point and the code execution stops.  Now I want to single step to the next line of code, Click the single step button and then I am in the ISR and not where I want to be.  Ok, I'll click the jump out button and then I'm at the beginning of the isr again.  The only way to get back to the break point is to click the play button.  At this point I'm back where I started and I click the single step button and I'm in the isr again.  I am hoping the part/debugger has a way of allowing me to use the single step mode while the interrupts are enabled.  It seems like the internal clocks are not stopping when I have hit a break point and the debugger is not adding a fixed number clocks to the processor as I step thru each line of code.  Each unique line of c code with x  .asm instructions should equal y system clocks based upon the instruction in that specific line of c.  Instead I get to a break point and the debugger stops and shows me where I am but the internal clocks on the processor keep running the clocks.  The clock is coming from the cy_clock out of the schematic area which is tied to a isr.  It does have the sync with master checked.  Should I be using another kind of clock?  I know I can also turn off the global interrupts manually after I hit my break point and reenable them once I am through debugging, but there has got to be a better cleaner way for this to work.  
    Thanks for the help!!
    Matt

回帖(10)

王琳

2019-6-10 07:07:24
是的,这个问题以前已经报道过,但恐怕不能得到纠正。
你所看到的行为的原因是硬件依赖的。记住:当到达断点时,只有程序执行停止,硬件仍在运行,可能会产生中断,此时中断服务。
当执行重新开始时(当然),中断处理,当处理完成后返回到断点集。所以看起来好像什么也没有发生过。在等待恢复执行时,产生下一个中断…等等。
因此,当单步执行的最佳方法是禁用中断时,您会找到额外的菜单按钮来进行此作业,因此您不需要在代码中乱七八糟。
快乐迈步
鲍勃

以上来自于百度翻译


     以下为原文
  Yes, that issue has ben reported before, but I'm afraid it cannot get corrected.
    The cause of the behaveour you have seen is hardware-dependent. Remember: When reaching a breakpoint, only the program-execution stops, the hardware is still running and may produce interrupts which are not serviced at this time.
    When execution is resumed at first (of course) the interrupt becomes handled, when done the handler returns - to your breakpoint set. So it looks as if nothing has happened between. While waiting for resuming execution the next interrupt is produced... and so on.
    So when single-stepping the best would be to disable the interrupts, you find a menu-button extra for this job, so you do not need to mess around in code.
     
    Happy stepping
    Bob
举报

王淑珍

2019-6-10 07:23:52
是的,这是IDE的一个问题,但是我同意柏柏尔可以做的事情不多。在任务栏上添加一个Iutut Deable按钮有助于调试。

以上来自于百度翻译


     以下为原文
   yes, this is one of the issues of this IDE, but I agree that this is not much Cypress can do. The addition of having a interupt diable button on the task bar is helpful when debugging. 
举报

罗标雄

2019-6-10 07:33:41
非常感谢你们!
因此,从我所读到的,这是处理器中的硅级问题,还是处理器中的钩子停止处理器和调试器不使用钩子?底线,这将得到解决柏树在未来是固定的还是问题将是一个较低层次的问题,将不会得到修复?IM猜测这个问题是在所有PSoC部件3’-5’s?
谢谢你
马特

以上来自于百度翻译


     以下为原文
  Great Thank you Guys!
     
    So from what I am reading this is a silicon level issue in the processor or are the hooks in the processor to stop the processor and the debugger does not use the hooks?  Bottom line, will this get addressed by Cypress in the future to be fixed or is issue going to be one of the lower level issues that wont get fixed?  Im guessing this issue is in all the Psoc parts 3's-5's?
     
    Thank you
    Matt 
举报

罗标雄

2019-6-10 07:47:54
谢谢你,鲍伯,
我想我可以通过禁用这些中断来工作,但我肯定这是更干净的。
再次感谢你的帮助!!
马特

以上来自于百度翻译


     以下为原文
  Thank you Bob,
     
    I think I can make it work with this disabling the interrupts, but I sure wich this was cleaner. 
     
    Thanks again for your help!!
    Matt
举报

更多回帖

发帖
×
20
完善资料,
赚取积分