Hello everyone,
I'm facing a weird issue. When I run my code in the debug mode, everything works properly (CAN, UART and so on).
But when I remove the debugger and reset the board, I can see that the CAN and other peripherals don't work as I expected.
Then, I attached the debugger activating this option:
And I could see that the system reaches the hardfault:
Before, I was facing the same issue (with debugger) and I could find out that the problem was the Interrupt Monitor into the Platform_Init(), when I removed this configuration on Tresos 29.0.0 (disable the INTM), I started to get hardfault in this new point into Mcl_Init(), showed below.
Also, I could see that if I commented out the Mcl_init(), I get hardfault as well in the Uart_Init(), in this point:
Again, using the system in debug mode, it doesn't happened. Can anyone help me with this problem?
I could see some topics related this issue and the people saying that HSE_CLK should be CORE_CLK/2, but it is already configured this way:
Thank you,
MVR
Solved! Go to Solution.
Hi@MVR
I tested your code, you need to use "MCU_SetMode()" to turn on the peripheral clock, this is the reason for entering hardfault
"When I run my code in the debug mode, everything works properly (CAN, UART and so on)."
Most of these problems should be related to the clock configuration.
If you can provide a complete project, I can help you check it.
Sent you via private message due to confidentiality...
But as soon as we fixed this issue, I will post the solution here to help the community.
Thanks.
Hi@MVR
I tested your code, you need to use "MCU_SetMode()" to turn on the peripheral clock, this is the reason for entering hardfault