# Problem with update to Keil uVision 5 with STM32F4 discovery

My dev system doesnt work in Keil with STM32F4 discovery (STM32F407VG). I am using uVision 5. All my drivers are up to date. The code gets compiled without any errors, however, I cant get the Logic Analyzer to show any data. With the board, the core clock is 16 MHz. I have all combinations of core Clocks in the Trace Tab. The weird part is that the same settings and code seems to work with uVision 4 with 16 MHz as the core clock in Trace Tab. Can anyone tell me what am i doing wrong in uVision 5?

• As pointed out below, this has nothing to do with the logic analyzer. Can you edit the question and title to fix this? – Scott Seidman Jun 26 '15 at 12:48

After spending the hole afternoon, I finally managed to solve the issue. In my case, I was using the STM32F334 Discovery kit.

There is a Solder Pad that must be closed in order to be able to trace variables. (SB17 in STM32F334 Discovery kit).

by default, this is open. I just soldered the pad, and it is working fine now.

I have had the same problem and it has annoyed me all day!

I have fixed it now though - basically you need to set the core clock up properly in uVision 5. In earlier versions (up to 5.10 or so) you used to be able to do this in system_stm32f4xx.c with PLL_M and PLL_Q #defines (8 and 7 respectively) - however in later versions (I am using v5.15) it seems this has been taken away. You now have to set the clock up with something like:

void SystemClock_Config(void)
{
RCC_OscInitTypeDef RCC_OscInitStruct;
RCC_ClkInitTypeDef RCC_ClkInitStruct;

/* Enable Power Control clock */
__HAL_RCC_PWR_CLK_ENABLE();

/* The voltage scaling allows optimizing the power consumption when the
device is clocked below the maximum system frequency (see datasheet). */
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);

/* Enable HSE Oscillator and activate PLL with HSE as source */
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLM = 8;
RCC_OscInitStruct.PLL.PLLN = 336;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
RCC_OscInitStruct.PLL.PLLQ = 7;
HAL_RCC_OscConfig(&RCC_OscInitStruct);

/* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2
clocks dividers */
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1 |
RCC_CLOCKTYPE_PCLK2;
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5);
}


Which seems to work for me to set the SystemCoreClock running at 168MHz (which is what it should be).

I can get the logic analyser working and also the event trace for RTOS code.

Hope this helps - and if there is an easier way to do this I would be very glad to hear it!