Why does FLEXCAN_DRV_GetReceiveStatus() continously give me kStatus_FLEXCAN_RxBusy?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Why does FLEXCAN_DRV_GetReceiveStatus() continously give me kStatus_FLEXCAN_RxBusy?

跳至解决方案
835 次查看
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 解答
820 次查看
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 回复数
821 次查看
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 项奖励
788 次查看
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 项奖励
811 次查看
stdcerr
Contributor IV

old link deleted

0 项奖励