2018-06-30 07:38 AM
I use the cubemx and freertos andSTM32Cube_FW_L1_V1.8.1,use the timer2 as the systick,but run theosKernelStart() function, a hardfault
occurrence
. use the timer3 as the systick,it`s OK.ThenChange back to timer2,it;s okwhat`s wrong?
2018-06-30 01:32 PM
The way you start figuring out what is going on is to have the HardFault_Handler print out some diagnostic information, and look at the instruction, registers and stack at the location of the fault.
Use a USART or SWV to output data, watch and understand what is going on.
2018-06-30 11:39 PM
T
hanks, stand-alone run it`s ok,but connect the jtag go to the hardfault......................
2018-07-01 05:09 AM
I add a breakpoint in the code,when run the osDelay() function?goto hardfault.
2018-07-01 10:21 AM
Ok, but you&39re going to have to step into the code, and identify the instruction (assembler), not the function, that is faulting.
Likely related to the task swap, so either the stack, or task.
Get a proper HardFault handler implemented so you can reference the failure in a listing file.
https://community.st.com/0D50X00009XkdruSAB