cancel
Showing results for 
Search instead for 
Did you mean: 

Stm3210C- Eval CAN1 not working (Hard Fault)

ASing.11
Associate II

I have been wanting to use Hal_CAN library and everytime I use HAL_CAN_AddTxMessage using cube IDE I get an Hard fault. So if anyone has a good CAN bus transmission and recieve Example that would be really helpful.

5 REPLIES 5

Look at what's actually faulting. Hard Faults are most likely due to bad memory addresses or invalid casts.

Show the code, it might be simpler. There are surely CAN examples under the CubeF1 trees for the board in question..

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
ASing.11
Associate II

I Did check under stm32F1 cube repo and there are no specific CAN examples to be loaded onto cube IDE

Hello @ASing.1​ ,

There is no example projects in STM32CubeIDE formats within STM32CubeF1, but in this case you can use the import/convert feature from SW4STM32 or TrueSTUDIO project to STM32CubeIDE following the available document

  • UM2579 Migration guide from System Workbench to STM32CubeIDE", that helps you on how to import your SW4STM32 project to STM32CubeIDE. 
  • UM2578 Migration guide from TrueSTUDIO® to STM32CubeIDE, explaining how to import projects from TrueSTUDIO to STM32CubeIDE.

Hope this helps you.

Imen

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

Well I got the CAN TX to work but I am trouble receiving messages, By using this function :

 HAL_CAN_GetRxMessage(&hcan1, CAN_RX_FIFO0, &Rxcan, Rxdata);

Hi @ASing.1​ ,

Sorry for this delay to answer you!

Did you solve your problem ?

Imen

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