STM32G4 FW 1.5.2 FDCan Error/Bug?
Hi guys
I've upgraded from 1.5.1 to 1.5.2 and I'm receiving HardFaults when using FDCAN
\STM32Cube\Repository\STM32Cube_FW_G4_V1.5.1\Drivers\STM32G4xx_HAL_Driver\Src\stm32g4xx_hal_fdcan.c
FW 1.5.1 Line: 3493
/* Write Tx payload to the message RAM */
for (ByteCounter = 0; ByteCounter < DLCtoBytes[pTxHeader->DataLength >> 16U]; ByteCounter += 4U)
{
*TxAddress = (((uint32_t)pTxData[ByteCounter + 3U] << 24U) |
((uint32_t)pTxData[ByteCounter + 2U] << 16U) |
((uint32_t)pTxData[ByteCounter + 1U] << 8U) |
(uint32_t)pTxData[ByteCounter]);
TxAddress++;
}
FW 1.5.2 Line: 3523
/* Write Tx payload to the message RAM */
for (ByteCounter = 0; ByteCounter < DLCtoBytes[pTxHeader->DataLength]; ByteCounter += 4U)
{
*TxAddress = (((uint32_t)pTxData[ByteCounter + 3U] << 24U) |
((uint32_t)pTxData[ByteCounter + 2U] << 16U) |
((uint32_t)pTxData[ByteCounter + 1U] << 8U) |
(uint32_t)pTxData[ByteCounter]);
TxAddress++;
}
I've not investigated much time but it looks like to me that the DataLength Code is not correctly shifted?
This results access in the DLCtoBytes[16] with an index far beyond 16?
I'm reverting back to 1.5.1 for the moment.
Cheers
Franco
