This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

why STM32F407 descovery flashed software takes effect after replugging the cable

I am using Keil to flash the software to my stm32f407 discovery. But the software only starts working when i pullout the JLINK cable and plug it again. Why is that? Thanks.

Parents
  • they say that its about the index variable being local

    you've missed the point.

    Did you follow the link I gave?

    The compiler sees your loop as totally pointless, so is perfectly entitled to optimise it out.

    It may help if you make the loop index volatile:

    	while(1)
    	{
    	    volatile uint32_t i;
    	    
    		GPIOD->BSRR=(1uL<<15);
    		
    		for( i=0; i<500000; i++ ){}
            
            GPIOD->BSRR=(1uL<<(15+16));		
    
    
    	}

Reply
  • they say that its about the index variable being local

    you've missed the point.

    Did you follow the link I gave?

    The compiler sees your loop as totally pointless, so is perfectly entitled to optimise it out.

    It may help if you make the loop index volatile:

    	while(1)
    	{
    	    volatile uint32_t i;
    	    
    		GPIOD->BSRR=(1uL<<15);
    		
    		for( i=0; i<500000; i++ ){}
            
            GPIOD->BSRR=(1uL<<(15+16));		
    
    
    	}

Children