Closed cstyx closed 2 weeks ago
Hi @cstyx,
Thank you for this report too. please refer to my other comment. The two issues may be related.
With regards,
Hi @ALABSTM,
as mentioned the content of the FDCAN_RxHeaderTypeDef property data_length as provided by HAL_FDCAN_GetRxMessage() is always 0x0000.
Regards
Hello @cstyx,
Could you please share more details, like screenshots of FDCAN_RxHeaderTypeDef
when the problem occurs.
In my tests with your project, the data_length property consistently shows a value other than 0.
with regards
Hi @KRASTM
I attached a screen shots of the H723 sender. First is the tx_header and p_can_data as given to function HAL_FDCAN_AddMessageToTxFifoQ(p_hcan, &tx_header, p_can_data)
containing 4 Bytes of data as indicated by DLC = 4
th second one is the same message measured on the CAN BUS but the DLC seems to be 0 and data is already missing
Hi @KRASTM
I think I found the error at FW_H7 V1.11.1 file stm32h7xx_hal_fdcan.c in function
static void FDCAN_CopyMessageToRAM(FDCAN_HandleTypeDef *hfdcan, FDCAN_TxHeaderTypeDef *pTxHeader, uint8_t *pTxData, uint32_t BufferIndex)
at code line
for (ByteCounter = 0; ByteCounter < DLCtoBytes[pTxHeader->DataLength >> 16]; ByteCounter += 4U)
For CAN classic and CANFD the DLC for 4 bytes is "4" but this line shifts it 16 bit to the right so it will be always 0. The following for loop won't be entered and no data will be copied at all. Only TxElementW2 still holds the right data length of "4" but that doesn't seem to matter.
Hello @cstyx,
I don't understand, at first, you mentioned that you used FW_H7 V1.11.2, and now you suspect an error in FW_H7 V1.11.1!
Since the actual version of the FW_H7 is V1.11.2, and there were some updates related to FDCAN, include that line of code. So, I recommend you, to use the last version.
Thank you for your contribution, please allow me to close this thread.
with regards,
Describe the set-up
Describe the bug
How To Reproduce