cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f405 not running

Angelo1
Associate II
Posted on March 14, 2014 at 00:33

Dear all,

i am trying some initial code on a

stm32f405 that i could finally program.

First thing i was wandering is if i can run (for test) straight with the internal HSI 16Mhz.

Init code is from std stm32 library.

I try to debug with a square wave, but i don't see nothing with scope still.

void gpio_init ()

{

        GPIO_InitTypeDef io = {0};

        //

        // Initialise RCC (reset and clock control) to set clock to

        // the peripheral (port A).

        //

        RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);

        io.GPIO_Pin = GPIO_Pin_4;

        io.GPIO_Mode = GPIO_Mode_OUT;

        io.GPIO_Speed = GPIO_Speed_25MHz;

        io.GPIO_OType = GPIO_OType_PP;

    io.GPIO_PuPd = GPIO_PuPd_NOPULL;

        GPIO_Init(GPIOA, &io);

        while (1)

        {

                GPIOA->BSRRL = GPIO_Pin_4;

                GPIOA->BSRRH = GPIO_Pin_4;

        }

}

every help is appreciated.
1 REPLY 1
Posted on March 14, 2014 at 02:50

So the code doesn't look bad, so this perhaps would be the point where you fire up your debugger and step into the code, and evaluate if it gets to your while loop.

You could try one of the examples, using a standard tool chain, and perhaps an ST-LINK

STM32F4xx_DSP_StdPeriph_Lib_V1.3.0\Project\STM32F4xx_StdPeriph_Examples\GPIO\GPIO_IOToggle
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..