[stm32l1] Implement initial support for stm32l1#36
Merged
AlexLanzano merged 1 commit intowolfSSL:mainfrom Apr 23, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds initial STM32L1 platform support (targeting STM32L152RE Nucleo) to wolfHAL by introducing STM32L1-specific drivers (some as aliases to existing STM32 families), plus a new board port and CI build entry.
Changes:
- Added STM32L1 HAL drivers/config headers for RCC, PWR, Flash, I2C, and thin aliases for GPIO/UART/SPI/IWDG/WWDG.
- Added STM32L152RE Nucleo board port (startup/IVT, linker script, board init, Makefile) and registered it in CI/workflow + boards README.
- Updated test utilities and GPIO/Flash tests to be less board-hardcoded.
Reviewed changes
Copilot reviewed 41 out of 41 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
| wolfHAL/watchdog/stm32l1_wwdg.h | Adds STM32L1 WWDG API as alias of STM32F0 WWDG. |
| wolfHAL/watchdog/stm32l1_iwdg.h | Adds STM32L1 IWDG API as alias of STM32WB IWDG + prescaler symbols. |
| wolfHAL/uart/stm32l1_uart.h | Adds STM32L1 UART API as alias of STM32F4 UART and exports BRR macro. |
| wolfHAL/supply/stm32l1_pwr.h | Introduces STM32L1 PWR/VOS configuration API. |
| wolfHAL/spi/stm32l1_spi.h | Adds STM32L1 SPI API as alias of STM32F4 SPI. |
| wolfHAL/platform/st/stm32l152re.h | Defines STM32L152RE device regmaps/drivers and clock-gate descriptors. |
| wolfHAL/platform/arm/cortex_m3.h | Adds Cortex-M3 platform regmaps/drivers for SysTick and NVIC. |
| wolfHAL/i2c/stm32l1_i2c.h | Introduces STM32L1 I2C V1 driver configuration/API. |
| wolfHAL/gpio/stm32l1_gpio.h | Adds STM32L1 GPIO API as alias of STM32WB GPIO types/symbols. |
| wolfHAL/flash/stm32l1_flash.h | Introduces STM32L1 flash driver config + latency API. |
| wolfHAL/clock/stm32l1_rcc.h | Introduces STM32L1 RCC driver config (SYSCLK + PLL + gates). |
| tests/test.h | Adds WHAL_ASSERT_MEM_NEQ test assertion helper. |
| tests/gpio/test_stm32wb_gpio.c | Makes GPIO tests derive LED port/pin from GPIO config instead of board macros. |
| tests/gpio/test_stm32l1_gpio.c | Reuses STM32WB GPIO tests for STM32L1 via include. |
| tests/flash/test_flash.c | Refactors/condenses flash tests into a single write/read/erase test. |
| src/watchdog/stm32wb_iwdg.c | Extends mapping guards to support STM32L1 IWDG aliasing. |
| src/watchdog/stm32l1_wwdg.c | Builds STM32L1 WWDG by including STM32F0 implementation. |
| src/watchdog/stm32l1_iwdg.c | Builds STM32L1 IWDG by including STM32WB implementation. |
| src/watchdog/stm32f0_wwdg.c | Extends mapping guards to support STM32L1 WWDG aliasing. |
| src/uart/stm32l1_uart.c | Builds STM32L1 UART by including STM32F4 implementation. |
| src/uart/stm32f4_uart.c | Extends mapping guards to allow STM32L1 to reuse STM32F4 UART implementation. |
| src/supply/stm32l1_pwr.c | Implements STM32L1 PWR VOS range programming and vtable. |
| src/spi/stm32l1_spi.c | Builds STM32L1 SPI by including STM32F4 implementation. |
| src/spi/stm32f4_spi.c | Extends mapping guards to allow STM32L1 to reuse STM32F4 SPI implementation. |
| src/i2c/stm32l1_i2c.c | Implements STM32L1 I2C V1 master polling driver. |
| src/gpio/stm32wb_gpio.c | Extends mapping guards to support STM32L1 GPIO aliasing. |
| src/gpio/stm32l1_gpio.c | Builds STM32L1 GPIO by including STM32WB implementation. |
| src/flash/stm32l1_flash.c | Implements STM32L1 PECR-based flash read/write/erase + latency helper. |
| src/clock/stm32l1_rcc.c | Implements STM32L1 RCC clock switching, PLL setup, and clock gating. |
| boards/stm32wba55cg_nucleo/board.h | Removes LED port/pin macros now derived from GPIO config in tests. |
| boards/stm32wb55xx_nucleo/board.h | Removes LED port/pin macros now derived from GPIO config in tests. |
| boards/stm32f302r8_nucleo/board.h | Removes LED port/pin macros now derived from GPIO config in tests. |
| boards/stm32f091rc_nucleo/board.h | Removes LED port/pin macros now derived from GPIO config in tests. |
| boards/stm32c031_nucleo/board.h | Removes LED port/pin macros now derived from GPIO config in tests. |
| boards/stm32l152re_nucleo/linker.ld | Adds STM32L152RE linker script for bare-metal build. |
| boards/stm32l152re_nucleo/ivt.c | Adds STM32L152RE startup/IVT and minimal memcpy/memset. |
| boards/stm32l152re_nucleo/board.h | Adds STM32L152RE board declarations and flash geometry. |
| boards/stm32l152re_nucleo/board.c | Adds STM32L152RE board init/deinit and device instances. |
| boards/stm32l152re_nucleo/Makefile.inc | Adds board build configuration for STM32L152RE Nucleo. |
| boards/README.md | Documents new STM32L152RE board. |
| .github/workflows/boards.yml | Adds STM32L152RE Nucleo to CI board build matrix. |
Comments suppressed due to low confidence (1)
wolfHAL/platform/arm/cortex_m3.h:1
- Including
cortex_m4_nvic.hfrom the Cortex-M3 platform header is confusing and makes it look like the wrong NVIC implementation is being used. If the NVIC code is intended to be shared across M3/M4, consider moving/renaming the header to a neutral name (e.g.,cortex_m_nvic.h) and including that instead to avoid misleading platform coupling.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.