Skip to main content
voyvoda .
Senior
June 4, 2018
Solved

Can Example Problem with CubeMX

  • June 4, 2018
  • 4 replies
  • 2524 views
Posted on June 04, 2018 at 08:04

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;

#stm32-stm32cube #cubemx-4.25.1 #canbus
This topic has been closed for replies.
Best answer by Imen.D
Posted on June 26, 2018 at 12:48

Hello

kavak.engin

Please find in this discssion

https://community.st.com/0D50X00009Xkg2MSAR

,

a new presentation created by

Panecki.Szymon.002

,

which guides you to develop a simple CAN application with new API and how to migrate from old API to new API.

With Regards,

Imen

4 replies

Khouloud GARSI
ST Employee
June 4, 2018
Posted on June 04, 2018 at 09:25

Hi

kavak.engin

‌

Your request is reported to our CubeMX team. One of our experts will answer you ASAP.

Khouloud.

Houda GHABRI
ST Employee
June 7, 2018
Posted on June 07, 2018 at 13:27

Hi

kavak.engin

,

Thanks for your feedback.

Effectively the CAN Driver has changed compared to the lastest version, you can find the new example in STM32CubeF4 1.0 available on ST Web page.

Please feel free to contact me for further details.

Regards,

Houda

Imen.DBest answer
ST Technical Moderator
June 26, 2018
Posted on June 26, 2018 at 12:48

Hello

kavak.engin

Please find in this discssion

https://community.st.com/0D50X00009Xkg2MSAR

,

a new presentation created by

Panecki.Szymon.002

,

which guides you to develop a simple CAN application with new API and how to migrate from old API to new API.

With 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
APath.1
Visitor II
January 16, 2020

Hello,

I am facing the similar issue with STMCubeMX 5.3.0 and firmware version 1.24.2 . There are no pTxMsg and pRxMsg buffers available when I am generating a code through cube. I am using STM32F407 Discovery board. Kindly help.

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.