Skip to main content
andrew_henseleit
Associate II
May 30, 2019
Question

NUCLEO-F207ZG (STM32F207ZGT6U) CAN Tx Timeout bugs?

  • May 30, 2019
  • 3 replies
  • 632 views

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.

This topic has been closed for replies.

3 replies

Technical Moderator
May 31, 2019

Hello,

Please provide more details on your issue.

Which version of HAL firmware package are you using?

Regards,

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Technical Moderator
May 31, 2019

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

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
andrew_henseleit
Associate II
May 31, 2019

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);