Two FDCAN interfaces on STM32H7 Topic is solved

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
dynfer
Posts: 14
Joined: Sun Aug 25, 2024 6:11 pm
Has thanked: 2 times
Been thanked: 5 times

Two FDCAN interfaces on STM32H7

Post 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
User avatar
Edoardo1982
Posts: 24
Joined: Thu Aug 03, 2017 8:39 am
Has thanked: 10 times
Been thanked: 20 times

Re: Two FDCAN interfaces on STM32H7

Post 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.x

Unfortunately, I haven’t had the opportunity to specifically test on the H743, only on the H750 and H735.

Edoardo
dynfer
Posts: 14
Joined: Sun Aug 25, 2024 6:11 pm
Has thanked: 2 times
Been thanked: 5 times

Re: Two FDCAN interfaces on STM32H7

Post 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.
Post Reply