stm32h7: reduce the extended filter size to 64

When I checked how this register was set I discovered that 128 was not
accepted by the H7 but 64 was ok. Looking at the STM32Cube's HAL it
seems to be only 64 words long, however, the reference manual claims
otherwise.

I have opened a discussion on the ST community forum
https://community.st.com/s/question/0D73W000001nzqFSAQ
but unfortunately not received an answer yet.

In the meantime, I think, we should update this to what I found to be
working though.

Signed-off-by: Julian Oes <julian@oes.ch>
This commit is contained in:
Julian Oes 2023-02-15 17:14:21 +13:00 committed by Xiang Xiao
parent a59e65db3f
commit 4f30c298bf

View File

@ -2236,9 +2236,22 @@ int fdcan_initialize(struct fdcan_driver_s *priv)
putreg32(regval, priv->base + STM32_FDCAN_SIDFC_OFFSET);
ram_offset += n_stdid;
/* Extended ID Filters: Allow space for 128 filters (128 words) */
/* Extended ID Filters: Allow space for 64 filters (64 words)
* The register definition of FDCAN_XIDFC:LSE - List size extended, in the
* reference manual (RM0433 Rev 8) is defined as 8 bits and claims that a
* value of 0-128 (Number of extended ID filter elements) are possible, but
* in the text in section 56.4.22 and in STM32CubeH7's HAL it's only 64.
*
* HAL source:
* https://github.com/STMicroelectronics/STM32CubeH7/blob/
* 43c9e552ba1c038577c48723d96ca8c825b11987/Drivers/STM32H7xx_HAL_Driver/
* Inc/stm32h7xx_hal_fdcan.h#L112-L113
*
* Discussion:
* https://community.st.com/s/question/0D73W000001nzqFSAQ
*/
const uint8_t n_extid = 128;
const uint8_t n_extid = 64;
priv->message_ram.filt_extid_addr = gl_ram_base + ram_offset * WORD_LENGTH;
regval = (n_extid << FDCAN_XIDFC_LSE_SHIFT) & FDCAN_XIDFC_LSE_MASK;