cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F407VG_Discovery IAR printf() console

joshuahjamesmccrory
Associate II
Posted on September 02, 2016 at 00:16

Hey Guys, i'm using the printf() to console to debug basic issues as i'm integrating an STM32F407VG_Discovery with an X-NUCLEO-IHMO2A1. In the dspin libraries to set the clocks for communicating with the L6470 Motor Driver. 

my program is getting stuck after i select PLL as a system clock source.

i'm placing print statements after each point. And it stops printing after i run the function below.

any thoughts what might be causing the program to stick?

I'm doing this in the IAR IDE. The clock LED still cycles, but any additional print statements do not print.

 RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);

where

#define RCC_SYSCLKSource_PLLCLK       

   ((uint32_t)0x00000002)

void RCC_SYSCLKConfig(uint32_t RCC_SYSCLKSource)

{

  uint32_t tmpreg = 0;

printf(''INSIDE\n''); //111

  /* Check the parameters */

  assert_param(IS_RCC_SYSCLK_

SOURCE(RCC_SYSCLKSource));

printf(''asserted\n'');//1111

  tmpreg = RCC->CFGR;

printf(''1\n'');//11111

  /* Clear SW[1:0] bits */

  tmpreg &= ~RCC_CFGR_SW;

printf(''2\n'');//1111

  /* Set SW[1:0] bits according to RCC_SYSCLKSource value */

  tmpreg |= RCC_SYSCLKSource;

printf(''3\n'');//1111

  /* Store the new value */

  RCC->CFGR = tmpreg;

printf(''4\n'');//111

}

0 REPLIES 0