Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

STM32F767 clock init crashes board #2692

Closed
Labels
bug 🐛Something isn't working
Milestone
@maxgerhardt

Description

@maxgerhardt

Describe the bug

When using the Nucleo-F767ZI board, or all other STMF767 boards as I can see, will fail to boot into a STM32Duino firmware because theSystemClock_Config() for those boards triggers anassert().

Specifically, this code does not initialize theRCC_OscInitStruct.PLL.PLLR value to a legal value

RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue =16;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
RCC_OscInitStruct.PLL.PLLM =8;
RCC_OscInitStruct.PLL.PLLN =216;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
RCC_OscInitStruct.PLL.PLLQ =9;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
Error_Handler();
}

Due toRCC_OscInitTypeDef RCC_OscInitStruct = {}; it will have value 0.

But then this assert will trigger

#if defined (RCC_PLLCFGR_PLLR)
assert_param(IS_RCC_PLLR_VALUE(RCC_OscInitStruct->PLL.PLLR));
#endif

Because A) For that chip,RCC_PLLCFGR_PLLR is defined and B) "0" is not valid forPLLR

#if defined (STM32F765xx)|| defined (STM32F767xx)|| defined (STM32F769xx)|| defined (STM32F777xx)|| defined (STM32F779xx)
#defineIS_RCC_PLLR_VALUE(VALUE) ((2 <= (VALUE)) && ((VALUE) <= 7))

To Reproduce
Blinky code on Nucleo F767 does not work. Chip crashes on startup.

#defineLED_PIN PB0// Default user LED (LD1)voidsetup() {    Serial.begin(115200);pinMode(LED_PIN, OUTPUT);    Serial.println("Setup Complete");}voidloop() {digitalWrite(LED_PIN, HIGH);// Turn LED ondelay(500);digitalWrite(LED_PIN, LOW);// Turn LED offdelay(500);}

Steps to reproduce the behavior:

  1. Plug in Nucleo F767
  2. Upload Blinky
  3. Nothing happens

Expected behavior
Clock init code should not crash chip.

Screenshots
Call stack of crash

Image

assert_failed (file=file@entry=0x8006534 “/Users/.platformio/packages/framework-arduinoststm32/system/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_rcc.c”, line=line@entry=601) at /Users/.platformio/packages/framework-arduinoststm32/libraries/SrcWrapper/src/stm32/stm32_def.c:3333 _Error_Handler((const char *)file, line);

Desktop (please complete the following information):

  • OS: Windows
  • Arduino IDE version: 2.3.4
  • STM32 core version: 2.10.1
  • Tools menu settings if not the default: Default
  • Upload method: SWD

Board (please complete the following information):

  • Name: Nucleo F767ZI
  • Hardware Revision: -/-
  • Extra hardware used if any: None

Additional context
Originally reported viaPlatformIO forum.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Something isn't working

    Type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp