KL25Z UART updating tpm period

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

KL25Z UART updating tpm period

ソリューションへジャンプ
1,331件の閲覧回数
nicas16
Contributor II

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

ラベル(1)
0 件の賞賛
返信
1 解決策
1,184件の閲覧回数
nicas16
Contributor II

I solved the error \o/

It was in my servo struct. I have 8 servos but only 7 address in my array ... My bad 

Thanks for your help

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
1,185件の閲覧回数
nicas16
Contributor II

I solved the error \o/

It was in my servo struct. I have 8 servos but only 7 address in my array ... My bad 

Thanks for your help

0 件の賞賛
返信
1,184件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

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!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信
1,184件の閲覧回数
nicas16
Contributor II

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

0 件の賞賛
返信