2021-08-02 07:46 AM
BTW, Errata says nothing about this mess.
Solved! Go to Solution.
2021-08-10 02:32 AM
Hi Stanislav Silnicki ,
I tried now to set MCO output on PG10 pin and it works correctly (I used CubeMX for code generation). But the condition is that there must be reprogrammed option bits NRST_MODE = 2 (GPIO mode). Then the PG10 pin works as GPIO and there can be enabled MCO function.
As side effect I have found one mistake in HAL function "HAL_RCC_MCOConfig". This function configures always PA8 as MCO output - so the PG10 pin must be configured in "main" function as MCO alternate function (which CubeMX codes correctly). This mistake in "HAL_RCC_MCOConfig" function will be reported (to be corrected). Mistake causes that MCO output will be on both PA8 and PG10 pins.
Please reprogram option bits NRST_MODE to value 2 (for example in STM32CubeProgrammer) and try the code generated by CubeMX again. And please make sure that on PG10 pin is no capacitor connected - because PG10 works usually as NRST and usually is there 100nF capacitor at NRST pin.
Regards
Igor
2021-08-02 08:04 AM
Just a bug/missing functionality. It looks like the generated code will set both PG10 and PA8 to output MCO in this case.
Note that you'll need to set NRST_MODE appropriately unless you want MCO to reset your chip immediately. And reassigning the NRST pin provides opportunities for bricking the chip.
2021-08-02 08:46 AM
Disabling NRST function for the PG10 pin in FLASH_OPTR doesn't help. While reset function is disabled, and pin assigned to GPIO, MCO doesn't appear at all....
Its is so frustrating.... we spent a lot for design and now we eat this. :(
2021-08-02 08:49 AM
2021-08-02 09:22 AM
I have rearranged the code to init PG10 as MCO, enabling GPIOG clocks as well. And no result at all. PG10 just keeps high. The other pin (PA8) functions well for MCO.
2021-08-10 02:32 AM
Hi Stanislav Silnicki ,
I tried now to set MCO output on PG10 pin and it works correctly (I used CubeMX for code generation). But the condition is that there must be reprogrammed option bits NRST_MODE = 2 (GPIO mode). Then the PG10 pin works as GPIO and there can be enabled MCO function.
As side effect I have found one mistake in HAL function "HAL_RCC_MCOConfig". This function configures always PA8 as MCO output - so the PG10 pin must be configured in "main" function as MCO alternate function (which CubeMX codes correctly). This mistake in "HAL_RCC_MCOConfig" function will be reported (to be corrected). Mistake causes that MCO output will be on both PA8 and PG10 pins.
Please reprogram option bits NRST_MODE to value 2 (for example in STM32CubeProgrammer) and try the code generated by CubeMX again. And please make sure that on PG10 pin is no capacitor connected - because PG10 works usually as NRST and usually is there 100nF capacitor at NRST pin.
Regards
Igor