Skip to content

Commit 5d9a53e

Browse files
committed
STM32: Fetch Latest Drivers
1 parent 913b90c commit 5d9a53e

File tree

15 files changed

+53
-23897
lines changed

15 files changed

+53
-23897
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ jobs:
126126
uses: FreeRTOS/CI-CD-Github-Actions/spellings@main
127127
with:
128128
path: ./
129-
exclude-dirs: source/portable/NetworkInterface/STM32
130129

131130
formatting:
132131
runs-on: ubuntu-latest
@@ -136,7 +135,6 @@ jobs:
136135
uses: FreeRTOS/CI-CD-Github-Actions/formatting@main
137136
with:
138137
path: ./
139-
exclude-dirs: source/portable/NetworkInterface/STM32
140138

141139
doxygen:
142140
runs-on: ubuntu-latest

source/portable/NetworkInterface/STM32/CMakeLists.txt

Lines changed: 51 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,60 @@ if (NOT ( (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "STM32") ) )
33
endif()
44

55
#------------------------------------------------------------------------------
6-
add_library( freertos_plus_tcp_network_if STATIC )
7-
8-
set( FREERTOS_PLUS_TCP_STM32_IF_DRIVER "None" CACHE STRING "The driver sources to use with STM32 Network interface" )
9-
10-
target_sources( freertos_plus_tcp_network_if
11-
PRIVATE
12-
NetworkInterface.c
13-
$<$<STREQUAL:${FREERTOS_PLUS_TCP_STM32_IF_DRIVER},F4>:
14-
Drivers/F4/stm32f4xx_hal_eth.c>
15-
$<$<STREQUAL:${FREERTOS_PLUS_TCP_STM32_IF_DRIVER},F7>:
16-
Drivers/F7/stm32f7xx_hal_eth.c>
17-
$<$<STREQUAL:${FREERTOS_PLUS_TCP_STM32_IF_DRIVER},H5>:
18-
Drivers/H5/stm32h5xx_hal_eth_ex.c>
19-
$<$<STREQUAL:${FREERTOS_PLUS_TCP_STM32_IF_DRIVER},H5>:
20-
Drivers/H5/stm32h5xx_hal_eth.c>
21-
$<$<STREQUAL:${FREERTOS_PLUS_TCP_STM32_IF_DRIVER},H7>:
22-
Drivers/H7/stm32h7xx_hal_eth_ex.c>
23-
$<$<STREQUAL:${FREERTOS_PLUS_TCP_STM32_IF_DRIVER},H7>:
24-
Drivers/H7/stm32h7xx_hal_eth.c>
6+
add_library(freertos_plus_tcp_network_if STATIC)
7+
8+
set(FREERTOS_PLUS_TCP_STM32_IF_DRIVER "None" CACHE STRING "The driver sources to use with STM32 Network interface")
9+
set_property(CACHE FREERTOS_PLUS_TCP_STM32_IF_DRIVER PROPERTY STRINGS F4 F7 H5 H7 None)
10+
11+
set(_repo "")
12+
set(_tag "")
13+
if(FREERTOS_PLUS_TCP_STM32_IF_DRIVER STREQUAL "F4")
14+
set(_repo https://github.com/STMicroelectronics/stm32f4xx-hal-driver.git)
15+
set(_tag v1.8.4)
16+
elseif(FREERTOS_PLUS_TCP_STM32_IF_DRIVER STREQUAL "F7")
17+
set(_repo https://github.com/STMicroelectronics/stm32f7xx-hal-driver.git)
18+
set(_tag v1.3.2)
19+
elseif(FREERTOS_PLUS_TCP_STM32_IF_DRIVER STREQUAL "H5")
20+
set(_repo https://github.com/STMicroelectronics/stm32h5xx-hal-driver.git)
21+
set(_tag v1.5.0)
22+
elseif(FREERTOS_PLUS_TCP_STM32_IF_DRIVER STREQUAL "H7")
23+
set(_repo https://github.com/STMicroelectronics/stm32h7xx-hal-driver.git)
24+
set(_tag v1.11.5)
25+
endif()
26+
27+
if(_repo STREQUAL "")
28+
message(FATAL_ERROR "Set FREERTOS_PLUS_TCP_STM32_IF_DRIVER to one of: F4, F7, H5, H7.")
29+
endif()
30+
31+
include(FetchContent)
32+
FetchContent_Declare(stm32_eth_driver
33+
GIT_REPOSITORY ${_repo}
34+
GIT_TAG ${_tag}
35+
GIT_SHALLOW TRUE
36+
)
37+
FetchContent_MakeAvailable(stm32_eth_driver)
38+
39+
target_sources(freertos_plus_tcp_network_if
40+
PRIVATE
41+
NetworkInterface.c
42+
$<$<STREQUAL:${FREERTOS_PLUS_TCP_STM32_IF_DRIVER},F4>:${stm32_eth_driver_SOURCE_DIR}/Src/stm32f4xx_hal_eth.c>
43+
$<$<STREQUAL:${FREERTOS_PLUS_TCP_STM32_IF_DRIVER},F7>:${stm32_eth_driver_SOURCE_DIR}/Src/stm32f7xx_hal_eth.c>
44+
$<$<STREQUAL:${FREERTOS_PLUS_TCP_STM32_IF_DRIVER},H5>:${stm32_eth_driver_SOURCE_DIR}/Src/stm32h5xx_hal_eth_ex.c>
45+
$<$<STREQUAL:${FREERTOS_PLUS_TCP_STM32_IF_DRIVER},H5>:${stm32_eth_driver_SOURCE_DIR}/Src/stm32h5xx_hal_eth.c>
46+
$<$<STREQUAL:${FREERTOS_PLUS_TCP_STM32_IF_DRIVER},H7>:${stm32_eth_driver_SOURCE_DIR}/Src/stm32h7xx_hal_eth_ex.c>
47+
$<$<STREQUAL:${FREERTOS_PLUS_TCP_STM32_IF_DRIVER},H7>:${stm32_eth_driver_SOURCE_DIR}/Src/stm32h7xx_hal_eth.c>
2548
)
2649

27-
target_include_directories( freertos_plus_tcp_network_if
28-
PUBLIC
29-
$<$<STREQUAL:${FREERTOS_PLUS_TCP_STM32_IF_DRIVER},F4>:
30-
Drivers/F4>
31-
$<$<STREQUAL:${FREERTOS_PLUS_TCP_STM32_IF_DRIVER},F7>:
32-
Drivers/F7>
33-
$<$<STREQUAL:${FREERTOS_PLUS_TCP_STM32_IF_DRIVER},H5>:
34-
Drivers/H5>
35-
$<$<STREQUAL:${FREERTOS_PLUS_TCP_STM32_IF_DRIVER},H7>:
36-
Drivers/H7>
50+
target_include_directories(freertos_plus_tcp_network_if
51+
PUBLIC
52+
${stm32_eth_driver_SOURCE_DIR}/Inc
3753
)
3854

3955
target_link_libraries( freertos_plus_tcp_network_if
40-
PUBLIC
41-
freertos_plus_tcp_port
42-
freertos_plus_tcp_network_if_common
43-
PRIVATE
44-
freertos_kernel
45-
freertos_plus_tcp
56+
PUBLIC
57+
freertos_plus_tcp_port
58+
freertos_plus_tcp_network_if_common
59+
PRIVATE
60+
freertos_kernel
61+
freertos_plus_tcp
4662
)

0 commit comments

Comments
 (0)