Skip to main content
Visitor II
May 22, 2019
Question

How to change frequency of ST-Link/V3 SWD in STM32CubeIDE

  • May 22, 2019
  • 3 replies
  • 5673 views

I have problems programming internal flash of an STM32F7 in SWD mode at 24000 KHz with ST-Link/V3. Verification fails. JTAG is ok but it adjusts itself to 21333 KHz. If I use the standalone CubeProg I have an option to reduce the Frequency (even though in big steps 24000->8000??). 24000 fails and 8000 is ok.

Where can I find a similar option in STM32CubeIDE?

    This topic has been closed for replies.

    3 replies

    ST Employee
    May 22, 2019

    The ST-LINK GDB Server will only work with 4000 KHz for now, there's a fix coming for V3 but I'm not sure as to when.

    If you want to use SWD at 24000 KHz then you would need to use the OpenOCD debugger instead.

    Debug coniguration -> Debugger tab -> Debug Probe -> ST-LINK (OpenOCD) -> Show generator options... -> Frequency -> 24 MHz

    Visitor II
    September 23, 2019

    Hi Markus,

    I have the same problem as @hansd56​ . CUBEIDE fails verification. It runs STLINKV3 at 24MHz.

    I tried CUBE Programmer at 24000 and it failed also. I then changed it to 8000 and it works fine.

    However I cannot slow the clock in CUDBEIDE ?

    When is this going to be fixed ?

    I am already suffering many problems due to CUBEIDE/TouchGFx integration problems.!!!

    hansd56Author
    Visitor II
    May 22, 2019

    Hi Markus, not sure what you are saying. Look at log from STM32CubeIDE.

    Waiting for debugger connection...

    Debugger connected

         -------------------------------------------------------------------

                          STM32CubeProgrammer v2.1.0                 

         -------------------------------------------------------------------

    Log output file:  C:\Users\hansd\AppData\Local\Temp\STM32CubeProgrammer_a13612.log

    ST-LINK SN : 0038001A3137510439383538

    ST-LINK FW : V3J3M2B3S1

    Voltage    : 3.30V

    SWD freq   : 24000 KHz

    Connect mode: Under Reset

    Reset mode : Hardware reset

    Device ID  : 0x449

    Device name : STM32F74x/STM32F75x

    Flash size : 1 MBytes

    Device type : MCU

    Device CPU : Cortex-M7

    Memory Programming ...

    Opening and parsing file: ST-LINK_GDB_server_a13612.srec

     File         : ST-LINK_GDB_server_a13612.srec

     Size         : 397724 Bytes

     Address      : 0x08000000

    Erasing memory corresponding to segment 0:

    Erasing internal memory sectors [0 5]

    Download in Progress:

    File download complete

    Time elapsed during download operation: 00:00:05.268

    Verifying ...

    Error: Data mismatch found at address 0x08027804 (byte = 0x7B instead of 0x93)

    Error: Download verification failed

    Encountered Error when opening C:\ST\STM32CubeIDE_1.0.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_1.0.0.201904021149\tools\bin\STM32_Programmer_CLI.exe

    Error in STM32CubeProgrammer

    If I do the same with the standalone STM32Cube Programmer I have the option to select a slower frequency and it works. The same option is missing in STM32CubeIDE.

    hansd56Author
    Visitor II
    May 23, 2019

    Hi Markus, Thanks for your reply. I had another go at this. As it looks like OCD allows SWD speed to be set whereas GDB assumes 24000KHz with ST-Link V3. Do you know why it goes from 24000KHz to 8000KHz and nothing in between?