2025-01-28 09:21 AM - last edited on 2025-01-29 06:32 AM by SofLit
I have debugged the whole code to send data from stm32h750b-dk between the two fdcan terminals fdcan1 and fdcan2 the data is appearing on live expressions of txdata1 but in rxdata only 1 bit is being transferred can somebody mention what the problem could be
all my parameters are adjusted accurately
Txdata[2]={7,8};
this is the output which is shown can somebody help me out on wtt could be done
Solved! Go to Solution.
2025-01-29 06:28 AM
Thank your for the sharing.
You didn't activate the FDCAN2 IRQ:
I'm attaching your project (modified) where FDCAN2 is receiving these two bytes.
This is a screen shot of the debug session, the bytes 7 and 8 are well received with FDCAN2 and a counter counting the number of the reception I've added in the example:
Another thing to add:
In the sending operation you didn't wait for the Tx FIFO to be empty which will cause a send error.
I've added it as the following:
while((hfdcan1.Instance->TXFQS & FDCAN_TXFQS_TFQF) != 0U); // wait for Tx FIFO to be empty
status = HAL_FDCAN_AddMessageToTxFifoQ(&hfdcan1, &TxHeader1, TxData1);
if (status != HAL_OK)
{
Error_Handler();
}
}
Don't forget to fit the jumpers JP6 and JP7 to connect the CAN terminating resistors (120ohm) on the board.
A recommendation before running the example I shared, please update to the latest version of STM32CubeMx V6.13.0.
Hope that helps.
2025-01-28 11:57 AM
Hello @revvathi and welcome to the community,
Not sure I've understood the case.
You said :
@revvathi wrote:
I have debugged the whole code to send data from stm32h750d-bk between the two fdcan terminals fdcan1 and fdcan2
So TxData1 is the buffer sent by FDCAN1 and RxData1 is the data received by FDCAN2?
@revvathi wrote:
the data is appearing on live expressions of txdata1 but in rxdata only 1 bit is being transferred
What do you mean by only "1 bit" is transferred? do you mean 1 byte?
@revvathi wrote:
Txdata[2]={7,8};
Here Txdata (do you mean Txdata1?) contains two bytes 7 and 8 but in the live expression it's showing 0 and 7. That's not clear.
I propose to share your project to look at it closely.
2025-01-29 04:46 AM
yes Txdata1 is from fdcan1 and rxdata1 being recieved from fdcan2
like an array of TxData1={7,8} is being transmitted in my live expressions it only sends '8' to RxData1 and the rest buffer becomes 0 in TxData1 and other becomes 7 so basically Rxdata1 is receiving only 1 byte of 8
2025-01-29 04:57 AM
Hello,
You didn't share your project at least we can check.
2025-01-29 05:08 AM - edited 2025-01-29 05:08 AM
2025-01-29 05:09 AM
Better to share the complete project.
2025-01-29 05:11 AM - edited 2025-01-29 05:14 AM
it isnt supporting the file type
2025-01-29 05:14 AM
Compress your project with .rar or .zip format
2025-01-29 05:15 AM - edited 2025-01-29 05:16 AM
2025-01-29 06:28 AM
Thank your for the sharing.
You didn't activate the FDCAN2 IRQ:
I'm attaching your project (modified) where FDCAN2 is receiving these two bytes.
This is a screen shot of the debug session, the bytes 7 and 8 are well received with FDCAN2 and a counter counting the number of the reception I've added in the example:
Another thing to add:
In the sending operation you didn't wait for the Tx FIFO to be empty which will cause a send error.
I've added it as the following:
while((hfdcan1.Instance->TXFQS & FDCAN_TXFQS_TFQF) != 0U); // wait for Tx FIFO to be empty
status = HAL_FDCAN_AddMessageToTxFifoQ(&hfdcan1, &TxHeader1, TxData1);
if (status != HAL_OK)
{
Error_Handler();
}
}
Don't forget to fit the jumpers JP6 and JP7 to connect the CAN terminating resistors (120ohm) on the board.
A recommendation before running the example I shared, please update to the latest version of STM32CubeMx V6.13.0.
Hope that helps.