Hello everyone
I have 8 servos in PWM channels of KL25Z that i want to control via serial from my Visual Studio solution.
I'm using UART1 to receive data and update the tpm period that control the servos.
My problem is that i get a HardFault when i call the UpdateServo function from the UART1 IRQHandler.
I thinking it's happening because i'm calling it from the interrupt handler.
Any idea how i can fix this problem?
MCUXpresso project are attached.
Thanks for your help
Original Attachment has been moved to: BipedRobot.zip
已解决! 转到解答。
Hi
Please refer the method description in 'Tracking down Hard Faults' first.
And you can also tell me how to appear the Hard Fault. For example: What message need I send to the UART1?
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
I tracked the hard fault. It happens when I call any fls_tpm.h function (TPM_StartTimer(), TPM_UpdateChnlEdgeLevelSelect()...)
You can send the message
85 1 30 40 50 60 70 80 90 100 68
85 -> Header
1 -> Command
30, 40, 50, 60, 70, 80, 90, 100 -> Servo Data
68 -> Xor for byte 0 to byte 9
thanks for your help