Hello,
I am looking into can.h file that is in can_fd.loopback example. _can_flags status can be seen by calling CAN_GetStatusFlags(CAN_Type *base) function but there is no info how to reach _can_error_flags registers. How can I do it ? Which function should be used ?
Thanks and Regards.
Anıl Onur.
Hi Anil Onur Canbaz,
Please check the user manual protocol status register:
You can find bit2:0 is just your _can_error_flags, so when you use the CAN_GetStatusFlags
__STATIC_INLINE uint32_t CAN_GetStatusFlags(CAN_Type *base)
{
return base->PSR;
}
get the PSR register, you can check bit2:0 is which one, then you can know which error happens.
There no API about it, because it is very simple, you can write the code by yourself to check it.
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Kerry,
Thanks for comment.
I could not reach the correct value of controller directly from these registers. As you can see from the log file, CAN-FD frame has been transmitting from the card but can_status_act shows that the node is 'idle' status. Apart from this, I noticed err_can_error_flag (LEC) does not show 'Ack Error' state for other use-case. I am happy to hear some comments about this behavior. You can see how I configured the mask configuration in below.
Thanks and Regards.
Hi, i have try the CAN-FD demo, but error frames occured; Can you send your demo to me for test? I see your data log is correctly, Thanks!
My Email: 08-meng@163.com
Hi Anil Onur Canbaz,
You can remove your another CAN node, then debug your LPC54618 CAN code, and check the PSR register directly, check whether the LEC have the error code, it should have the error code, please test it again.
Any updated information, please kindly let me know.
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Kerry,
I had a chance to test CAN-FD node in alone condition. I noticed that when you test the CAN-FD node in alone, 'can_status_act' counter works. LEC register always shows 0x07 value, however I am waiting 'ACK' error since transmitting node is alone ECU in line.
Another question why 'can_status_act' register does not work in full communication with other CAN-FD nodes.
I am avaliable for further analyze proposal.
Regards.
Onur.