cancel
Showing results for 
Search instead for 
Did you mean: 

NUCLEO-F207ZG (STM32F207ZGT6U) CAN Tx Timeout bugs?

andrew_henseleit
Associate II

I've seen this in other forum questions and it seems to always be fixed on the Cube side of things, does anyone have experience in this? I've migrated working code from an old STM3210C-Eval and i've also tried starting fresh. I get no signals whatsoever from the Tx on this board. The debugger takes me to the timeout portion of code so i've narrowed it down to there.

3 REPLIES 3
Imen.D
ST Employee

Hello,

Please provide more details on your issue.

Which version of HAL firmware package are you using?

Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Imen.D
ST Employee

Hello,

Please note that HAL CAN driver will be fully reworked with new APIs in the next release STM32CubeF2 V1.8.0 (planned in few weeks), to bypass limitations on CAN Tx/Rx FIFO management present with presently HAL CAN driver version.

Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
andrew_henseleit
Associate II

Im using the Cube IDE which targets V1.7 (whatever is up to date).

Initialization code:

hcan1.pTxMsg=&TxHeader;

hcan1.pRxMsg=&RxHeader;

 /* USER CODE END CAN1_Init 1 */

 hcan1.Instance = CAN1;

 hcan1.Init.Prescaler = 15;

 hcan1.Init.Mode = CAN_MODE_NORMAL;

 hcan1.Init.SJW = CAN_SJW_1TQ;

 hcan1.Init.BS1 = CAN_BS1_13TQ;

 hcan1.Init.BS2 = CAN_BS2_2TQ;

 hcan1.Init.TTCM = DISABLE;

 hcan1.Init.ABOM = DISABLE;

 hcan1.Init.AWUM = DISABLE;

 hcan1.Init.NART = DISABLE;

 hcan1.Init.RFLM = DISABLE;

 hcan1.Init.TXFP = DISABLE;

 if (HAL_CAN_Init(&hcan1) != HAL_OK)

 {

  Error_Handler();

 }

 hcan1.pTxMsg->StdId=0x321;

    hcan1.pTxMsg->RTR=CAN_RTR_DATA;

    hcan1.pTxMsg->IDE=CAN_ID_STD;

    hcan1.pTxMsg->DLC=2;

Transmit Function

 hcan1.pTxMsg->Data[0]=0x01;

   hcan1.pTxMsg->Data[1]=0x02;

   if(HAL_CAN_Transmit(&hcan1, 10) != HAL_OK)

       {

        /* Transmission Error */

     sprintf(buffer,"Transmit Error!\r\n");

   drew_print(buffer);

        Error_Handler();

       }

       HAL_Delay(10);