cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F072RB nucleo: CAN_handle issue

luca239955
Associate
Posted on May 19, 2016 at 00:35

I'm working with a STM32F072RB, a Nucleo64 series board.

I'm developing CAN communication and I've some issue during the initialization of the ''CAN handle''. I use CUBE MX and stm32cubef0 libraries for the initialization of all the peripherals.

Once I try to init the CAN id on the handle structure with: ''hcan.pTxMsg->StdId = 0x001;'' (the only instruction I've added to the FW build by CUBEMX) the fw goes to the HardFault_Handler.

The initialization was done by the CUBE MX functions. There are no examples for the STM32F072 board and I follow the example for the EVAL board using the same micro-controller.

How can I fix this issue? Any idea?

Thanks in advance!

#stm32f0 #cubemx #bxcan
1 REPLY 1
Posted on May 19, 2016 at 00:51

hcan.pTxMsg is a pointer, make sure it isn't NULL or bogus before using it.

Failing that get the Hard Fault Handler to actually identify the offending instructions and registers. A while(1) loop is useless, look for Joseph Yiu's examples.

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