Why does FLEXCAN_DRV_GetReceiveStatus() continously give me kStatus_FLEXCAN_RxBusy?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Why does FLEXCAN_DRV_GetReceiveStatus() continously give me kStatus_FLEXCAN_RxBusy?

Jump to solution
1,245 Views
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?

Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
1,230 Views
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

View solution in original post

0 Kudos
Reply
3 Replies
1,231 Views
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 Kudos
Reply
1,198 Views
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 Kudos
Reply
1,221 Views
stdcerr
Contributor IV

old link deleted

0 Kudos
Reply