Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Bug]: LL_SetFlashLatency() sets 2 wait states instead of 4 wait states in VOS0 at 240 MHz HCLK on STM32H74x/H75x (DEV_ID 0x450)

Aperta Adatta ai principianti
#349 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
c
Ambito
embedded-iot

Direzione di ricerca

Apri Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_ll_utils.c e individua LL_SetFlashLatency(). Trova dove mancano le definizioni di UTILS_SCALE0_LATENCYx_FREQ per DEV_ID 0x450 e aggiungile seguendo il modello utilizzato per DEV_ID 0x480/0x483. Verifica che la correzione assicuri che 240 MHz HCLK in modalità VOS0 imposta LL_FLASH_LATENCY_4 (4 stati di attesa).

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Bug Summary

LL_SetFlashLatency() in stm32h7xx_ll_utils.c has no VOS0 definitions for DEV_ID 0x450 (STM32H74x/H75x) and configures FLASH_ACR with 2 wait states instead of 4 wait states when running at 240 MHz HCLK in VOS0 mode.

Detailed Description
  1. Problem:
    On STM32H742/743/750/753 and STM32H745/747/755/757 (DEV_ID 0x450), LL_SetFlashLatency() in Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_ll_utils.c sets flash wait states via LL_SetFlashLatency(new_hclk_freq).

For DEV_ID 0x450, there are no UTILS_SCALE0_LATENCYx_FREQ definitions in stm32h7xx_ll_utils.c (unlike DEV_ID 0x480/0x483). Because VOS0 reads back as Scale 1 (PWR_D3CR_VOS_0 | PWR_D3CR_VOS_1), LL_SetFlashLatency() executes the Scale 1 branch where UTILS_SCALE1_LATENCY2_FREQ is defined as 240000000U. Consequently, at 240 MHz HCLK (480 MHz Core with HPRE = 2), the function programs LL_FLASH_LATENCY_2 (2 wait states / 3 CPU cycles).

  1. Reference Manual:
    Per RM0433 Rev 8 (Table 17), flash latency in VOS0 requires:
  • 140 < HCLK <= 210 MHz: 2 WS (3 CPU cycles)
  • 210 < HCLK <= 225 MHz: 3 WS (4 CPU cycles)
  • 225 < HCLK <= 240 MHz: 4 WS (5 CPU cycles)
  1. Reference Issue & Pull Request:
Expected Behavior

When LL_SetFlashLatency() is called with HCLK_Frequency = 240000000 (240 MHz) on STM32H7 in VOS0 mode (SYSCFG_PWRCR_ODEN set), it should set FLASH_ACR to LL_FLASH_LATENCY_4 (4 wait states).

Actual Behavior

LL_SetFlashLatency() sets FLASH_ACR to LL_FLASH_LATENCY_2 (2 wait states).

Environment
  • Repository: STMicroelectronics/STM32CubeH7 / stm32h7xx-hal-driver - Files: Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_ll_utils.c, Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_ll_utils.h - Affected Devices: STM32H742/743/750/753 (DEV_ID 0x450)
Severity

Normal

Lingua principale
C
Stelle
773
Fork
369
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di STMicroelectronics/STM32CubeH7

Tutte le issue di STMicroelectronics/STM32CubeH7

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.