Page 1 of 1
Two FDCAN interfaces on STM32H7
Posted: Tue May 13, 2025 8:04 pm
by dynfer
Hello,
I've been scrathing my head to get two fdcan interfaces working simultaneously, from what I've gathered the problem lays in the fact that both interfaces share the same memory area. I've tried spliting them into two 1280 word area's but this doesn't seems to solve the issue.
Any help would be apreciated from someone who got it working.
STM32H743IIT6
ChibiOS ver. -> Current Master branch
Re: Two FDCAN interfaces on STM32H7
Posted: Wed May 14, 2025 9:46 am
by Edoardo1982
dynfer wrote:Hello,
I've been scrathing my head to get two fdcan interfaces working simultaneously, from what I've gathered the problem lays in the fact that both interfaces share the same memory area. I've tried spliting them into two 1280 word area's but this doesn't seems to solve the issue.
Any help would be apreciated from someone who got it working.
STM32H743IIT6
ChibiOS ver. -> Current Master branch
Hi,
with the latest changes it’s possible to use more than one CAN instance concurrently. In the FDCANv2 driver for the H743, the memory area is partitioned based on how many instances are used.
Code: Select all
#if defined(STM32H743xx) || defined(STM32H753xx) || \
defined(STM32H745xx) || defined(STM32H755xx) || \
defined(STM32H747xx) || defined(STM32H757xx) || \
defined(__DOXYGEN__)
#if (STM32_CAN_USE_FDCAN1 && STM32_CAN_USE_FDCAN2)
#define STM32_FDCAN_FLS_NBR 32U
#define STM32_FDCAN_FLE_NBR 16U
#define STM32_FDCAN_RF0_NBR 16U
#define STM32_FDCAN_RF1_NBR 16U
#define STM32_FDCAN_RB_NBR 16U
#define STM32_FDCAN_TEF_NBR 8U
#define STM32_FDCAN_TB_NBR 16U
#define STM32_FDCAN_TM_NBR 16U
#else
#define STM32_FDCAN_FLS_NBR 64U
#define STM32_FDCAN_FLE_NBR 32U
#define STM32_FDCAN_RF0_NBR 32U
#define STM32_FDCAN_RF1_NBR 32U
#define STM32_FDCAN_RB_NBR 32U
#define STM32_FDCAN_TEF_NBR 16U
#define STM32_FDCAN_TB_NBR 32U
#define STM32_FDCAN_TM_NBR 32U
#endif
#endif /* defined(STM32H743xx) || defined(STM32H753xx) */
Please refer to the CAN demo in testhal for STM32H7xx.
These modifications are present in both the
trunk and the
21.11.xUnfortunately, I haven’t had the opportunity to specifically test on the H743, only on the H750 and H735.
Edoardo
Re: Two FDCAN interfaces on STM32H7
Posted: Thu May 15, 2025 11:31 am
by dynfer
Thank You Edoardo.
The problem was in a old version of ChibiOS in my project. After pulling the latest changes everything works.
I can confirm H743 works fine.