FreescaleCAN "CAN_SendFrame()"

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

FreescaleCAN "CAN_SendFrame()"

ソリューションへジャンプ
1,038件の閲覧回数
spojoe
Contributor I

Hello,

i´m using the MC56F8367 and the CW for MCU v10.3.

Everything is working fine, there are just some problems with sending a message using CAN_SendFrame().

When i try to send a frame, the function returns ERR_BUSY and the frame is not transmitted.

I builded a "for{...}" loop arround the send command that cals the function until the CAN-device is not longer busy.

In that way i found out that it needs arrount 10 calls until the device is not busy. After 10 cals the  "IDLE" bit is "1" and the transmission works.

Is there a important thing i forgot before starting a transmission. When is the "IDLE"-bit set by the Hardware?

Thank you for any answer!!!:smileyhappy:

Best Regards

joe

1 解決策
644件の閲覧回数
Petr_H
NXP Employee
NXP Employee

Hi,

The ERR_BUSY is returned until the message is received by the target device. It might be OK that it takes 10 calls...

If you'd like to have information on when the message is successfully sent, you can use the OnFreeTxBuffer event (Events tab in the inspector) that is invoked after some buffer is empty so you don't have to wait till some send ends.

I recommend to enable also the generation of OnError event. This event is invoked in case of errors on the bus and you can use GetError function call inside to get details of the error.

There might be also some conflict or problem on the bus that prevents the message to be sent.

best regards

Petr Hradsky

Processor Expert Support Team

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
645件の閲覧回数
Petr_H
NXP Employee
NXP Employee

Hi,

The ERR_BUSY is returned until the message is received by the target device. It might be OK that it takes 10 calls...

If you'd like to have information on when the message is successfully sent, you can use the OnFreeTxBuffer event (Events tab in the inspector) that is invoked after some buffer is empty so you don't have to wait till some send ends.

I recommend to enable also the generation of OnError event. This event is invoked in case of errors on the bus and you can use GetError function call inside to get details of the error.

There might be also some conflict or problem on the bus that prevents the message to be sent.

best regards

Petr Hradsky

Processor Expert Support Team

0 件の賞賛
返信
644件の閲覧回数
carloshass
Contributor II

Petr Hradsky,

I'm working in a project with CAN, and it's working, but, for some reason, the OnFreeTxBuffer is not invoked.

I tryed with auto-init, and with manual initialization, and did not work.

I'm using KDS 3.0.0, and PE 3.0.1.b150806

FRDM-KE06Z

Regards,

CH

0 件の賞賛
返信