Skip to content

[platform-stm32f4xx]: Implement sdram support - #338

Closed
luka177 wants to merge 1 commit into
littlekernel:masterfrom
luka177:f4-sdram
Closed

[platform-stm32f4xx]: Implement sdram support#338
luka177 wants to merge 1 commit into
littlekernel:masterfrom
luka177:f4-sdram

Conversation

@luka177

@luka177 luka177 commented Jul 22, 2022

Copy link
Copy Markdown
Contributor

No description provided.

@luka177 luka177 mentioned this pull request Jul 22, 2022
travisg added a commit that referenced this pull request Aug 23, 2026
Add an FMC SDRAM driver for the STM32F42x/43x parts and enable it on the
stm32f429i-disco target, which adds its 8MB of external SDRAM as a
second novm arena.

Salvaged from PR #338, approved in 2022 but never merged. Changes from
the original:

 - only compile sdram.c for the stm32f429 chip. The F40x parts have an
   FSMC without the SDRAM controller, so the driver does not build
   there and the PR as posted broke stm32f4-discovery-test.
 - NOVM_MAX_ARENAS=2 moves to the stm32f429i-disco target, next to the
   rest of the SDRAM configuration it belongs with, instead of being
   set for every F4 part.
 - declare stm_SDRAM_Init() in platform/sdram.h under its real name
   rather than repeating an extern in init.c. The header had carried a
   prototype for a differently named function that does not exist.

Compile tested on stm32f429i-disco-test and stm32f4-discovery-test,
confirming sdram.c is built only for the former. Not runtime tested on
hardware.

Co-authored-by: Travis Geiselbrecht <geist@foobox.com>
@travisg

travisg commented Aug 23, 2026

Copy link
Copy Markdown
Member

Thanks for this, and sorry it sat for so long — it was approved back in 2022 and then never landed.

I've merged it as 06b2f87 with your authorship preserved, plus three changes:

  • sdram.c is now compiled only for STM32_CHIP := stm32f429. The F40x parts have an FSMC without the SDRAM controller, so as posted this broke stm32f4-discovery-test (RCC_AHB3Periph_FMC, GPIO_AF_FMC and FMC_SDSR_BUSY are all undeclared there).
  • NOVM_MAX_ARENAS=2 moved to target/stm32f429i-disco/rules.mk, next to SDRAM_BASE/SDRAM_SIZE/ENABLE_SDRAM, rather than being set for every F4 part.
  • platform/sdram.h carried a prototype for SDRAM_Init(), which doesn't exist; renamed it to the real stm_SDRAM_Init() so init.c no longer needs its own extern.

Compile tested on stm32f429i-disco-test and stm32f4-discovery-test, confirming sdram.c is built only for the former. Not runtime tested — I don't have the board, so if you still have yours I'd appreciate a sanity check that the arena actually comes up.

Closing this in favour of the merged commit.

@travisg travisg closed this Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants