2024-06-14 08:33 AM
I am using a Riverdi STM32 Embedded Display RVT50HQSNWC00-B and having issues with the FDCAN bus. I am capable of writing to the TxFifo and can communicate with an external device in external loop back mode and normal mode. In external and Internal Loop Back Mode, nothing is written to the RxFifo. I am trying to use the board as a receiver not a transmitter. Are there any examples of FDCAN Rx communication with an external device using the STM32U5A9NJH6Q chip. When using CubeMX, there isn't any options for setting RxFifo elements in FDCAN configuration. Does this mean this board cannot be used a reciever, and only can transmit.
Solved! Go to Solution.
2024-06-14 11:32 AM - edited 2024-06-14 11:49 AM
Ok. Did you try the example from STM32U575I-EV\Examples\FDCAN\FDCAN_Loopback\ as it is? is it working well?
2024-06-14 09:00 AM
Hello,
Not sure I understood this statement:
and can communicate with an external device in external loop back mode and normal mode. In external and Internal Loop Back Mode, nothing is written to the RxFifo.
You did succeed to communicate with an external device with a loopback mode? How?
You need Normal mode for that. Otherwise you need to clarify that point.
Thank you.
2024-06-14 09:51 AM - edited 2024-06-14 10:58 AM
Ill try to be more clear.
/* Check that the Rx FIFO 0 is not empty */
if ((hfdcan->Instance->RXF0S & FDCAN_RXF0S_F0FL) == 0U)
{
/* Update error code */
hfdcan->ErrorCode |= HAL_FDCAN_ERROR_FIFO_EMPTY;
return HAL_ERROR
I am trying to understand why the RxData is not updating correctly.
CubeMX doesn't allow me to edit any of Rx elements.
2024-06-14 10:28 AM - edited 2024-06-14 10:30 AM
Hello,
In Internal Loopback mode, TxData is not mirrored in RxData.
So if I understood well, even with Loopback mode you didn't succeed to receive messages? in that case drop Normal mode for the moment and let's focus on Loopback mode. Did you configure filters?
CubeMX doesn't allow me to edit any of Rx elements.
I need to check internally why there is no Rx FIFO elements setting in the CubeMx. It's true that U5 doesn't have the same FDCAN implementation as H7 for example but anyway I need to check.
2024-06-14 10:36 AM - edited 2024-06-14 10:58 AM
Yes you have understood correctly. I will focus on Loopback mode. Could this be a version issue with IDE/TouchGFX/CubeMX?
My configuration for filters is this.
sFilterConfig.IdType = FDCAN_STANDARD_ID;
sFilterConfig.FilterIndex = 0;
sFilterConfig.FilterType = FDCAN_FILTER_MASK;
sFilterConfig.FilterConfig = FDCAN_FILTER_TO_RXFIFO0;
sFilterConfig.FilterID1 = 0x123;
sFilterConfig.FilterID2 = 0x555;
if (HAL_FDCAN_ConfigFilter(&hfdcan1, &sFilterConfig) != HAL_OK)
{
/* Filter configuration Error */
Error_Handler();
}
2024-06-14 10:52 AM - edited 2024-06-14 11:19 AM
Hello,
First, please use <\> button to insert your code for the visibility. See also please refer to these tips to post a thread from here.
Second, I suppose you are trying to receive two IDs: 0x123 and 0x555? right? in that case you need to set filter type to FDCAN_FILTER_DUAL:
sFilterConfig.FilterType = FDCAN_FILTER_DUAL;
2024-06-14 11:23 AM
I tried this, yet still same result. The RxData never changes from 0. I have been using the STM32U575I-EV FDCAN Loopback Example as a template for how to get this working. This was found in:
\STM32Cube\Repository\STM32Cube_FW_U5_V1.4.0\Projects\STM32U575I-EV\Examples\FDCAN\FDCAN_Loopback\Src
2024-06-14 11:32 AM - edited 2024-06-14 11:49 AM
Ok. Did you try the example from STM32U575I-EV\Examples\FDCAN\FDCAN_Loopback\ as it is? is it working well?
2024-06-14 12:06 PM
It is working well now with External and Internal Loopback. Thank you. Trying to set the STM32 Embedded Display to receive messages now. I may have questions about that shortly.
2024-06-14 12:11 PM - edited 2024-06-14 12:12 PM
Ok good. So please mark the answer that solved your problem as "Accept as solution".
For any other question I invite you to open a new thread.
Thank you :)