Hi, I'm now developing a motor control integrated project with S32K148 EVB,
After configuring driver with processor expert and initialize, there's problem happened when PWM update duty worked with ADC update or UART update, the FTM_PWM stopped updating after 2~3 times of adc/uart update.
When I check the register value I found something strange:
Before ADC/UART task (everything works fine):
After ADC/UART task(2~3 times):
BTW, FTM_PWM works fine if there's no ADC/UART task.
Does anyone has this problem before?
Hi Ren Hao Chen,
Not sure why your ADC/UART reconfigure FTM module.
Please refer: 浅谈嵌入式MCU软件开发之条件断点的设置与使用详解(以S32DS IDE + U-Multink debugger为例介绍)
Set conditional breakpoint in your project and findout which line modify it.
According to your image, I think you can set conditional breakpoint show below:
((FTM4->SC)&FTM_SC_CLKS_MASK) == FTM_SC_CLKS(0)
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Robin,
Thanks for your advises.
After using this break point method, I found out that the register value doesn't change at all.
But the global variable pointer "ftmStatePtr[0]" provided by Processor Expert has changed, thus the PWM output is continue, just without any value updated.
By tracing the codes, this situation seems happened in " one of " DEV_ASSERT macro, not in a specific line.
Is there any idea for this?
Thank you!
Hi Ren Hao Chen,
Sorry for my delay!
Have you try to use Watchpoint with Condition to find out the issue?
for example: (ftmStateStruct).ftmMode==FTM_MODE_NOT_INITIALIZED
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------