I don't know how to "prove" that there is a potential bug with MQX_MONITOR_STACK except to describe my test case.
I have a MK22FN256VLL12 that drives 2 H-bridges via the MK22's PWM output. I am using the PWM function FTM_DRV_PwmStart() in the KSDK.
Regardless of what I set for the PWM duty cycle, the PWM output of the MK22 is just logic low, only when I have MQX_MONITOR_STACK in my preprocessor settings. If I remove it, the PWM driver works as expected.
I have read that all this does is write the "stak" watermark in the remaining stack space, and it looks like this is done here in dispatch.S:
I've also read that MQX_KERNEL_LOGGING has to be added to enable the _klog* functions, but I have verified that kernel logging is NOT enabled, so I'm having trouble seeing how filling the stack would cause the KSDK PWM function to stop working.
Has anyone else here experienced this? Can anyone at FSL test out what I am describing to see if you can reproduce it? It is reproducible on all of our PCBs.
Just bumping this question again, since the problem has also surfaced on another project that is using a MK22 as well. Same problem, PWM does not work if MQX_MONITOR_STACK is enabled.
Hi Dave:
Do you have a project for us to reproduce your issue with FrdmK22 board?
Regards
Daniel
I'm new to ARM assembly (and most assembly, actually), but I did go through the ARM instruction manual and decoded the assembly listing line by line. It totally checks out fine, so I don't understand how this problem could have occurred, unless the task stack is somehow able to occupy the same space as the KSDK code.