2019-05-10 02:19 AM
Hello
I have configured my STM32F446RE MCU as master mode for CAN communication using STM32CUBEMX version 5.1.0 ..I have generated the code in uVision5-Keil .I'm not able to change the function--static void MX_CAN1_Init(void) where i need to include the following lines...
hcan1.pTxMsg=&myTxmessage;
hcan1.pRxMsg=&myRxmessage;
As shown in below figure, pTxMsg and pRxMsg doesn't show up in the list.After being typed it shows error while compiling .
So any help will be welcomed.
2019-05-11 01:23 AM
I don't think CAN_HandleTypeDef has such fields.
2019-05-14 02:28 AM
Thank you!...but when i build my code ,it is showing the following error,
I have changed the MANAGE PROJECT TO USE GCC COMPILER (GNU) FOR ARM PROJECTS .Should I need to download any firmwares or drives such things?Any suggestions are welcomed.
2019-05-15 09:11 AM
Do you have that compiler? And if, does your IDE know where it is?
2019-05-16 03:27 AM
Yes! I have downloaded it from --> https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads
But I am not able to check if the IDE recognizes it .Do i need to place the downloaded (GNU) folder in same location as IDE folder.What should i do now ?
Thanks in advance !
2019-05-19 11:29 PM
Can anyone help this out?
2019-05-20 10:49 AM
I have never used Keil (I think). But when it comes to the messages, you need to define your own variables and give them as parameters to the sending function and receiving callback.
HAL_StatusTypeDef HAL_CAN_AddTxMessage(CAN_HandleTypeDef *hcan, CAN_TxHeaderTypeDef *pHeader, uint8_t aData[], uint32_t *pTxMailbox);
HAL_StatusTypeDef HAL_CAN_GetRxMessage(CAN_HandleTypeDef *hcan, uint32_t RxFifo, CAN_RxHeaderTypeDef *pHeader, uint8_t aData[]);
called from these:
void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_RxFifo0FullCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_RxFifo1MsgPendingCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_RxFifo1FullCallback(CAN_HandleTypeDef *hcan);
2019-05-20 10:51 AM
You probably have some toolchain selection menu buried in the menus of the IDE.
In eclipse-derivatives, it's usually in project properties.