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:
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?
已解决! 转到解答。
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
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
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...