Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,22 @@ Nucleo_64.menu.pnum.NUCLEO_F030R8.build.variant=STM32F0xx/F030R8T
Nucleo_64.menu.pnum.NUCLEO_F030R8.openocd.target=stm32f0x
Nucleo_64.menu.pnum.NUCLEO_F030R8.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32F0xx/STM32F0x0.svd

# NUCLEO_F030R8 with internal HSI clock (including MB1136 C-01)
# Docs: url=https://www.st.com/en/evaluation-tools/nucleo-f030r8.html
# Docs: notes=Internal HSI / 2 x 12 = 48 MHz; suitable for MB1136 C-01 without ST-LINK MCO.
Nucleo_64.menu.pnum.NUCLEO_F030R8_HSI=Nucleo F030R8 (HSI, 48 MHz)
Nucleo_64.menu.pnum.NUCLEO_F030R8_HSI.node="NODE_F030R8,NUCLEO"
Nucleo_64.menu.pnum.NUCLEO_F030R8_HSI.upload.maximum_size=65536
Nucleo_64.menu.pnum.NUCLEO_F030R8_HSI.upload.maximum_data_size=8192
Nucleo_64.menu.pnum.NUCLEO_F030R8_HSI.build.mcu=cortex-m0
Nucleo_64.menu.pnum.NUCLEO_F030R8_HSI.build.board=NUCLEO_F030R8
Nucleo_64.menu.pnum.NUCLEO_F030R8_HSI.build.series=STM32F0xx
Nucleo_64.menu.pnum.NUCLEO_F030R8_HSI.build.product_line=STM32F030x8
Nucleo_64.menu.pnum.NUCLEO_F030R8_HSI.build.variant=STM32F0xx/F030R8T
Nucleo_64.menu.pnum.NUCLEO_F030R8_HSI.openocd.target=stm32f0x
Nucleo_64.menu.pnum.NUCLEO_F030R8_HSI.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32F0xx/STM32F0x0.svd
Nucleo_64.menu.pnum.NUCLEO_F030R8_HSI.build.st_extra_flags=-D{build.product_line} {build.enable_usb} {build.xSerial} -DNUCLEO_F030R8_USE_HSI

# NUCLEO_F070RB board
# Docs: release=2.0.0
# Docs: url=http://www.st.com/en/evaluation-tools/nucleo-f070rb.html
Expand Down
8 changes: 8 additions & 0 deletions docs/customization/Custom-definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,14 @@ extern "C" void SystemClock_Config() {
}
```

### NUCLEO-F030R8 clock source

For a NUCLEO-F030R8 without an external HSE clock, select **Nucleo F030R8 (HSI, 48 MHz)** under **Tools > Board part number**. This uses the internal 8 MHz HSI oscillator divided by 2 and multiplied by 12, giving a nominal 48 MHz system clock. No sketch changes are required.

The existing **Nucleo F030R8** option continues to use an 8 MHz external clock in HSE bypass mode, normally provided by ST-LINK MCO, multiplied by 6 to reach 48 MHz. Both options share the same pin mapping, memory layout, upload methods and debugger configuration.

[UM1724, section 7.9.1](https://www.st.com/resource/en/user_manual/dm00105823.pdf) documents MB1136 C-01 as configured with HSE not used, and C-02 or higher as configured with ST-LINK MCO connected. Choose the option that matches the actual clock wiring, which can differ after solder-bridge modifications. The internal HSI oscillator has lower frequency accuracy than a suitable external clock source; consider this for applications with strict timing requirements.

## Enable UCPD dead battery behavior

> [!NOTE]
Expand Down
1 change: 1 addition & 0 deletions docs/supported-boards/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
| [Nucleo C092RC](https://www.st.com/en/evaluation-tools/nucleo-c092rc.html) | [STM32C092RC](https://www.st.com/en/microcontrollers-microprocessors/stm32c092rc.html) | `NUCLEO_C092RC` | 2.11.0 | |
| [Nucleo C562RE](https://www.st.com/en/evaluation-tools/stm32-nucleo-boards.html) | [STM32C562RE](https://www.st.com/en/microcontrollers-microprocessors/stm32c562re.html) | `NUCLEO_C562RE` | 3.0.0 | |
| [Nucleo F030R8](http://www.st.com/en/evaluation-tools/nucleo-f030r8.html) | [STM32F030R8](https://www.st.com/en/microcontrollers-microprocessors/stm32f030r8.html) | `NUCLEO_F030R8` | 0.2.0 | |
| [Nucleo F030R8 (HSI, 48 MHz)](https://www.st.com/en/evaluation-tools/nucleo-f030r8.html) | [STM32F030R8](https://www.st.com/en/microcontrollers-microprocessors/stm32f030r8.html) | `NUCLEO_F030R8` | Next release | Internal HSI / 2 x 12 = 48 MHz; suitable for MB1136 C-01 without ST-LINK MCO. |
| [Nucleo F070RB](http://www.st.com/en/evaluation-tools/nucleo-f070rb.html) | [STM32F070RB](https://www.st.com/en/microcontrollers-microprocessors/stm32f070rb.html) | `NUCLEO_F070RB` | 2.0.0 | |
| [Nucleo F072RB](http://www.st.com/en/evaluation-tools/nucleo-f072rb.html) | [STM32F072RB](https://www.st.com/en/microcontrollers-microprocessors/stm32f072rb.html) | `NUCLEO_F072RB` | 1.9.0 | |
| [Nucleo F091RC](http://www.st.com/en/evaluation-tools/nucleo-f091rc.html) | [STM32F091RC](https://www.st.com/en/microcontrollers-microprocessors/stm32f091rc.html) | `NUCLEO_F091RC` | 0.1.0 | |
Expand Down
11 changes: 11 additions & 0 deletions variants/STM32F0xx/F030R8T/variant_NUCLEO_F030R8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,22 @@ WEAK void SystemClock_Config(void)
* Initializes the RCC Oscillators according to the specified parameters
* in the RCC_OscInitTypeDef structure.
*/
#if defined(NUCLEO_F030R8_USE_HSI)
/* Use HSI when no external clock is connected, e.g. MB1136 C-01. */
/* HSI 8 MHz / 2 * 12 = 48 MHz. */
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL12;
#else
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6;
#endif
RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV1;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend to test the return value of HAL_RCC_OscConfig and if it is HAL_TIMEOUT then configure the HSI. This would avoid to have 2 entries.
HAL_RCC_OscConfig enable and Wait till HSE is ready if not then return HAL_TIMEOUT

Error_Handler();
Expand Down
Loading