Skip to content

Commit

Permalink
Merge pull request ObKo#336 from xanthio/feature/STM32U0xx-support
Browse files Browse the repository at this point in the history
Support STM32U0 Family
  • Loading branch information
Hish15 authored Apr 30, 2024
2 parents 8cfd141 + c1cb64b commit aa4b996
Show file tree
Hide file tree
Showing 14 changed files with 1,081 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
family: [C0, F0, F1, F2, F3, F4, F7, G0, G4, H5, H7, L0, L1, L4, L5, U5, WB, WL, MP1]
family: [C0, F0, F1, F2, F3, F4, F7, G0, G4, H5, H7, L0, L1, L4, L5, U0, U5, WB, WL, MP1]
fail-fast: false

steps:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
![Tests](https://github.com/ObKo/stm32-cmake/workflows/Tests/badge.svg)

This project is used to develop applications for the STM32 - ST's ARM Cortex-Mx MCUs.
It uses cmake and GCC, along with newlib (libc), STM32Cube. Supports C0 F0 F1 F2 F3 F4 F7 G0 G4 H7 L0 L1 L4 L5 U5 WB WL device families.
It uses cmake and GCC, along with newlib (libc), STM32Cube. Supports C0 F0 F1 F2 F3 F4 F7 G0 G4 H7 L0 L1 L4 L5 U0 U5 WB WL device families.

## Requirements

Expand Down Expand Up @@ -56,7 +56,7 @@ The most important set of variables which needs to be set can be found in the fo
These configuration options need to be set for the build process to work properly:

* `STM32_CUBE_<FAMILY>_PATH` - path to STM32Cube directory, where `<FAMILY>` is one
of `C0 F0 F1 F2 F3 F4 F7 G0 G4 H7 L0 L1 L4 L5 U5 WB WL` **default**: `/opt/STM32Cube<FAMILY>`
of `C0 F0 F1 F2 F3 F4 F7 G0 G4 H7 L0 L1 L4 L5 U0 U5 WB WL` **default**: `/opt/STM32Cube<FAMILY>`

These configuration variables are optional:

Expand Down
11 changes: 11 additions & 0 deletions cmake/FindBSP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,17 @@ set(BSP_MP1_COMPONENTS )
set(BSP_MP1_SOURCES_STM32MP15xx_DISCO bus stpmic1)
set(BSP_MP1_SOURCES_STM32MP15xx_EVAL bus stpmic1)

### U0 ###
set(BSP_U0_BOARDS
STM32U0xx_Nucleo STM32U083C_Discovery
)
set(BSP_U0_COMPONENTS
stts22h
)

set(BSP_U0_SOURCES_STM32U083C_Discovery stts22h)
set(BSP_U0_DEVICE_STM32U083C_Discovery U083CC)

### WB ###
set(BSP_WB_BOARDS
STM32WB15CC_Nucleo STM32WB55_Nucleo STM32WB55_USBDongle STM32WB5MM_Discovery
Expand Down
3 changes: 2 additions & 1 deletion cmake/stm32/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set(STM32_SUPPORTED_FAMILIES_LONG_NAME
STM32H5
STM32H7_M4 STM32H7_M7
STM32L0 STM32L1 STM32L4 STM32L5
STM32U5
STM32U0 STM32U5
STM32WB_M4 STM32WL_M4 STM32WL_M0PLUS
STM32MP1_M4 )

Expand Down Expand Up @@ -397,6 +397,7 @@ include(stm32/l0)
include(stm32/l1)
include(stm32/l4)
include(stm32/l5)
include(stm32/u0)
include(stm32/u5)
include(stm32/wb)
include(stm32/wl)
Expand Down
21 changes: 21 additions & 0 deletions cmake/stm32/devices.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1186,6 +1186,27 @@ set(STM32_ALL_DEVICES
MP157C
MP157D
MP157F
U031C6
U031C8
U031F4
U031F6
U031F8
U031G6
U031G8
U031K4
U031K8
U031R6
U031R8
U073CC
U073HC
U073KC
U073MC
U073RC
U083CC
U083HC
U083KC
U083MC
U083RC
U575CG
U575CI
U585CI
Expand Down
29 changes: 29 additions & 0 deletions cmake/stm32/u0.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
set(STM32_U0_TYPES
U031xx
U073xx
U083xx
)
set(STM32_U0_TYPE_MATCH
"U031.[468]"
"U073.C"
"U083.C"
)
set(STM32_U0_RAM_SIZES
12K
40K
40K
)
set(STM32_U0_CCRAM_SIZES
0K
0K
0K
)

stm32_util_create_family_targets(U0)

target_compile_options(STM32::U0 INTERFACE
-mcpu=cortex-m0plus
)
target_link_options(STM32::U0 INTERFACE
-mcpu=cortex-m0plus
)
8 changes: 4 additions & 4 deletions cmake/stm32/utilities.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ endfunction()
include(FetchContent)

# A CMSIS or HAL driver can specify 'cube' as version number to indicate that the driver is taken from the Cube repository
set(STM32_FETCH_FAMILIES C0 F0 F1 F2 F3 F4 F7 G0 G4 H5 H7 L0 L1 L4 L5 MP1 U5 WB WL )
set(STM32_FETCH_CUBE_VERSIONS v1.1.0 v1.11.2 v1.8.4 v1.9.3 v1.11.2 v1.28.0 v1.16.1 v1.4.1 v1.4.0 v1.1.0 v1.9.0 v1.12.0 v1.10.3 v1.17.0 v1.4.0 1.5.0 v1.4.0 v1.12.0 v1.1.0)
set(STM32_FETCH_CMSIS_VERSIONS v1.1.0 v2.3.5 v4.3.3 v2.2.5 v2.3.5 v2.6.9 v1.2.6 v1.4.0 v1.2.1 v1.1.0 v1.10.0 v1.9.1 v2.3.2 v1.7.1 v1.0.4 cube v1.3.1 v1.9.0 v1.1.0)
set(STM32_FETCH_FAMILIES C0 F0 F1 F2 F3 F4 F7 G0 G4 H5 H7 L0 L1 L4 L5 MP1 U0 U5 WB WL )
set(STM32_FETCH_CUBE_VERSIONS v1.1.0 v1.11.2 v1.8.4 v1.9.3 v1.11.2 v1.28.0 v1.16.1 v1.4.1 v1.4.0 v1.1.0 v1.9.0 v1.12.0 v1.10.3 v1.17.0 v1.4.0 1.5.0 v1.0.0 v1.4.0 v1.12.0 v1.1.0)
set(STM32_FETCH_CMSIS_VERSIONS v1.1.0 v2.3.5 v4.3.3 v2.2.5 v2.3.5 v2.6.9 v1.2.6 v1.4.0 v1.2.1 v1.1.0 v1.10.0 v1.9.1 v2.3.2 v1.7.1 v1.0.4 cube v1.0.0 v1.3.1 v1.9.0 v1.1.0)

set(STM32_FETCH_HAL_VERSIONS v1.1.0 v1.7.5 v1.1.8 v1.2.7 v1.5.5 v1.8.2 v1.2.9 v1.4.1 v1.2.1 v1.1.0 v1.10.0 v1.10.4 v1.4.4 v1.13.0 v1.0.4 cube v1.4.0 v1.9.0 v1.1.0)
set(STM32_FETCH_HAL_VERSIONS v1.1.0 v1.7.5 v1.1.8 v1.2.7 v1.5.5 v1.8.2 v1.2.9 v1.4.1 v1.2.1 v1.1.0 v1.10.0 v1.10.4 v1.4.4 v1.13.0 v1.0.4 cube v1.0.0 v1.4.0 v1.9.0 v1.1.0)



Expand Down
4 changes: 3 additions & 1 deletion tests/bsp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.16)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/stm32_gcc.cmake)

if(NOT TEST_FAMILIES)
set(TEST_FAMILIES C0 F0 F1 F2 F3 F4 F7 G0 G4 H7 L0 L1 L4 L5 MP1 U5 WB WL)
set(TEST_FAMILIES C0 F0 F1 F2 F3 F4 F7 G0 G4 H7 L0 L1 L4 L5 MP1 U0 U5 WB WL)
endif()

# Nucleo boards can have different devices on it
Expand All @@ -28,6 +28,8 @@ set(DEVICE_STM32L4xx_Nucleo_32 L412KB)
set(DEVICE_STM32L4xx_Nucleo_144 L496ZG)
set(DEVICE_STM32MP15xx_DISCO MP157CAC)
set(DEVICE_STM32MP15xx_EVAL MP157FAA)
set(DEVICE_STM32U0xx_Nucleo U031R8)
set(DEVICE_STM32U0xx_DISCO U083CC)
set(DEFINES_STM32469I_EVAL USE_IOEXPANDER)
set(DEFINES_STM32F769I_EVAL USE_IOEXPANDER)
set(DEFINES_STM32L476G_EVAL USE_IOEXPANDER)
Expand Down
Loading

0 comments on commit aa4b996

Please sign in to comment.