Nh0SF7W

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • Nh0SF7W
    Participant

    Hey,

    I ran into these issues as well using the STM32F4 discovery board. The thing that was really odd for me was that an example from the STM32CubeIDE would work from the STM32CubeIDE but not in VisualGDB even though both were using OpenOCD. I discovered the STM32CubeIDE had a slightly different configuration for the OpenOCD file.

     

    $_TARGETNAME configure -event reset-init {
    global _CLOCK_FREQ

    echo "configuring PLL"
    # Configure PLL to boost clock to HSI x 8 (64 MHz)
    mww 0x40023800 0x00008a81 ;# RCC_CR = HSICAL[bogus = 138] | HSITRIM[16] | HSION (reset value)
    mww 0x40023808 0x00000000 ;# RCC_CFGR = (all = div1), select HSI as main clock source. (reset value)
    mww 0x4002380c 0x00000000 ;# RCC_CIR = 0, all off. (reset value)
    mww 0x40023804 0x24403010 ;# RCC_PLLCFGR = PLLQ[div4] | PLLSRC[HSI] | PLLP[div2] | PLLN[mul192] | PLLM[div16] (reset value)
    mww 0x40023c00 0x00000103 ;# FLASH_ACR = PRFTEN | LATENCY[2] (we'll run at 84 MHz, see section 3.5.1, table 10 and table 11)
    mww 0x40023800 0x01008a81 ;# RCC_CR = PLLON | HSICAL[bogus = 138] | HSITRIM[16] | HSION (enable PLL)
    sleep 10 ;# Wait for PLL to lock
    mww 0x40023808 0x00000002 ;# RCC_CFGR = (all = div1), select PLL as main clock source. (we should now run at 84 MHz)

    adapter speed $_CLOCK_FREQ
    }

    Sincerely,

    Nh0SF7W

    • This reply was modified 2 years, 10 months ago by Nh0SF7W.
Viewing 1 post (of 1 total)