stm32: add STM32G474 support#181
Open
aslesar2015 wants to merge 1 commit into
Open
Conversation
Add STM32G474 to the processor selection and fix the flash erase logic in flash.c to support all G474 variants (single-bank mode only). Kconfig changes (stm32g474xx, 150MHz PLL, 512KB flash, 128KB RAM): - FLASH_SIZE 0x80000 covers the xE variant (most common); - RAM_SIZE 0x20000: SRAM1+SRAM2+SRAM3 are contiguous at 0x20000000. flash.c - separate G0 and G4 erase paths: - G474xB/xC (128/256KB): 2KB pages, direct PNB index; - G474xE single-bank (DBANK=0, factory default): 4KB pages, detected at runtime via FLASH->OPTR FLASH_OPTR_DBANK bit; - Removes incorrect G0 dual-bank arithmetic that was previously shared with G4, which corrupted page indices for addresses above 128KB. Kconfig: hide FDCAN pin options invalid on G4 (PB0/PB1, PD12/PD13, PC2/PC3 have no FDCAN alternate function on STM32G4 devices). Signed-off-by: Oleksii Sliesarevych <aslesar07@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add STM32G474 to the processor selection and fix the flash erase logic in flash.c to support all G474 variants (single-bank mode only).
Kconfig changes (stm32g474xx, 150MHz PLL, 512KB flash, 128KB RAM):
flash.c - separate G0 and G4 erase paths:
Kconfig: hide FDCAN pin options invalid on G4 (PB0/PB1, PD12/PD13, PC2/PC3 have no FDCAN alternate function on STM32G4 devices).
Tested on WeAct STM32G474 board (STM32G474CEU6, 512 KB flash variant):
Signed-off-by: Oleksii Sliesarevych aslesar07@gmail.com