2016-05-18 03:35 PM
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 #bxcan2016-05-18 03:51 PM
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.