Why does FLEXCAN_DRV_GetReceiveStatus() continously give me kStatus_FLEXCAN_RxBusy?

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

Why does FLEXCAN_DRV_GetReceiveStatus() continously give me kStatus_FLEXCAN_RxBusy?

ソリューションへジャンプ
941件の閲覧回数
stdcerr
Contributor IV

Hi,

 

I have a tilt sensor with a CAN interface. It continously sends out data at 250 kbit/s which I can observe with an analyzer that I have connected to the bus as well. The plan is, the receive the CAN data with my K64. I have followed https://www.nxp.com/docs/en/application-note/AN1798.pdf as best as I could to calculate the timings:

  • CLOCK_SYS_GetFlexcanFreq() tells me that my CAN system clock frequency is 14,400,000 (14.4MHz).
  • The cable length is irrelevant (4m)
  • And there's a 12MHz oscillator on my board

I've been trying to follow to example at KSDK_1.3.0/examples/twrk64f120m/driver_examples/flexcan/flexcan_network/main.c and with the above information, I came up with the following timing parameters:

 

 

 

flexcan_time_segment_t bit_rate_table_14_4Mhz[] = {
		{ 1, 7, 3, 1, 1},
};

 

 

 

 and I have considerable doubt, that these values are correct. I was unable to find all the information required in the datasheets for my sensor ENG_SS_G-NSDOG2-200_207 Inclinometer A4

I set my config up like:

 

 

 

		flexcan1_data.max_num_mb = 16;
		flexcan1_data.num_id_filters = kFlexCanRxFifoIDFilters_8;
		flexcan1_data.is_rx_fifo_needed = false;
		flexcan1_data.flexcanMode = kFlexCanNormalMode;

 

 

 

and set the global mask to 0x7ff:

 

 

 

result = FLEXCAN_DRV_SetRxMbGlobalMask(flexcanInstance, kFlexCanMsgIdStd, 0x7ff);

 

 

 

 which I don't think is related as whenever I call:

 

 

 

RxStatus = FLEXCAN_DRV_GetReceiveStatus(flexcanInstance);

 

 

 

 RxStatus is set to 7 (kStatus_FLEXCAN_RxBusy), even when the sensor is not sending anything (is powered off). Can anybody point me in the right direction as to what I might be missing?

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
926件の閲覧回数
Alexis_A
NXP TechSupport
NXP TechSupport

Hello @stdcerr,

First of all, I will suggest changing to the new SDK using MCUXPresso. The KSDK is a little old and is not updated anymore. Also, the example in the SDK configures the baud rate and you don't have to calculate each parameter.

Best Regards,

Alexis Andalon

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
927件の閲覧回数
Alexis_A
NXP TechSupport
NXP TechSupport

Hello @stdcerr,

First of all, I will suggest changing to the new SDK using MCUXPresso. The KSDK is a little old and is not updated anymore. Also, the example in the SDK configures the baud rate and you don't have to calculate each parameter.

Best Regards,

Alexis Andalon

0 件の賞賛
返信
894件の閲覧回数
stdcerr
Contributor IV

After upgrading the SDK and IDE, I'm at pretty much the same point right now, please see: https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-status-set-to-kStatus-FLEXCAN-UnHandled...

0 件の賞賛
返信
917件の閲覧回数
stdcerr
Contributor IV

old link deleted

0 件の賞賛
返信