cancel
Showing results for 
Search instead for 
Did you mean: 

Can Example Problem with CubeMX

voyvoda .
Senior
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
1 ACCEPTED SOLUTION

Accepted Solutions
Imen.D
ST Employee
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

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

View solution in original post

4 REPLIES 4
Khouloud GARSI
Lead II
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
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.D
ST Employee
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

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

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.