cancel
Showing results for 
Search instead for 
Did you mean: 

MCO pin showing 24 MHz instead of 48 MHz while debugging

fxrb
Associate

I use the MCO pin to test my clock configuration on a STM32F072RBT6 board. While I'm debugging with a ST-Link/V2 adapter the MCO output shows 24 MHz instead of the expected 48 MHz.

Using the exact same software (no changes in clock configuration) and rebooting the board without debugging shows the correct 48 MHz signal on the MCO pin.

I have found no indication about debugging being possible only up to 24 MHz, hence I must be doing something wrong. Any idea?

many thanks and kind regards, Felix

2 REPLIES 2

I guess I'd dump the related registers. Probably not the ST-LINK specifically, but the debugger driving it, may configure internal settings to suit it's needs.

Tools being used are not mentioned.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
fxrb
Associate

I use System Workbench for STM32. My problem is caused by the target not getting automatically reset after download.

Using Run -> Debug downloads the code and correctly waits at main() or an earlier breakpoint, if any. However the target is never reset as the registers still show the values from the "last run". When I then additionally use Run -> Reset, everything is working as expected since the registers now have their default values.

What I would like is the target to automatically reset every time I connect and download code. Just in case, the contents of the configuration script:

# This is an genericBoard board with a single STM32F072RBTx chip
#
# Generated by System Workbench for STM32
# Take care that such file, as generated, may be overridden without any early notice. Please have a look to debug launch configuration setup(s)
 
source [find interface/stlink.cfg]
 
set WORKAREASIZE 0x4000
 
transport select "hla_swd"
 
set CHIPNAME STM32F072RBTx
set BOARDNAME genericBoard
 
# CHIPNAMES state
set CHIPNAME_CPU0_ACTIVATED 1
 
# Enable debug when in low power modes
set ENABLE_LOW_POWER 1
 
# Stop Watchdog counters when halt
set STOP_WATCHDOG 1
 
# STlink Debug clock frequency
set CLOCK_FREQ 4000
 
# use hardware reset, connect under reset
# connect_assert_srst needed if low power mode application running (WFI...)
reset_config srst_only srst_nogate connect_assert_srst
set CONNECT_UNDER_RESET 1
 
# BCTM CPU variables
 
source [find target/stm32f0x.cfg]

I have tried different "Reset Modes" without success (don't think that this is right knob to turn).

Please let me know if I'm in the wrong forum. Probably it is better to look for an answer in the forum of the System Workbench for STM32?