10 years ago.

Using external 3.3V Power supply

I use a Nucleo F411RE, it works fine, when using the USB ST_LINK supply. I want to use an external 3.3V (Harvested from solar cell) supply.

I have removed SB12 (NRST) and SB2 (LDO Out) as explained in the NUCLEO User Manual.

What happen is thet the program still work but the frequency is somewhere divided by 32.

So I guess that the concern is that when we removing the ST_LINK, the 8MHz is not provided anymore and the STM32F411 runs on some intenal OSC. What is the setup I have to add in my code (and where) to get an equivalent behavioral when running from 3.3V external.

Question relating to:

Affordable and flexible platform to ease prototyping using a STM32F411RET6 microcontroller.

It seems that it is a problem of clock seting.

When I add the following initialisation routine, I can remove the cable or even Reset the board. But if I power it OFF it does not restart:

- Setup Routine for Clock ----- void SystemClock_Config_fbd(void) { HAL_RCC_DeInit(); we have to reset the clock settings ! RCC_ClkInitTypeDef RCC_ClkInitStruct; RCC_OscInitTypeDef RCC_OscInitStruct;

RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; internal 16MHz RC RCC_OscInitStruct.HSIState = RCC_HSI_ON; RCC_OscInitStruct.HSICalibrationValue = 6; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; PLL on RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; RCC_OscInitStruct.PLL.PLLM = 16; setup PLL divider RCC_OscInitStruct.PLL.PLLN = 336; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4; RCC_OscInitStruct.PLL.PLLQ = 4; HAL_RCC_OscConfig(&RCC_OscInitStruct);

RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK|RCC_CLOCKTYPE_PCLK1; RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2); SystemCoreClockUpdate(); update SystemCoreClock var

}

posted by francois DRUILHE 24 Nov 2014

This is solved now. I did load the mbed source code (instead of the oject one) and modified file: system_stm32f4xx.c (into TARGETSTM/TARGET_NUCLEO_F411RE/ by: /* Select the clock sources (other than HSI) to start with (0=OFF, 1=ON) */

  1. define USE_PLL_HSE_EXTC (0) /* Use external clock */
  2. define USE_PLL_HSE_XTAL (0) /* Use external xtal */

And it works fine now.

posted by francois DRUILHE 13 Dec 2014
Be the first to answer this question.