cancel
Showing results for 
Search instead for 
Did you mean: 

Example Code for FDCAN2 for M33 core of STM32MP257F EV1 board

VChittem
Associate

Hi Team,

I am able to test FDCAN1 on M33 core of STM32MP257F EV1 board, using STM32Cube\Repository\STM32Cube_FW_MP2_V1.1.0\Projects\STM32MP257F-EV1\Examples\FDCAN\FDCAN_Com_IT and PEAK PCAN Usb.

 

However, when I try to change the same code to work for FDCAN2, I couldn't achieve it. as A35 core is going to reset, probably due to wrong call to Resource Manager. Below is the snippet of code used.

 

/* Acquire FDCAN using Resource manager */

if (RESMGR_STATUS_ACCESS_OK == ResMgr_Request(RESMGR_RESOURCE_RIFSC, STM32MP25_RIFSC_FDCAN_ID))

{

/* Enable FDCANx clock */

FDCANx_CLK_ENABLE();

}

 

/* Acquire GPIOJ14 using Resource manager */

if (RESMGR_STATUS_ACCESS_OK != ResMgr_Request(RESMGR_RESOURCE_RIF_GPIOJ, RESMGR_GPIO_PIN(14)))

{

Error_Handler();

}

 

/* Acquire GPIOI12 using Resource manager */

if (RESMGR_STATUS_ACCESS_OK != ResMgr_Request(RESMGR_RESOURCE_RIF_GPIOI, RESMGR_GPIO_PIN(12)))

{

Error_Handler();

}

 

/* Enable GPIOs power supplies */

if (RESMGR_STATUS_ACCESS_OK == ResMgr_Request(RESMGR_RESOURCE_RIF_RCC, RESMGR_RCC_RESOURCE(96)))

{

FDCANx_TX_GPIO_CLK_ENABLE();

FDCANx_RX_GPIO_CLK_ENABLE();

}

 

Below are my observations,

  1. ResMgr_Request(RESMGR_RESOURCE_RIF_RCC, RESMGR_RCC_RESOURCE(96)) is returning ERROR and hence FDCANx_TX_GPIO_CLK_ENABLE(); and FDCANx_RX_GPIO_CLK_ENABLE(); are not being called.
  2. Moving these two APIs FDCANx_TX_GPIO_CLK_ENABLE() and FDCANx_RX_GPIO_CLK_ENABLE() out of if condition is causing A35 go into Panic and cause a reset of the M33 as well.

 

Also, it looks like Ports I12 and J14 are mapped to FDCAN3 on STM32MP2 controller, however on the EV1 board, the CAN channel (CN11) is called FDCAN2. Please clarify if the CN11 DB9 is FDCAN2 or FDCAN3.

 

It would be helpful, if I can get a working M33 code that is tested for FDCAN2 (CN11 DB-9 port) also.

 

Best Regards,

Venkata

 

0 REPLIES 0