AnsweredAssumed Answered

Can Example Problem with CubeMX

Question asked by voyvoda . on Jun 4, 2018
Latest reply on Jun 7, 2018 by houda ghabri

Hello,

 

       I am trying to implement a canbus example. I was used can example with no problem in the CubeMX Version 4.24. Now, I have updated the CubeMX to version 4.25.1. Can exampel is not working now. There are some changes between version. Can someone explain me Why ?

 

       In the newer version there is no pTxMsg and pRxMsg buffers. How can I send and receive data via newer version of the CubeMx.

 

      Is there an example for the newer version of the CubeMx ?

      

 

 

 

NEW

typedef struct __CAN_HandleTypeDef
{
CAN_TypeDef *Instance; /*!< Register base address */

CAN_InitTypeDef Init; /*!< CAN required parameters */

__IO HAL_CAN_StateTypeDef State; /*!< CAN communication state */

__IO uint32_t ErrorCode; /*!< CAN Error code.
This parameter can be a value of @ref CAN_Error_Code */

} CAN_HandleTypeDef;

 

OLD

typedef struct
{
CAN_TypeDef *Instance; /*!< Register base address */

CAN_InitTypeDef Init; /*!< CAN required parameters */

CanTxMsgTypeDef* pTxMsg; /*!< Pointer to transmit structure */

CanRxMsgTypeDef* pRxMsg; /*!< Pointer to reception structure for RX FIFO0 msg */

CanRxMsgTypeDef* pRx1Msg; /*!< Pointer to reception structure for RX FIFO1 msg */

__IO HAL_CAN_StateTypeDef State; /*!< CAN communication state */

HAL_LockTypeDef Lock; /*!< CAN locking object */

__IO uint32_t ErrorCode; /*!< CAN Error code */

}CAN_HandleTypeDef;

 

Outcomes