Skip to main content
ASing.11
Associate
October 23, 2020
Question

Stm3210C- Eval CAN1 not working (Hard Fault)

  • October 23, 2020
  • 5 replies
  • 1708 views

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.

This topic has been closed for replies.

5 replies

Tesla DeLorean
Guru
October 23, 2020

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
ASing.11
ASing.11Author
Associate
October 24, 2020

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

ST Technical Moderator
October 26, 2020

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

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
ASing.11
ASing.11Author
Associate
October 26, 2020

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);