Hello Everyone,
I would like to ask about CAN HAL sending and receiving of data.
Currently I'm using CAN HAL sample program from Hilscher.
I have used the sample program without any modification,
so the CAN baud rate of NETX would be 1Mbps.
I have connected the UART pins to the serial port and
the Tantino JTAG to my PC.
I have also used a CAN analyzer and connected it to the CAN port Channel 3.
My problem is that when I ran the program, and send data to CAN port Channel 3
using my CAN analyzer, the serial output is shown below:
port 00000003 stats: ulTxErrCnt : 00000000 ulRxErrCnt : 00000088 ulTxFrameSucceed : 00000000 ulTxErrorSummary : 00000000 ulArbitrationLost : 00000000 ulConDroppedDueFifoFull : 00000000 ulRxFrameSucceed : 00000000 ulRxErrorSummary : 00009EE6 ulIndHiDroppedDueFifoFull: 00000000 ulIndLoDroppedDueFifoFull: 00000000 ulRxStdFramesFiltered : 00000000 ulRxExtFramesFiltered : 00000000 ulRxStdFramesPassed : 00000000 ulRxExtFramesPassed : 00000000 ulRxStdFramesHiDetected : 00000000 ulRxExtFramesHiDetected : 00000000 ulStatus : 00000006
Why does the sample program do not respond when CAN analyzer sends data?
Also when I try to send data using the following code: (every 2 seconds)
Can_SendFrame(CAN_CHANNEL_NUMBER, &tFrame, 1, 1, 0); /* low prio, unlimited retries, confirmed */
the sample code does not send data to the CAN bus and the serial output
shows as seen below:
port 00000003 stats: ulTxErrCnt : 000000C0 ulRxErrCnt : 00000000 ulTxFrameSucceed : 00000000 ulTxErrorSummary : 00000008 ulArbitrationLost : 00000000 ulConDroppedDueFifoFull : 00000000 ulRxFrameSucceed : 00000000 ulRxErrorSummary : 00000000 ulIndHiDroppedDueFifoFull: 00000000 ulIndLoDroppedDueFifoFull: 00000000 ulRxStdFramesFiltered : 00000000 ulRxExtFramesFiltered : 00000000 ulRxStdFramesPassed : 00000000 ulRxExtFramesPassed : 00000000 ulRxStdFramesHiDetected : 00000000 ulRxExtFramesHiDetected : 00000000 ulStatus : 00000006
Why does might have caused the above scenario?
Thank you very much in advance.
Regards,
M T
Hilscher Gesellschaft für Systemautomation mbH
As you can see the XPEC indicates reception errors (RxErrCnt, also called REC). There seems to be something wrong with your CAN bus. Probably wrong hardware settings etc.
Same here. The bus seems to be broken. As you can see TxErrCnt (TEC, transmit error counter) is incremented. First of all check your cables, HW connection, etc.
Regards
MT