Skip to content

Commit fa7b709

Browse files
HTRamseybjsowaMixaillHoldenactions-user
authored
Unified STM32 Network Interface (#804)
* New STM32 driver * New STM32 driver * Fix isr usage, add F4, and add missing xGetPhyLinkStatus * Style fixes and config implementations * update to 4.0.0 compatibility * Add STM32 target to Network Interface selection * Fill Interface and EndPoint fields for all Rx Network buffers * Ignore packets whose buffers were dropped * Fix formatting * Support network down event * Don't return pdPASS on interface initialize when link is down * Fix formatting * Include toplevel HAL headers * Clean redundant comment * Work on error handling * re-add doc * clean network interface * add more mac features * attribute fixes * remove commented out code and implement fixed configuration * update mac filter and hash table * fix compilation issue * prvMACAddressConfig: fix implicit discarding of const qualifier * ETH_IRQHandler: add tracing, process all interrupt flags before context switch * prvEMACHandlerTask: fix NetworkDown event * fix ipconfigUSE_LINKED_RX_MESSAGES == 0 * remove test files * allow access to pcLOCAL_ALL_NODES_MULTICAST_MAC in network interfaces * some restructuring * reconnection fixes * fix pcLOCAL_ALL_NODES_MULTICAST_MAC issue * config checks cleanup * remove a global * prep for mac filtering * add HAL_ETH_MspInit example * prep packet and frame filtering * add sample mpu config * mac filter improvements * improve some checks * config improvements * cache fixes * fix cache size macro * remove caching option * testing updates * fix mac filtering * outgoing packet adjustments * fix interrupt priority set * remove C99 requirement * readd caching and reduce reliance on HAL * remove testing code * Fix function calls * fix cache enabled check * config checks * check static buffer size and fix caching defines * Uncrustify: triggered by comment. * add spellings * Uncrustify: triggered by comment. * remove xCheckLoopback() usage * Fix Phy function return value * Revert ND changes * Enable MAC filtering Netif functions * Add Current HAL Drivers * Handle Driver Differences * Exclude portable STM32 for spelling and formating check * Apply suggestions from code review Co-authored-by: Błażej Sowa <[email protected]> * Increment MAC entry index * Fix packet length assert * Review Fixes * Fix spell check CI test --------- Co-authored-by: Holden <holden-zenithaerotech.com> Co-authored-by: Błażej Sowa <[email protected]> Co-authored-by: holden-zenith <[email protected]> Co-authored-by: Mikhail Paulyshka <[email protected]> Co-authored-by: Holden <[email protected]> Co-authored-by: GitHub Action <[email protected]> Co-authored-by: Ching-Hsin,Lee <[email protected]> Co-authored-by: chinglee-iot <[email protected]> Co-authored-by: Rahul Kar <[email protected]> Co-authored-by: Tony Josi <[email protected]>
1 parent 4f67761 commit fa7b709

32 files changed

+25314
-5
lines changed

.github/.cSpellWords.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ DEFR
229229
Deglitchers
230230
DEMCR
231231
DEREN
232+
Descs
232233
DEVAD
233234
DFREERTOS
234235
DFSR
@@ -394,6 +395,8 @@ ETHERC
394395
ethernetif
395396
ETHMACRX
396397
ETHMACTX
398+
ETHTX
399+
ETHRX
397400
ETIE
398401
EVCNT
399402
EVCNTR
@@ -441,6 +444,7 @@ FFSR
441444
FIFOSZ
442445
FLMSK
443446
FMAC
447+
FNUM
444448
FOLDEVTENA
445449
FORCEWT
446450
FORWARDALLEXCEPTPA
@@ -477,6 +481,14 @@ Gpbs
477481
GPCNTRL
478482
gpio
479483
GPIO
484+
GPIOA
485+
GPIOB
486+
GPIOC
487+
GPIOD
488+
GPIOE
489+
GPIOF
490+
GPIOG
491+
GPIOH
480492
GPSL
481493
GPSLCE
482494
gptimer
@@ -593,6 +605,7 @@ IVLTV
593605
IVTIR
594606
JABBR
595607
JFRAME
608+
Jndex
596609
jscott
597610
jscotts
598611
karkhaz
@@ -677,6 +690,7 @@ MACECR
677690
MACFCR
678691
MACHT
679692
MACHTLR
693+
MACHWF
680694
MACIMR
681695
MACISR
682696
MACMDIOAR
@@ -922,6 +936,7 @@ Picovolts
922936
PIDEVAD
923937
pidr
924938
PIDR
939+
PINSEL
925940
PIOA
926941
PKHBT
927942
pkhtb
@@ -1322,6 +1337,7 @@ TBFT
13221337
TBQB
13231338
TBQBAPQ
13241339
TBUE
1340+
TBUS
13251341
TCKER
13261342
TCMSSV
13271343
TCOMP

.github/workflows/ci.yml

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

130131
formatting:
131132
runs-on: ubuntu-20.04
@@ -135,6 +136,7 @@ jobs:
135136
uses: FreeRTOS/CI-CD-Github-Actions/formatting@main
136137
with:
137138
path: ./
139+
exclude-dirs: source/portable/NetworkInterface/STM32
138140

139141
doxygen:
140142
runs-on: ubuntu-latest

CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ set(FREERTOS_PLUS_TCP_NETWORK_IF_LIST
7171
POSIX WIN_PCAP # Native Linux & Windows respectively
7272
RX
7373
SH2A
74-
STM32FXX STM32HXX # ST Micro
74+
STM32 # ST Micro
7575
MSP432
7676
TM4C
7777
XILINX_ULTRASCALE ZYNQ # AMD/Xilinx
@@ -117,8 +117,7 @@ if(NOT FREERTOS_PLUS_TCP_NETWORK_IF IN_LIST FREERTOS_PLUS_TCP_NETWORK_IF_LIST )
117117
" PIC32MZEF_WIFI Target: pic32mzef Wifi Tested: TODO\n"
118118
" RX Target: RX Tested: TODO\n"
119119
" SH2A Target: SH2A Tested: TODO\n"
120-
" STM32FXX Target: STM32Fxx Tested: TODO\n"
121-
" STM32HXX Target: STM32Hxx Tested: TODO\n"
120+
" STM32 Target: STM32 Tested: TODO\n"
122121
" MSP432 Target: MSP432 Tested: TODO\n"
123122
" TM4C Target: TM4C Tested: TODO\n"
124123
" WIN_PCAP Target: Windows Tested: TODO\n"

source/portable/NetworkInterface/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ add_subdirectory(mw300_rd)
4949
add_subdirectory(pic32mzef)
5050
add_subdirectory(RX)
5151
add_subdirectory(SH2A)
52-
add_subdirectory(STM32Fxx)
53-
add_subdirectory(STM32Hxx)
52+
add_subdirectory(STM32)
5453
add_subdirectory(ThirdParty/MSP432)
5554
add_subdirectory(TM4C)
5655
add_subdirectory(WinPCap)
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
if (NOT ( (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "STM32") ) )
2+
return()
3+
endif()
4+
5+
#------------------------------------------------------------------------------
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>
25+
)
26+
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>
37+
)
38+
39+
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
46+
)

0 commit comments

Comments
 (0)