Senior III
May 22, 2023
Question
Bug in HAL STM32C011J6M6 when MCO Output is set.
- May 22, 2023
- 3 replies
- 2508 views
Hello,
I have a very simple project to generate 50/60Hz PWM signal with MCO 3MHz output for other HW. So far my code is just turning on the PWM, everything else is generated by CubeMX. But the MCU falls into HardFault when MCO (Pin 4 PF2-NRST) is set as MCO. I found that HAL_GPIO_Init() causes this HatdFault on line 198 where the GPIO base address is 0x5000 0C00 (Port D). If I correct the address to 0x5000 0000 (Port A) by debugger, everything works fine. Apparently there is an error in the calculation of this base address in the HAL library.
Option byte NRST_MODE = 2
Exported project is attached.
